Skip to content

G3: vendored hook schemas + CI drift detector - #947

Merged
jonathanKingston merged 2 commits into
mainfrom
jkt/auto/hooks-g3-schema-drift-4399
Jul 18, 2026
Merged

jonathanKingston merged 2 commits into
mainfrom
jkt/auto/hooks-g3-schema-drift-4399

Conversation

@jonathanKingston

Copy link
Copy Markdown
Collaborator

Summary

Implements G3 from the hooks plan: vendored Claude SchemaStore + Cursor community hook schemas; warn-level authoring lint only; CI drift detector vs adapter-known events.

Stacked on #946 (G2) → #945 (G1) → … → #913 (A1).

Acceptance criteria (from plan G3 row)

  • Pin Claude SchemaStore + Cursor community schemas
  • Warn-level authoring lint only, never a load gate, never remote-fetched
  • CI test diffs published event lists vs adapter-known events

Deliverables

  • schemas/vendor/ with provenance README
  • vendor-schema-drift.test.ts
  • Claude unknown/unsupported event warnings (parity with Cursor)

Tests

  • npm run check green (2965 tests)

Test plan

  • npm run check
  • CI green
Open in Web Open in Cursor 

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

E2E screenshot updates

Merge conflict needs a human (27)

Screenshot conflicts with main are resolved automatically, but these non-screenshot files conflict and can't be auto-merged. Resolve them by hand (merge or rebase main) — the screenshot reconcile was skipped:

  • docs/plans/hooks-and-feature-packs.md
  • docs/ui-taste.md
  • packages/agent/src/hooks/canonical-event-catalogue.test.ts
  • packages/agent/src/hooks/canonical-events.ts
  • packages/agent/src/hooks/command-executor.ts
  • packages/agent/src/hooks/hook-registry.ts
  • packages/agent/src/index.ts
  • src/main/ipc/register-handlers.ts
  • src/main/services/agent-service.ts
  • src/main/services/diff-queue.ts
  • src/main/services/hooks/after-file-edit.ts
  • src/main/services/hooks/before-submit-prompt.test.ts
  • src/main/services/hooks/before-submit-prompt.ts
  • src/main/services/hooks/claude-adapter.test.ts
  • src/main/services/hooks/claude-adapter.ts
  • src/main/services/hooks/command-hook-runner.test.ts
  • src/main/services/hooks/command-hook-runner.ts
  • src/main/services/hooks/cursor-adapter.test.ts
  • src/main/services/hooks/cursor-adapter.ts
  • src/main/services/hooks/dialect-adapter.ts
  • src/main/services/hooks/dialect-registry.ts
  • src/main/services/hooks/failClosed-both-modes.test.ts
  • src/main/services/hooks/hook-spawn.ts
  • src/main/services/hooks/tool-gate.ts
  • src/main/services/security/permission-gate.ts
  • src/shared/types/cursor-hooks.ts
  • tests/e2e/helpers/seed-config.ts

These PNGs live under tests/e2e/screenshots/ for human visual review; CI asserts DOM structure, not pixel diffs.

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Merge conflict needs a human

main advanced and screenshot conflicts were resolved automatically, but these non-screenshot files conflict and can't be auto-merged. Resolve them by hand (merge or rebase main):

  • docs/plans/hooks-and-feature-packs.md
  • docs/ui-taste.md
  • schemas/copse-hooks.schema.json
  • src/main/ipc/register-handlers.ts
  • src/main/services/agent-service.ts
  • src/main/services/diff-queue.ts
  • src/main/services/hook-run-recorder.ts
  • src/main/services/hooks/after-tool-use.ts
  • src/main/services/hooks/async-cannot-inject.test.ts
  • src/main/services/hooks/claude-adapter.test.ts
  • src/main/services/hooks/claude-adapter.ts
  • src/main/services/hooks/command-hook-runner.ts
  • src/main/services/hooks/continuation-ledger.ts
  • src/main/services/hooks/copse-adapter.ts
  • src/main/services/hooks/diff-apply.ts
  • src/main/services/hooks/halt-run.test.ts
  • src/main/services/hooks/halt-run.ts
  • src/main/services/hooks/hook-queue-channel.ts
  • src/main/services/hooks/permission-decision.ts
  • src/main/services/hooks/post-turn-review.ts
  • src/main/services/hooks/session-start.ts
  • src/main/services/hooks/stop.ts
  • src/main/services/hooks/subagent.ts
  • src/main/services/security/permission-gate.ts
  • src/renderer/controller/message-queue.test.ts
  • src/renderer/controller/message-queue.ts
  • src/shared/types/hooks.ts
  • tests/e2e/helpers/seed-config.ts

@cursor
cursor Bot force-pushed the jkt/auto/hooks-g2-dry-run-tester-4399 branch from 0d4cbf1 to 57ea5b7 Compare July 18, 2026 14:00
@cursor
cursor Bot deleted the branch main July 18, 2026 14:49
@cursor
cursor Bot changed the base branch from jkt/auto/hooks-g2-dry-run-tester-4399 to main July 18, 2026 14:55
Pin committed copies of the upstream hook-config JSON schemas under
schemas/vendor/ (Claude Code from SchemaStore; the community cursor-hooks
npm schema), with provenance + pins + re-vendoring steps in the vendor
README. Never remote-fetched at runtime or in CI — reads the committed
copies from disk only (.prettierignore keeps them byte-identical to
upstream).

Mirror each schema's published event list as TS constants in
src/shared/hooks/vendored-hook-schemas.ts with an explicit
intentionally-unsupported set per dialect. Extend the warn-level authoring
lint to the Claude adapter: a declared-but-unwired vendor event is skipped
WITH a warning (recognised-but-unsupported vs unknown/typo), surfaced via
listClaudeHooks (now HooksListResult) into hooks:list — never a load gate.

Add the CI drift detector (vendor-schema-drift.test.ts): offline, diffs
each vendored schema's published events against the adapter-wired events
and fails when intentionally-unsupported != published \ wired, so an
upstream release adding an unaccounted event forces a deliberate choice.

Mark G3 done in the plan; short pointer in docs/cursor-hooks.md.

Co-authored-by: Jonathan Kingston <jonathanKingston@users.noreply.github.com>
@jonathanKingston
jonathanKingston force-pushed the jkt/auto/hooks-g3-schema-drift-4399 branch from ce31329 to 66e6b10 Compare July 18, 2026 15:35
@jonathanKingston
jonathanKingston marked this pull request as ready for review July 18, 2026 15:35
@jonathanKingston
jonathanKingston enabled auto-merge (squash) July 18, 2026 15:35
@cursor

cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_38f10085-f5a2-428d-a34d-8a1a80565ee6)

@cursor
cursor Bot requested a review from AutomatedTester July 18, 2026 15:36

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Not approving: Cursor Bugbot completed as skipped (usage limit reached) and did not produce a clean review. Human review is needed before merge; requested AutomatedTester as reviewer.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor

cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_450a0685-13d1-482e-8f46-c4d14f94187d)

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approving: Cursor Bugbot completed as skipped and did not produce a clean review. Human review is still needed before merge; AutomatedTester is already requested as reviewer.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@jonathanKingston
jonathanKingston merged commit efc87e6 into main Jul 18, 2026
20 checks passed
@jonathanKingston
jonathanKingston deleted the jkt/auto/hooks-g3-schema-drift-4399 branch July 18, 2026 16:12
jonathanKingston added a commit that referenced this pull request Jul 18, 2026
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Summary

Implements **G4** from the hooks plan: snapshot every dialect wire
payload (decision 14) for publish-time stability audits.

**Stacked on #947 (G3) → #946 (G2) → … → #913 (A1).**

## Acceptance criteria (from plan G4 row)

- Decision 14: snapshot every dialect wire payload now

## Deliverables

- `payload-snapshots.test.ts` + `__snapshots__/wire-payloads.json`
- Cursor / Claude / Copse request shapes for every supported event (+
tool flavors)
- Regen: `UPDATE_HOOK_PAYLOAD_SNAPSHOTS=1 npm test`

## Tests

- `npm run check` green (2967 tests)

## Test plan

- [x] `npm run check`
- [ ] CI green

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-8caab6bd-d95d-439e-a65b-bd4c12d04399"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-8caab6bd-d95d-439e-a65b-bd4c12d04399"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Jonathan Kingston <jonathanKingston@users.noreply.github.com>
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.

2 participants