Skip to content

test(native): assert registry Dispatch parity with DispatchOperations#155

Merged
leo-aa88 merged 2 commits into
mainfrom
test/registry-dispatch-parity-130
Jun 8, 2026
Merged

test(native): assert registry Dispatch parity with DispatchOperations#155
leo-aa88 merged 2 commits into
mainfrom
test/registry-dispatch-parity-130

Conversation

@leo-aa88

@leo-aa88 leo-aa88 commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Replaces the Registry.Dispatch switch with a dispatchHandlers map as the single source of truth for non-shell native operations.
  • Derives DispatchOperations from handler keys so runtime dispatch and policy-lint metadata cannot drift silently.
  • Adds TestRegistryDispatchMatchesCatalog, dispatch smoke/failure-path tests, and pull_request.fetch offline contract coverage.

Closes #130.

Test plan

  • go test ./internal/tools/native/... -race
  • make ci (verify-fmt, vet, test with race detector)
  • Adding a handler to dispatchHandlers without an operationCatalog entry fails TestRegistryDispatchMatchesCatalog
  • Adding an operationCatalog entry without a handler fails TestRegistryDispatchMatchesCatalog

Replace the Registry.Dispatch switch with a dispatchHandlers map as the
single source of truth for non-shell operations. Derive DispatchOperations
from handler keys and add drift tests so new handlers without catalog
metadata fail CI.

Closes #130.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

ReviewGate [PASS] PASS

Stats

  • Files changed: 4
  • Raw LOC changed: 328
  • LOC after §10.4 exclusions (human_loc_changed): 328
  • PR author class: human (human collaborator account) — login leo-aa88 (§10.4.2).

No deterministic warnings fired.

Suggested labels: reviewability-pass

File categories: 4 files (0 risky)

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Automated review

Summary

Comprehensive refactor of native operations with good test coverage.

Findings

  • No issues found.

Use O(1) dispatchHandlers lookup in OperationKnown, add pull_request.fetch
and offline echo/identity dispatch tests, and drop redundant handler-slice
parity test. Drift guard verified manually for orphan handler/catalog cases.

Co-authored-by: Cursor <cursoragent@cursor.com>
@leo-aa88 leo-aa88 merged commit 90241bc into main Jun 8, 2026
7 checks passed
@leo-aa88 leo-aa88 deleted the test/registry-dispatch-parity-130 branch June 8, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(native): assert registry Dispatch switch parity with DispatchOperations

1 participant