G3: vendored hook schemas + CI drift detector - #947
Conversation
E2E screenshot updatesMerge conflict needs a human (27)Screenshot conflicts with
These PNGs live under |
Merge conflict needs a human
|
0d4cbf1 to
57ea5b7
Compare
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>
ce31329 to
66e6b10
Compare
Bugbot couldn't run - usage limit reachedBugbot 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) |
Bugbot couldn't run - usage limit reachedBugbot 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_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> <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> </div> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Jonathan Kingston <jonathanKingston@users.noreply.github.com>


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)
Deliverables
schemas/vendor/with provenance READMEvendor-schema-drift.test.tsTests
npm run checkgreen (2965 tests)Test plan
npm run check