Skip to content

Rename node retrieval frontmatter field to for - #262

Merged
nahiyankhan merged 5 commits into
mainfrom
rename-context-to-description
Aug 19, 2026
Merged

Rename node retrieval frontmatter field to for#262
nahiyankhan merged 5 commits into
mainfrom
rename-context-to-description

Conversation

@nahiyankhan

@nahiyankhan nahiyankhan commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Category: improvement
User Impact: Ghost package nodes declare their retrieval payload with a for: frontmatter field: the situation or activity the guidance is for. Near-miss keys (context, description) are rejected with a pointer to for.
Problem: #252 renamed the node retrieval field from description to context, but context reads as the mechanism (what ends up in the model's context) rather than the payload itself, and it collides with the everyday "context" vocabulary used throughout ghost's own prose. description was semantically loose in the other direction: the field's content never describes the node, it names when the node applies. The team converged on for.
Solution: A forward rename to for rather than a revert. Every value in the corpora already completes the sentence "this guidance is for ___" (for: Choosing or applying color., for: Any view containing text or actions.), so the field teaches itself from its own values. for is canonical across the schema, catalog, embed API, CLI output, lint rules, corpora, and docs. Authoring context: or description: fails validation with a pointer to the right key ("description is not a node key; use for"), mirroring the existing relates rejection pattern; without the explicit rejection, the passthrough schema would let an old key ride along silently and leave the node invisible to gather. Check frontmatter keeps its own description field: that is the established .agents/checks format, not the node schema. The skill prose adds the one guardrail for needs: it names a situation or activity, never an audience.

Validation:

  • pnpm build: pass
  • pnpm test: 211/211 pass (adds rejection tests for both near-miss keys)
  • pnpm check: pass (biome, typecheck, terminology, package checks)
  • Smoke tests: fresh ghost init (skeleton and vessel-light bodies) validates clean and emits for:; nodes authored with context: or description: fail validation with the pointer to for; all three in-repo corpora (apps/docs, vessel-light, vessel-react) validate with no new findings.

Changeset: added (minor) — public CLI/embed output shape and validation behavior change.

ghost Review:

  • ghost review: not run — no root .ghost/checks/ directory in this repo.
File changes

.changeset/rename-retrieval-field-to-for.md
New minor changeset describing the field and the rejection behavior.

packages/ghost/src/ghost-core/node/schema.ts, types.ts, serialize.ts
for is the canonical frontmatter field. context and description are rejected keys that point to for. Key order is for, materials.

packages/ghost/src/ghost-core/catalog/types.ts, menu.ts, assemble.ts, closest.ts
Catalog nodes and menu entries carry for.

packages/ghost/src/embed/types.ts, gather.ts, pull.ts
Embed API emits for; coverage field is withoutFor; gather selection instruction updated.

packages/ghost/src/commands/gather-command.ts, pull-command.ts
CLI markdown/JSON output uses for; coverage line says "N lack for payloads".

packages/ghost/src/review/baseline.ts, review-packet.ts
Review packet and baseline prose carry for.

packages/ghost/src/scan/fingerprint-package-lint.ts
Lint rule is node-for-missing.

packages/ghost/src/skill-bundle/ (SKILL.md, references/schema.md, nodes.md, making.md, ground.md, steering-audit.md)
Skill prose teaches for as the retrieval payload: the situation or activity the guidance is for, never an audience.

packages/ghost/src/init-payloads/ (median, skeleton)
Scaffolded nodes author for:. The median-tells check keeps its check-format description field.

packages/ghost/test/ (cli.test.ts, cli-exit.test.ts, embed.test.ts, fingerprint-package.test.ts, ghost-core/node-schema.test.ts)
Node fixtures author for:; rejection tests cover both near-miss keys. Check fixtures keep description (check format).

apps/docs/.ghost/ (9 nodes), packages/vessel-light/.ghost/ (18 nodes), packages/vessel-react/.ghost/ + fingerprint/ (25 nodes)
Mechanical frontmatter rename to for:.

apps/docs/src/components/docs/gather-demo.tsx, apps/docs/src/pages/index.astro
Demo menu data and landing-page examples use for.

packages/context-control/README.md, lib/model.mjs, ui/index.html
Bench consumes the renamed menu field; coverage line reads withoutFor.

README.md, CLAUDE.md, docs/purposes.md
Docs describe for as the retrieval payload.

Screenshots/Demos: N/A

nahiyankhan and others added 2 commits August 18, 2026 19:35
Co-authored-by: Goose <opensource@block.xyz>
Ai-assisted: true
Co-authored-by: Goose <opensource@block.xyz>
Ai-assisted: true
@nahiyankhan
nahiyankhan marked this pull request as ready for review August 19, 2026 00:01
The team converged on `for` over both `description` and `context`: it
reads as the situation or activity the guidance is for, and the corpus
values already complete that sentence naturally. Both prior names are
rejected at validation with rename messages. Coverage field is
`withoutFor`; lint rule is `node-for-missing`. Check frontmatter keeps
its own `description` field (established .agents/checks format).
@nahiyankhan nahiyankhan changed the title Rename node retrieval frontmatter field back to description Rename node retrieval frontmatter field to for Aug 19, 2026
The context and description rejections now point to `for` without
narrating field history.
Comment thread apps/docs/src/pages/index.astro Outdated
Co-authored-by: Chai Landau <112015853+chailandau@users.noreply.github.com>
@nahiyankhan
nahiyankhan merged commit 977e0a0 into main Aug 19, 2026
4 checks passed
@nahiyankhan
nahiyankhan deleted the rename-context-to-description branch August 19, 2026 15:50
@github-actions github-actions Bot mentioned this pull request Aug 19, 2026
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