Skip to content

Ground checks in guidance and reshape ghost review into one packet - #263

Draft
nahiyankhan wants to merge 3 commits into
mainfrom
checks-v2-grounded-review
Draft

Ground checks in guidance and reshape ghost review into one packet#263
nahiyankhan wants to merge 3 commits into
mainfrom
checks-v2-grounded-review

Conversation

@nahiyankhan

@nahiyankhan nahiyankhan commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Category: improvement
User Impact: Review checks now must cite the guidance they enforce, and ghost review emits a single grounded packet the reviewing agent can act on without follow-up commands.
Problem: v1 checks were free-floating assertions: they carried their own name, description, source, tools, and turn_limit, could exist without citing any guidance node, and ghost review routed them through material-path matching that produced partial, multi-step packets with offered checks and gaps the agent had to chase.
Solution: Introduce check format ghost.check/v2. Checks now require for (the situation in which the check applies, matching the node retrieval field), severity, and resolving references into guidance nodes; unresolved references are validation errors, so check-first authoring is retired and every check is grounded in prose the author shipped. ghost review drops material-path routing entirely (resolve.ts deleted) and emits one packet: all checks or a requested subset (ghost review [...checkIds]), deduped cited guidance excerpts, cited-node materials via the pull transport (--no-materials for locator-only output), the untrusted diff fenced, and a traceability contract for findings. Review refuses packages that ghost validate would reject, and .agents/checks shape compatibility ends with a teaching migration error.

Validation:

  • pnpm build: pass
  • pnpm test: pass (18 files, 222 tests)
  • pnpm check: pass (biome, typecheck, terminology, file-size, package, release workflows, vessel-light closure)
  • ghost validate against packages/vessel-light/.ghost and packages/vessel-react/.ghost with the built CLI: 0 errors, 0 warnings

Changeset: added (.changeset/checks-v2-grounded-review.md, minor: breaking check format and /core type changes gated behind a minor pre-1.0 release)

ghost Review: not run; this branch changes the review machinery itself and the repo root carries no .ghost/ package to review against.

File changes

packages/ghost/src/ghost-core/check/types.ts, load.ts, lint.ts, index.ts
Define the ghost.check/v2 frontmatter: for, severity, and references required; legacy fields removed. Loading and linting enforce the new shape, emit a teaching migration error for v1/.agents/checks shapes, and treat unresolved references as validation errors.

packages/ghost/src/ghost-core/check/guidance-ref.ts (renamed from source-ref.ts)
Check references now point at guidance nodes, not sources; parseSourceRef becomes parseGuidanceRef with optional heading anchors.

packages/ghost/src/review/review-packet.ts
The one-shot packet: selected checks, deduped guidance excerpts cited by those checks, cited-node materials through the pull transport, fenced diff, and the findings traceability contract. Handles check-id filtering with unknown-id suggestions (exit 2 when none resolve) and --no-materials.

packages/ghost/src/review/resolve.ts (deleted)
Material-path routing removed; checks are no longer matched to touched files.

packages/ghost/src/review/guidance-excerpt.ts (renamed from baseline.ts)
Extracts the cited guidance prose (whole node or anchored heading section) for the packet.

packages/ghost/src/commands/review-command.ts
New CLI surface: positional check ids, --no-materials, exit codes, and refusal when the package or its checks would fail ghost validate.

packages/ghost/src/commands/command-discovery.ts
Command help/summary text updated for the new review shape.

packages/ghost/src/scan/check-files.ts, check-reference-lint.ts, check-scaffold.ts, file-kind.ts, fingerprint-package-lint.ts
Package-level validation resolves check references against the node corpus; scaffolded example checks emit the v2 shape.

packages/ghost/src/embed/snapshot.ts
Snapshot output tracks the new check fields.

packages/ghost/src/ghost-core/index.ts
Public /core exports follow the rename and the v2 frontmatter type (breaking for typed consumers, noted in the changeset).

packages/ghost/src/skill-bundle/SKILL.md, references/authoring.md, making.md, nodes.md, schema.md
Skill teaches v2 check authoring: cite guidance first, then assert; documents the new packet shape and reference syntax.

packages/ghost/src/init-payloads/median/median-tells.md
Starter check migrated to v2.

packages/vessel-light/.ghost/checks/.md, packages/vessel-react/.ghost/checks/.md, packages/vessel-react/.ghost/manifest.yml
Shipped example packages migrated to the v2 check format.

packages/ghost/test/cli.test.ts, ghost-core/check-md.test.ts, guidance-ref.test.ts, fingerprint-package.test.ts, embed.test.ts, public-exports.test.ts
Tests rewritten for the v2 shape, review filtering, exit codes, refusal behavior, and the renamed export.

CLAUDE.md, README.md, packages/ghost/README.md, apps/docs/src/pages/index.astro, docs/purposes.md
Docs describe checks as grounded assertions and the review command as a one-shot packet.

scripts/check-terminology.mjs
Retires vocabulary from the v1 check model.

.changeset/checks-v2-grounded-review.md
Minor changeset covering the breaking check format, review reshape, and /core type change.

Screenshots/Demos: N/A

must resolve during `ghost validate`; unresolved nodes and missing headings are
errors. Write the guidance node first, then the check in the same change.

The removed check keys are `name`, `description`, `source`, `tools`, and

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this need to be in here or can it stick in a changelog instead?

…cket

Check format ghost.check/v2: context, severity, and resolving references
are required; name, description, source, tools, and turn_limit are
retired; .agents/checks shape compatibility ends with a teaching
migration error. Unresolved check references are validation errors.

ghost review drops material-path routing (resolve.ts deleted) and emits
one grounded packet: all checks or a requested subset, deduped cited
guidance excerpts, cited-node materials via pull transport, fenced
untrusted diff, and a traceability findings contract. Review refuses
packages ghost validate would reject.
@nahiyankhan
nahiyankhan force-pushed the checks-v2-grounded-review branch from 72e598a to 65d6624 Compare August 19, 2026 17:00
Comment thread packages/ghost/src/embed/snapshot.ts Outdated
...(frontmatter.references
? { references: [...frontmatter.references] }
: {}),
context: frontmatter.context,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

😠

Checks and nodes now share one word for the same concept: for states
the situation in which the guidance or check applies. The check schema
rejects context with a teaching error, matching how the node schema
handled its own rename. Median-tells check payloads are rephrased as
situations rather than descriptions of what the check does.
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