Skip to content

fix(diagnostics): move event preflight codes off AB4840–AB4841 (#618 follow-up) - #625

Closed
ScriptedAlchemy wants to merge 3 commits into
mainfrom
cursor/diagnostics-ab4850-realloc-3fc7
Closed

fix(diagnostics): move event preflight codes off AB4840–AB4841 (#618 follow-up)#625
ScriptedAlchemy wants to merge 3 commits into
mainfrom
cursor/diagnostics-ab4850-realloc-3fc7

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

PR #618 (event preflight gates) was squash-merged to main carrying diagnostic codes AB4840 (event-preflight export defects) and AB4841 (required-provider declaration defects). Those codes collide with the still-open PR #616, whose CLI surface projections own the AB4840AB4842 range.

This follow-up reallocates the event codes so the ranges stay disjoint:

  • Event-preflight export diagnostic: AB4840AB4850
  • Required-provider declaration diagnostic: AB4841AB4851

Renamed everywhere: src/routes/contract.ts, src/routes/graph.ts, tests/route-graph.test.ts, docs/diagnostics.md, website/docs/{en,zh}/guide/authoring/hooks.mdx, and the pending .changeset/595-event-preflight-gates.md (still unreleased on main, so the release notes will only ever name the new codes). A new patch changeset (.changeset/625-event-preflight-code-realloc.md) documents the renumber for anyone who saw the merged codes on main.

Verified before renaming: AB4850/AB4851 are unused on main and on the #616 branch; #616's branch (feat/596-cli-surface-projection) uses AB4840AB4842, which this PR frees up.

Also hardens the brittle wrapper assertion in tests/claude-hook-event-name.test.ts: the exact-string match on validateNativeEventEnvelope(nativeInput, …) pinned the name of the temporary variable holding the parsed stdin value; it is now a narrow regex that allows any identifier as the first argument while still requiring the baked { canonicalEvent, nativeEvent, target } constants.

Do not merge — awaiting coordination with #616.

Refs #618 #616.

Verification

  • pnpm build && pnpm typecheck && pnpm lint && pnpm test:unit — green on Node 22.19.0.
  • pnpm docs:site:build — green (0 broken links / 27377 anchors, en/zh parity intact).
  • git grep 'AB4840\|AB4841' on this branch (excluding repos/) — no leftovers outside the new changeset's intentional history note.

Deslop

Deslop: Claude Fable 5, 0 edits — the diff is pure code renames plus one regex assertion with an intent-explaining comment.

Self-review

Reviewer: gpt-5.6-sol-high (generalPurpose subagent). Findings: none — no merge risks. Confirmed old codes remain only as intentional history in the new changeset, AB4850/AB4851 were unused on origin/main, the regex matches the generated wrapper calls (nativeInput and parsed variants), no generated/derived references were missed, and changeset status passes.

Open in Web Open in Cursor 

ScriptedAlchemy and others added 2 commits September 5, 2026 10:01
AB4840-AB4842 are owned by the CLI surface projections of #596 (PR #616);
this branch's event-preflight export diagnostic moves to AB4850 and the
required-provider declaration diagnostic to AB4851 so the ranges stay
disjoint. Both codes are unused on main and on the #616 branch.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
The wrapper assertion pinned the exact generated line including the
temporary variable holding the parsed stdin value; it now matches any
identifier while still requiring validateNativeEventEnvelope to receive
the baked { canonicalEvent, nativeEvent, target } constants.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d339855

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Sep 5, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@625
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@625
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@625
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@625

commit: d339855

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Superseded: #616 renumbered its projection diagnostics to AB4843–AB4845 (see its 10:55 update), so #618's AB4840/AB4841 no longer collide and no reallocation is needed. The claude-hook-event-name.test.ts assertion hardening in this PR is worth keeping — bring it as its own tiny PR if the exact-string match bites again.

@ScriptedAlchemy
ScriptedAlchemy deleted the cursor/diagnostics-ab4850-realloc-3fc7 branch September 5, 2026 16:15
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.

1 participant