Make Ward agent bootstrap harness-pure #1569

Closed
opened 2026-07-27 03:10:35 +00:00 by coilyco-ops · 2 comments
Member

Outcome

Make Ward agent bootstrap harness-pure. Ward keeps one canonical composed doctrine internally, then projects only the selected harness's native instruction load point, configuration, credentials, and state paths.

A Codex launch must not create Claude state, read a sibling CLAUDE.md, or attempt ownership changes for Claude paths. The same isolation applies symmetrically to every supported harness.

Required behavior

  • Claude receives only its native instruction, settings, and state paths.
  • Codex receives only .codex/AGENTS.md, Codex authentication, and Codex configuration.
  • Goose receives only its documented native instruction and configuration paths.
  • OpenCode receives only .config/opencode/AGENTS.md and its own configuration.
  • Context source selection follows the selected harness. The presence of another harness's instruction file does not make it an input.
  • A supplied provider-neutral selected-role bundle remains authoritative and does not acquire the host all-role roster.
  • Permission composition runs only for the selected harness.
  • Ownership changes are derived from selected adapter outputs and paths that actually exist.
  • Bootstrap emits no expected missing-file errors.

Acceptance criteria

  • Table-driven fixtures cover every supported harness and assert both expected paths and the absence of foreign-harness paths.
  • A fixture containing both CLAUDE.md and AGENTS.md proves that Codex consumes only the Codex-compatible source.
  • Codex creates no .claude/settings.json and does not attempt to change ownership of .claude.json.
  • Claude continues to receive its canonical runtime doctrine and supported settings.
  • Goose and OpenCode receive their documented native instruction load points.
  • Selected-role context-bundle tests prove that the supplied bundle remains authoritative.
  • Documentation names the per-harness projection contract. This bugfix does not require a docs/FEATURES.md change.

Headless execution boundary

Use synthetic homes and repository fixtures only. Do not launch live provider sessions or read real harness credentials for acceptance.

Repository boundary

This issue stops at Ward. If Ward's corrected projection reveals that agent-compose still injects foreign-harness roster text, file a separate issue in the owning repository with the observed fixture evidence. Do not expand or block this Ward issue on that follow-up.

## Outcome Make Ward agent bootstrap harness-pure. Ward keeps one canonical composed doctrine internally, then projects only the selected harness's native instruction load point, configuration, credentials, and state paths. A Codex launch must not create Claude state, read a sibling `CLAUDE.md`, or attempt ownership changes for Claude paths. The same isolation applies symmetrically to every supported harness. ## Required behavior * Claude receives only its native instruction, settings, and state paths. * Codex receives only `.codex/AGENTS.md`, Codex authentication, and Codex configuration. * Goose receives only its documented native instruction and configuration paths. * OpenCode receives only `.config/opencode/AGENTS.md` and its own configuration. * Context source selection follows the selected harness. The presence of another harness's instruction file does not make it an input. * A supplied provider-neutral selected-role bundle remains authoritative and does not acquire the host all-role roster. * Permission composition runs only for the selected harness. * Ownership changes are derived from selected adapter outputs and paths that actually exist. * Bootstrap emits no expected missing-file errors. ## Acceptance criteria * Table-driven fixtures cover every supported harness and assert both expected paths and the absence of foreign-harness paths. * A fixture containing both `CLAUDE.md` and `AGENTS.md` proves that Codex consumes only the Codex-compatible source. * Codex creates no `.claude/settings.json` and does not attempt to change ownership of `.claude.json`. * Claude continues to receive its canonical runtime doctrine and supported settings. * Goose and OpenCode receive their documented native instruction load points. * Selected-role context-bundle tests prove that the supplied bundle remains authoritative. * Documentation names the per-harness projection contract. This bugfix does not require a docs/FEATURES.md change. ## Headless execution boundary Use synthetic homes and repository fixtures only. Do not launch live provider sessions or read real harness credentials for acceptance. ## Repository boundary This issue stops at Ward. If Ward's corrected projection reveals that agent-compose still injects foreign-harness roster text, file a separate issue in the owning repository with the observed fixture evidence. Do not expand or block this Ward issue on that follow-up.
Author
Member

Kai resolved the harness-purity and agent-compose boundary on 2026-08-05.

Authoritative implementation contract

  • Ward keeps no shared ~/AGENTS.md runtime artifact. It composes content in memory and writes only the selected harness native instruction load point.
  • Each adapter declares its accepted instruction source names, native destination, skills roots, configuration paths, credential paths, permission composer, onboarding files, state paths, and ownership paths. Core bootstrap invokes only the selected adapter declarations and capabilities.
  • Claude reads only its Claude-compatible source. Codex reads only AGENTS.md. Goose and OpenCode use their documented native sources. The presence of a sibling harness file never affects selection.
  • A missing optional selected source yields Ward base doctrine plus a clear selected-source diagnostic. It never falls back to another harness source. An unknown or incomplete adapter projection fails before harness launch.
  • Normal launch composition is Ward base doctrine plus the selected compatible source. Ward builds the final bytes in memory and atomically replaces its own container-private native instruction file. It never appends on disk.
  • When a validated context bundle is supplied, the bundle instruction is authoritative. Ward appends only its minimal authority and safety appendix in memory, then atomically writes the final selected-harness instruction file. It does not also merge /opt/ward-context, a host all-role roster, or another harness load point.
  • A preexisting path recognized as Ward previous projection may be replaced. An unrecognized foreign file at the native destination fails closed rather than being overwritten or appended.
  • Agent-compose owns role, seat, personality, identity, and composed-skill content. AOS asks agent-compose to materialize the selected role into an empty home, validates it, removes bookkeeping, writes the immutable ward.context-bundle.v1 manifest, and passes that read-only bundle to Ward.
  • Running agent-compose or acompose directly may update host load points such as ~/.claude/CLAUDE.md and ~/.codex/AGENTS.md. Ward never reads, edits, or replaces those host artifacts as part of bundle projection.
  • A role slug and composed content grant no permissions. Ward continues to own credentials, permissions, mounts, network, workflows, broker capabilities, lifecycle, and teardown.
  • Remove the universal permission-composition call. Permissions, configuration, credentials, onboarding, hooks, and state composition run only when the selected adapter owns them.
  • Remove foreign credential variables from the dropped child environment. Ownership changes include the workspace plus existing selected-adapter paths only. Ward neither creates, removes, nor changes ownership of foreign-harness state.
  • Table-driven tests cover the complete positive and negative filesystem, source, environment, credential, permission, bundle, and ownership surfaces for every harness. The fixture containing both CLAUDE.md and AGENTS.md must prove symmetric isolation.

#1646 separately removes the Claude-specific post-run tool-failure subsystem. If these Ward fixtures prove AOS or agent-compose emits foreign harness content, file the observed evidence in that owning repository without blocking this issue.

Kai resolved the harness-purity and agent-compose boundary on 2026-08-05. ## Authoritative implementation contract * Ward keeps no shared `~/AGENTS.md` runtime artifact. It composes content in memory and writes only the selected harness native instruction load point. * Each adapter declares its accepted instruction source names, native destination, skills roots, configuration paths, credential paths, permission composer, onboarding files, state paths, and ownership paths. Core bootstrap invokes only the selected adapter declarations and capabilities. * Claude reads only its Claude-compatible source. Codex reads only `AGENTS.md`. Goose and OpenCode use their documented native sources. The presence of a sibling harness file never affects selection. * A missing optional selected source yields Ward base doctrine plus a clear selected-source diagnostic. It never falls back to another harness source. An unknown or incomplete adapter projection fails before harness launch. * Normal launch composition is Ward base doctrine plus the selected compatible source. Ward builds the final bytes in memory and atomically replaces its own container-private native instruction file. It never appends on disk. * When a validated context bundle is supplied, the bundle instruction is authoritative. Ward appends only its minimal authority and safety appendix in memory, then atomically writes the final selected-harness instruction file. It does not also merge `/opt/ward-context`, a host all-role roster, or another harness load point. * A preexisting path recognized as Ward previous projection may be replaced. An unrecognized foreign file at the native destination fails closed rather than being overwritten or appended. * Agent-compose owns role, seat, personality, identity, and composed-skill content. AOS asks agent-compose to materialize the selected role into an empty home, validates it, removes bookkeeping, writes the immutable `ward.context-bundle.v1` manifest, and passes that read-only bundle to Ward. * Running `agent-compose` or `acompose` directly may update host load points such as `~/.claude/CLAUDE.md` and `~/.codex/AGENTS.md`. Ward never reads, edits, or replaces those host artifacts as part of bundle projection. * A role slug and composed content grant no permissions. Ward continues to own credentials, permissions, mounts, network, workflows, broker capabilities, lifecycle, and teardown. * Remove the universal permission-composition call. Permissions, configuration, credentials, onboarding, hooks, and state composition run only when the selected adapter owns them. * Remove foreign credential variables from the dropped child environment. Ownership changes include the workspace plus existing selected-adapter paths only. Ward neither creates, removes, nor changes ownership of foreign-harness state. * Table-driven tests cover the complete positive and negative filesystem, source, environment, credential, permission, bundle, and ownership surfaces for every harness. The fixture containing both `CLAUDE.md` and `AGENTS.md` must prove symmetric isolation. #1646 separately removes the Claude-specific post-run tool-failure subsystem. If these Ward fixtures prove AOS or agent-compose emits foreign harness content, file the observed evidence in that owning repository without blocking this issue.
Author
Member

Landed on canonical main in 68c4d561726b359b65c96175c015f8021598ea84.

  • Each typed harness adapter now declares its complete instruction, skills, config, credential, permission, onboarding, state, and ownership projection.
  • Bootstrap writes one atomic regular instruction file at the selected native load point. It creates no shared ~/AGENTS.md and never falls back to a sibling source.
  • Context bundles remain authoritative and exclude /opt/ward-context, host roster identity, and sibling harness load points.
  • Permission composition is Claude-only. Bootstrap scrubs all known harness credential channels before the dropped child launch.
  • Ownership is limited to the workspace plus existing paths declared by the selected adapter.
  • Synthetic table fixtures cover all four harnesses across source, filesystem, config, credential, environment, permission, bundle, and ownership surfaces.

Validation: full ward exec test, Windows test compile, lint, vet, build, focused policy and release contracts, full pre-commit suite, ward doctor, and git diff --check all passed.

WARD-OUTCOME: done

Landed on canonical `main` in `68c4d561726b359b65c96175c015f8021598ea84`. * Each typed harness adapter now declares its complete instruction, skills, config, credential, permission, onboarding, state, and ownership projection. * Bootstrap writes one atomic regular instruction file at the selected native load point. It creates no shared `~/AGENTS.md` and never falls back to a sibling source. * Context bundles remain authoritative and exclude `/opt/ward-context`, host roster identity, and sibling harness load points. * Permission composition is Claude-only. Bootstrap scrubs all known harness credential channels before the dropped child launch. * Ownership is limited to the workspace plus existing paths declared by the selected adapter. * Synthetic table fixtures cover all four harnesses across source, filesystem, config, credential, environment, permission, bundle, and ownership surfaces. Validation: full `ward exec test`, Windows test compile, lint, vet, build, focused policy and release contracts, full pre-commit suite, `ward doctor`, and `git diff --check` all passed. WARD-OUTCOME: done
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/ward#1569
No description provided.