Make Relay runtime config-driven#184
Merged
Merged
Conversation
Merged
nahiyankhan
added a commit
that referenced
this pull request
Jun 24, 2026
Make Relay runtime config-driven
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.ghostpackage and made non-.ghostagent-framework contexts awkward.Solution: Make
ghost relay gatherload Relay config first, letbase.kindchoose 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 hookpnpm test: passed locally and in pre-push hook, 419 testspnpm check: passed locally, in pre-commit, and in pre-push hookpnpm dump:cli-help: ran and manifest is in syncChangeset: 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 findingsnode packages/ghost/dist/bin.js review --base origin/main: generated advisory packet successfully; packet noted the diff was truncated at its default byte budgetnode packages/ghost/dist/bin.js review --base origin/main --include-memory: not run in final form because this branch's CLI rejects--include-memoryFile 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: noneconfigs.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
.ghostpackage 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/v1JSON 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-fingerprintgap 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/v2JSON 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: nonerequest-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.