Skip to content

Make Relay runtime config-driven#184

Merged
nahiyankhan merged 3 commits into
mainfrom
codex/relay-context-packets
Jun 24, 2026
Merged

Make Relay runtime config-driven#184
nahiyankhan merged 3 commits into
mainfrom
codex/relay-context-packets

Conversation

@nahiyankhan

Copy link
Copy Markdown
Collaborator

Category: new-feature
User Impact: Agents can gather structured Relay context from either a Ghost fingerprint package or an explicit framework-owned Relay config.
Problem: Relay had grown from a simple path-based fingerprint helper into an agent contract, but the runtime still assumed a root .ghost package and made non-.ghost agent-framework contexts awkward.
Solution: Make ghost relay gather load Relay config first, let base.kind choose fingerprint-backed or request-only resolution, add structured Relay requests and request stack resolvers, and document JSON as the authoritative host-agent contract.

Validation:

  • pnpm build: passed locally and in pre-push hook
  • pnpm test: passed locally and in pre-push hook, 419 tests
  • pnpm check: passed locally, in pre-commit, and in pre-push hook
  • pnpm dump:cli-help: ran and manifest is in sync

Changeset: added as a minor change for new Relay config/request/context capabilities.

Ghost Review:

  • node packages/ghost/dist/bin.js check --base origin/main: passed, 0 findings
  • node packages/ghost/dist/bin.js review --base origin/main: generated advisory packet successfully; packet noted the diff was truncated at its default byte budget
  • node packages/ghost/dist/bin.js review --base origin/main --include-memory: not run in final form because this branch's CLI rejects --include-memory
File changes

.changeset/relay-context-packets.md
Adds release note copy for Relay context JSON, structured requests, and config-driven runtime selection.

apps/docs/src/content/docs/cli-reference.mdx
Updates Relay CLI docs to describe JSON as the agent contract, --request, --request-stdin, --config, GHOST_RELAY_CONFIG, and request-only config usage.

apps/docs/src/content/docs/getting-started.mdx
Adds getting-started guidance for Relay JSON, structured requests, and base.kind: none configs.

apps/docs/src/generated/cli-manifest.json
Regenerates CLI help metadata after Relay command/help changes.

docs/fingerprint-format.md
Clarifies how Relay config can add context outside the canonical .ghost package without changing the fingerprint package model.

docs/generation-loop.md
Updates generation setup around Relay JSON, prompt-shaped requests, and config-selected runtimes.

docs/host-adapters.md
Documents host responsibilities for Relay JSON, request creation, GHOST_RELAY_CONFIG, and request-only configs.

docs/relay-configs-and-context.md
Adds the main Relay config/context guide covering config precedence, base runtimes, request schemas, stack resolvers, sections, and JSON contract semantics.

packages/ghost/src/cli.ts
Moves Relay command registration to the dedicated Relay command module.

packages/ghost/src/context/default-relay-config.ts
Adds the built-in default Relay config with fingerprint base semantics.

packages/ghost/src/context/projection.ts
Adds bounded projection of declared Relay sources into projectable context sections.

packages/ghost/src/context/relay-config-loader.ts
Loads Relay config by precedence: --config, GHOST_RELAY_CONFIG, discovered .ghost/relay.yml, then default config.

packages/ghost/src/context/relay-config.ts
Defines Relay config schema/types, base.kind, request resolvers, stack unit sources, and validation rules.

packages/ghost/src/context/relay-context.ts
Builds ghost.relay-context/v1 JSON with sections, extras, config base, request metadata, gaps, and trace.

packages/ghost/src/context/relay-modes.ts
Defines Relay modes and internal capability selection for projections.

packages/ghost/src/context/relay-request-input.ts
Reads Relay request files/stdin and folds positional targets into requests when needed.

packages/ghost/src/context/relay-request.ts
Defines and validates ghost.relay-request/v1.

packages/ghost/src/context/request-resolution.ts
Resolves structured requests against declared stack resolvers and projects ordered unit sources.

packages/ghost/src/context/request-stack-document.ts
Discovers and validates block.stack/v1-style stack files for request resolution.

packages/ghost/src/context/selected-context.ts
Adds the no-base-fingerprint gap kind used by request-only Relay results.

packages/ghost/src/relay-command.ts
Adds the Relay CLI command implementation with JSON/markdown output, --config, --request, --request-stdin, and advanced mode handling.

packages/ghost/src/relay-runtime-helpers.ts
Contains runtime helper logic for request synthesis, request source shaping, sparse selected context, and projection merging.

packages/ghost/src/relay.ts
Wires Relay gather into config-first runtime selection, fingerprint-backed gathers, request-backed gathers, and request-only gathers while preserving the ghost.relay.gather/v2 JSON contract.

packages/ghost/src/skill-bundle/SKILL.md
Updates installed skill guidance for Relay config paths and the generalized Relay gather command.

packages/ghost/src/skill-bundle/references/brief.md
Updates agent brief recipe to consume Relay JSON and handle base.kind: none request-selected sections/extras.

packages/ghost/src/skill-bundle/references/review.md
Updates review recipe with Relay request/config guidance.

packages/ghost/src/skill-bundle/references/schema.md
Documents Relay configs as an extension to, or opt-out from, the default fingerprint base.

packages/ghost/src/skill-bundle/references/verify.md
Updates verification recipe for Relay config and request-only results.

packages/ghost/test/cli.test.ts
Adds CLI coverage for Relay JSON contract, request input, request-only configs, env config, target synthesis, validation failures, help text, and skill recipes.

packages/ghost/test/public-exports.test.ts
Verifies public Relay exports include config/context/request schemas and request parsing.

packages/ghost/test/relay.test.ts
Adds Relay API coverage for context JSON, config discovery, config override, source projection, request stack resolution, and request gaps.

Screenshots/Demos: N/A, no visual surface changed.

@nahiyankhan nahiyankhan marked this pull request as ready for review June 24, 2026 17:29
@nahiyankhan nahiyankhan merged commit 4c01233 into main Jun 24, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 24, 2026
nahiyankhan added a commit that referenced this pull request Jun 24, 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.

1 participant