Skip to content

docs: one owner per question, and a contract that lives with its code - #1026

Merged
hachej merged 1 commit into
mainfrom
docs/planning-cleanup
Jul 31, 2026
Merged

docs: one owner per question, and a contract that lives with its code#1026
hachej merged 1 commit into
mainfrom
docs/planning-cleanup

Conversation

@hachej

@hachej hachej commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Documentation and planning cleanup, from the three-way audit of the vision/decision/sequencing/contract/dispatch layers. Docs only — no code.

The audit's finding: the code is in good shape (§10's acceptance criteria are genuinely met, verified against real tests), but the layer that tells an agent what to do next is not. This fixes that layer.

The rule this establishes

Five kinds of planning document, one owner per kind — why (#391), what-was-ruled (DECISIONS.md), when (DIRECTION.md), how-it-works (package docs/), what-now (beads/issues). A document that answers two of those questions goes stale in one of them without anyone noticing. That is exactly what happened to the gateway contract.

Changes

The contract moves to live with its code. docs/issues/909/plan.md §6 was declared frozen and binding, and had drifted from the shipped types within one release — because it sat in an issue folder nobody updates after the issue closes. It is now packages/agent/docs/AGENT_GATEWAY_V0.md, beside shared/gateway/types.ts, corrected to what actually shipped:

§6 froze Shipped
CreateAgentSessionInput extends AuthorizedAgentScope (+5 more) nested readonly scope on all six inputs
listAgents(input: AuthorizedAgentScope) listAgents(input: ListAgentsInput)
state: PiChatSnapshot state: JsonSafe<PiChatSnapshot>
one JsonSafe<T> a materially different type, same name

The 7 methods, 13 error codes and every output DTO match §6 exactly — the drift is contained to inputs. But code written from §6's text does not typecheck, which is a real cost to whoever opens Wave 2.

Decision 29 (PROPOSED, for your ratification). The log ended at 28, so the newest ratified decision described a topology that is still unbuilt while the architecture everything depends on was authorized only by an issue folder. D29 records AgentGateway v0 and settles the AgentHost naming collision: createAgentHost() is a deployment-static composition helper returning a gateway and a close()not the controller/CAS/registry machinery D25–D28 rejected. Verified: AgentHostProtocol appears in zero source files.

Supersession written where the old text lives. Decision 26 still read Status: Accepted; it now reads SUPERSEDED with a note on what survives (workspaceTypeId as compatibility metadata). 909/plan.md is bannered as a historical record. 391/plan.md keeps F-graph authority but is bannered as subordinate to DIRECTION on sequencing — it currently names a public agent selector as a failure condition, which Wave 1 shipped by owner ruling.

The host tiers keep their home. The owner-ratified managed/dedicated/pushed topology is marked FUTURE WAVE owned by #905 rather than deleted — it is real intent, it just was not shipped architecture sitting in a "what shipped" document.

Review focus

Decision 29 is the part that needs your judgment, particularly the AgentHost rationale. Everything else is recording what is already true.

Refs #909, #391, #905

An audit of the planning layers found the code healthy and the coordination
layer not: a frozen contract that had drifted from its own types, a decision
log that did not contain the shipped architecture, and two documents each
claiming top authority.

- Promote the AgentGateway v0 contract out of docs/issues/909/ into
  packages/agent/docs/AGENT_GATEWAY_V0.md, beside the types it describes, and
  correct it to the shipped shape (input DTOs nest scope rather than
  inheriting it; listAgents takes ListAgentsInput; JsonSafe and the snapshot
  state type differ from the frozen text). Code written from the old §6 does
  not typecheck.
- Add Decision 29 (PROPOSED) recording AgentGateway v0, and settle the
  AgentHost naming collision: createAgentHost is a deployment-static
  composition helper, not the publication machinery D25-D28 rejected.
- Mark Decision 26 SUPERSEDED where it lives, rather than only in DIRECTION.
- Banner 909/plan.md as a historical record and 391/plan.md as subordinate to
  DIRECTION on sequencing; mark the three-tier host topology as future work
  owned by #905, not shipped architecture.
- Document the five planning layers and one-owner-per-question rule in
  docs/README.md so the next reader routes correctly.

Docs only.
@hachej
hachej merged commit ad4635d into main Jul 31, 2026
21 checks passed
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