Skip to content

RFC #289: land phase-1 host integration contract#364

Open
loocor wants to merge 11 commits intogarrytan:mainfrom
loocor:feat/host-integration-contract
Open

RFC #289: land phase-1 host integration contract#364
loocor wants to merge 11 commits intogarrytan:mainfrom
loocor:feat/host-integration-contract

Conversation

@loocor
Copy link

@loocor loocor commented Mar 23, 2026

Context

  • builds the phase-1 implementation checkpoint for RFC RFC: define a standard host integration contract for gstack #289 (RFC: define a standard host integration contract for gstack)
  • focuses on the install/runtime boundary first so future OpenCode or adjacent host work can build on a shared contract instead of more one-off branches
  • keeps the roadmap intentionally incremental: land the contract foundation now, normalize more host semantics next, then use a second host to validate the model

What This PR Lands

  • introduce scripts/host-registry.ts as the single source of truth for host layouts, discovery roots, runtime roots, path rewrites, and generated output locations
  • make ~/.gstack the canonical shared runtime home, with host-specific roots becoming thin discoverability layers and repo-local .gstack acting as the workspace sidecar/fallback
  • rewire setup, scripts/gen-skill-docs.ts, scripts/skill-check.ts, packaging, and regression tests to the shared contract
  • separate generated discoverability artifacts from runtime assets and regenerate the affected Claude/Codex/agents skill docs, including the new CODEX_PLAN_REVIEW placeholder support merged from upstream
  • fold in the install/runtime hardening that fell out of dogfooding this contract: workspace discovery cleanup, shared-vs-workspace resolution checks, upgrade-path tightening, and a small browse loopback fix for chunked responses

Why The Diff Is Large

  • most of the volume is generated SKILL.md output and contract-driven rewrites flowing from the registry / shared-runtime change
  • the behavioral core is concentrated in scripts/host-registry.ts, scripts/gen-skill-docs.ts, setup, scripts/skill-check.ts, browse/src/cli.ts, and the related tests

Roadmap Progress

  • Phase 1 — install/runtime contract: landed in this PR
  • Phase 2 — host-specific skill semantics: still next; interactive prompting, invocation primitives, and metadata/frontmatter policy should keep moving onto the same host contract instead of remaining template-level special cases
  • Phase 3 — second-host validation: intentionally deferred until the phase-2 surface is clearer; OpenCode remains the most useful candidate to prove the contract rather than arriving as a one-off exception

Intentionally Not In Scope

  • no full OpenCode adapter yet
  • no attempt to solve every host/runtime capability difference in one pass
  • no broad host expansion beyond the install/runtime contract needed to make future host work coherent

Test Plan

  • bun test test/gen-skill-docs.test.ts
  • bun run skill:check
  • git diff --check

Refs #289

🤖 Generated with Claude Code

loocor and others added 11 commits March 23, 2026 00:43
Make `~/.gstack` the canonical runtime home and keep host
directories as thin discoverability layers.

Unify host layout rules across generation, setup, packaging,
and health checks so install behavior can be validated and
published consistently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document the new `~/.gstack` canonical runtime model and
capture the current branch checkpoint plus scoped follow-up
work in the host integration RFC.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep the shared runtime canonical without breaking local dev flows.
Only trust the workspace browse binary when it validates against
shared runtime version metadata.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep the shared runtime canonical while preserving workspace
browse binaries for validated local development. Align the host
contract and regression tests with the workspace-validated policy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Make /gstack-upgrade match the ~/.gstack primary-runtime model.
Fix rollback messaging, refresh workspace sidecars explicitly,
and cover the new flow in E2E support code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Capture the post-checkpoint runtime model in the RFC and user-facing
upgrade docs so reviewers can see what shipped versus what was
deliberately deferred.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pulls the branch onto the latest upstream baseline before the next
host-adapter steps, so OpenCode and later hosts build on current main
behavior instead of a stale install/runtime surface.

Keeps the shared-runtime host contract intact while absorbing upstream
skills, repo-mode helpers, and coverage-audit prompt generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codex and Gemini still declared repo-root `.agents/skills`
workspace discovery even though setup materializes workspace
fallbacks under `.gstack`.

Align the host registry, generated setup guidance, upgrade copy,
and regression coverage so the install/runtime contract matches
the shared-runtime model before this tranche closes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep setup, generated skills, and validation aligned around the new
shared runtime layout. This avoids clean checkout failures and makes
Codex and Gemini discovery depend on an explicit install contract.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Handle chunked HTTP bodies in the raw loopback client so health checks
and command output are parsed correctly after the proxy-avoidance change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pull in upstream plan review placeholder updates while preserving the
shared runtime contract and generator behavior on this branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@loocor loocor changed the title feat(hosts): align shared runtime contract RFC #289: land phase-1 host integration contract Mar 23, 2026
@loocor
Copy link
Author

loocor commented Mar 23, 2026

Reviewer guide — if you want the shortest path through this PR, I’d focus on these in order:

  1. scripts/host-registry.ts

    • This is the contract proposal in code: host layouts, discovery roots, runtime roots, path rewrites, and generated output locations.
    • Main review question: does this surface capture the real host/runtime boundary cleanly enough for future hosts, or is anything important still missing?
  2. setup

    • This is where the contract becomes install semantics.
    • Main review question: is the ~/.gstack canonical runtime + thin host-root / workspace-sidecar model the right split?
  3. scripts/gen-skill-docs.ts + generated SKILL.md output

    • This shows whether template generation is now following the contract instead of ad hoc path rewrites.
    • Main review question: are discoverability artifacts and runtime assets now separated in the right way?
  4. scripts/skill-check.ts + test/gen-skill-docs.test.ts

    • These are the guardrails proving the contract is testable rather than just documented.
    • Main review question: do these tests/checks lock the important invariants, or are any contract edges still untested?
  5. browse/src/cli.ts

    • This is just a small opportunistic fix picked up while validating the runtime path: chunked loopback HTTP responses now decode correctly.
    • Safe to review separately from the main host/runtime design.

The biggest thing I’d love feedback on is whether this PR now makes the host/runtime boundary explicit enough that a second host can plug into it later without us falling back into more one-off install/discovery exceptions.

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