Repository navigation
Description
Parent
- epic(codex): context-compiled, conflict-safe subagent orchestration for campaign work #1631 — context-compiled, conflict-safe Codex subagent orchestration
Existing foundation
docs/agent-context/CONTEXT_SYSTEM.md already defines the missing architecture:
- typed nodes/edges over proposals, specs, ADRs, campaigns, work items, surfaces, modules, fixtures, output contracts, metrics, validation commands, receipts, handoffs, and learnings;
- proposed manifests under
.ripr/context/; - proposed generated
context-index.{json,md}andwork-item-packet.{json,md}; - proposed commands for validation, indexing, path routing, packet generation, and staleness checks;
- the explicit failure mode that agents currently read too much because links are implicit, or too little because they do not know a relevant contract exists.
Search of current main shows the doctrine exists, but the manifests and command implementation do not. A Codex root thread therefore has to parse long Markdown documents and reconstruct the graph in its own context before it can delegate anything.
Required outcome
Implement the doctrine as a deterministic, read-only repo context compiler. It must reuse the accepted source-of-truth control plane and active-goal authority rather than add a second planning hierarchy.
Machine-readable manifests
Add the proposed, verified manifests:
.ripr/context/surfaces.toml
.ripr/context/doc-types.toml
.ripr/context/validation.toml
.ripr/context/context-routes.toml
They should express only relationships not already owned elsewhere. Existing proposal/spec/ADR/goal/traceability/support-tier identities remain authoritative; manifests link them rather than restating their content.
At minimum, surfaces.toml must support:
surface id
owned/relevant code path globs
risk class
required and recommended document identities
fixture/golden/report families
minimum and full validation routes
semantic conflict resources
IDE/navigation labels
Commands
Implement repository-native commands equivalent to:
cargo xtask check-doc-context
cargo xtask context index
cargo xtask context query --surface <id>
cargo xtask context route --changed-path <path> [...]
cargo xtask context packet --work-item <id> [--role <role>] [--json]
cargo xtask context stale
Command names may follow the existing catalog, but the capabilities must remain distinct.
Snapshot identity
Every packet binds one reconciled input identity:
repository root identity
base and head commit SHA
working-tree state = clean | dirty with explicit changed paths
active goal content digest
selected work-item id and content digest
linked plan/spec/ADR/traceability identities
context-manifest schema/version and content digest
packet role and budget profile
Volatile generation time and absolute checkout spelling stay outside portable semantic identity.
Role-scoped packet views
Generate a common work-item packet plus bounded views for:
orchestrator
scout
adversary
builder
verifier
reviewer
The common packet carries the existing doctrine fields:
objective
current state
target state
acceptance criterion
production delta
evidence delta
non-goals
stop/ask-back conditions
dependencies and landing order
read-first documents
relevant code, fixtures, goldens, reports, and receipts
minimum proof commands and full gate
PR summary seed
Role views remove irrelevant material rather than merely append role instructions:
- scout: question, surface map, search/evidence targets, read-only boundary, result schema;
- adversary: claimed premise/result plus exact discrepancy questions, not the scout's raw notes;
- builder: accepted premise, edit cage, implementation/test surfaces, stop conditions, no broad history;
- verifier: claimed change, diff/commit identity, proof commands, expected artifacts, no author conclusion;
- reviewer: change and evidence contract, risks/invariants, residual assumptions.
Deterministic context budgets
Define versioned profiles with caps for:
inline bytes
document references
source/fixture paths
embedded snippets
validation commands
result rows
The packet is references-first. Large documents, logs, diffs, and reports are represented by stable entries containing:
artifact/path
line or JSON-pointer range when available
content digest
why relevant
retrieval command
When a budget is exceeded, emit:
complete = false
selected / omitted / total counts
omission reasons
stable overflow index and retrieval routes
Never silently truncate or summarize an omitted required contract as if it had been read.
Acceptance
- A work-item fixture spanning spec, code, tests, output contract, metric, and validation produces a schema-valid role-neutral packet and six role views.
- The orchestrator packet is materially smaller than concatenating all linked documents and reports; the fixture records both byte counts.
- Scout and verifier packets do not contain builder-only implementation prose or raw command logs.
- Builder packets include every required acceptance/non-goal/edit-cage fact and fail closed when a linked required contract is missing.
context route --changed-pathreturns deterministic surfaces and validation routes for Rust, VS Code, workflow, policy, LSP, fixture/golden, docs-only, and release-sensitive examples.- Reordering TOML entries, filesystem traversal, or graph input iteration does not change normalized packet identity.
- Equivalent checkouts at different absolute roots produce the same portable graph/packet identity.
- Dirty working-tree state is explicit and changes the session packet identity; it is never presented as a clean base.
- Missing links, duplicate identities, unsupported node/edge values, path escapes, stale active goals, and contradictory authority are fixture-backed failures.
- Generated Markdown is a human projection of the JSON DTO, not a second decision path.
- Command-catalog, doc-index, traceability, and source-of-truth checks cover the new surface.
Non-goals
- No task decomposition by a model.
- No provider/model invocation.
- No committed subagent task ledger.
- No source editing, worktree creation, claim acquisition, or command execution.
- No replacement for proposals, specs, active goals, traceability, support tiers, or PR bodies.
- No full-text repository index or vector database.
Likely seams
docs/agent-context/CONTEXT_SYSTEM.md.ripr/context/*.ripr/goals/active.tomlparser/reports- source-of-truth graph/report helpers
xtask/src/command.rs, dispatch, and a focused context module- schema/golden fixtures under a bounded context corpus
Relationships
- context: implement the typed repo graph and role-scoped work-item packet compiler #1632 consumes these packets for typed subtask contracts.
- orchestration: define versioned SubtaskPacket, SubtaskResult, and verification receipt contracts #1633 consumes surface conflict resources and packet identities for wave planning.
- orchestration: ingest bounded worker results and emit contradiction-aware root-thread synthesis #1636 adds Codex-specific role configuration over this agent-neutral compiler.
- spec(integration): ratify the standards boundary between LSP, MCP, shared services, and private compatibility #1599/projection(lsp): deliver bounded RIPR evidence through standard diagnostics, hover, code actions, and commands #1603 remain the analyzer-evidence protocol for IDE/headless clients; this issue may link their artifacts but does not modify LSP semantics.
Claim boundary
This issue makes relevant repository context bounded, typed, and reproducible. It does not prove the selected work is correct, choose a business priority, perform delegation, or verify a worker's claims.
Activity
EffortlessSteven commentedon Jul 14, 2026
Relationship correction for the body’s generated numbering:
The self-reference in the original Relationships section is a numbering typo; it is not a dependency cycle.
EffortlessSteven commentedon Jul 15, 2026
Issue update — 2026-07-14
Title: context: implement the typed repo graph and role-scoped work-item packet compile
Status
This issue is part of the Codex orchestration epic (#1631) — context-compiled, conflict-safe subagent orchestration. Based on codebase research:
Recommendations
EffortlessSteven commentedon Jul 15, 2026
Prerequisite: #1692 must land before this packet compiler becomes implementation-ready. Replace active-goal authority and active-goal content digest in packet identity with repository/current-main, portfolio snapshot, selected issue/work-item, accepted contract, and relevant campaign references. A campaign may remain context, but it must not silently select work.
EffortlessSteven commentedon Jul 15, 2026
Contract correction and prerequisite
Depends on #1697 → #1701 → #1704 for final authority and portfolio identity. Coordinate the shared DTO migration through #1706.
The packet snapshot must no longer include
active goal content digestas current-work authority. Use:A campaign reference is durable context only. A selected issue may have zero, one, or several relevant campaigns. Missing campaign placement does not block a qualified one-PR repair.
Legacy active-goal fields may be accepted only as explicit read-only compatibility references and must never authorize a builder, verification claim, support promotion, or completion.
Add fixtures for standalone selected issue, multi-campaign context, wrong repository/portfolio/issue identity, and fresh-session resume without
active.tomlauthority.EffortlessSteven commentedon Jul 17, 2026
Codebase Context & Plan Review
Reviewed: 2026-07-17
Current Implementation State
No implementations currently exist for .ripr/context/ manifests or xtask context commands. The repo currently tracks plans via �ctive.toml and markdown files, but no machine-readable compiler exists.
Relevant Files
Plan Review
The plan is highly coherent and clearly matches the goals set in the parent epic #1631. Adding typed machine-readable context scopes (Scout, Adversary, Builder, Verifier, Reviewer) and explicit byte limits/budgets will significantly prevent LLM context-overflow.
Blockers
None.
Readiness Assessment
ready-to-implement
Next Action
Implement the .ripr/context/ manifests and cargo xtask context subcommands.
EffortlessSteven commentedon Jul 18, 2026
Deep Research Follow-up
Reviewed: 2026-07-17
Current Implementation State
The codebase contains documentation outlining the orchestration principles (
docs/AGENT_OPERATING_MODEL.md,docs/CODEX_GOALS.md,docs/agent-context/CONTEXT_SYSTEM.md), but the typed repo graph and work-item packet compiler do not currently exist in code.ContextPacketexists incrates/ripr/src/domain/context_packet.rs, but it is tied to LSP analyzer evidence, not Codex orchestration.Relevant Files
docs/agent-context/CONTEXT_SYSTEM.md— architectural doctrine for the repo graph.xtask/src/main.rs— orchestrator CLI entry point, missingcheck-doc-context,context index, etc.crates/ripr/src/domain/context_packet.rs— existing LSPContextPacket, distinct from the planned work-item packets.Plan Review
The plan is highly coherent. It distinguishes between the existing analyzer-evidence protocol (
ContextPacketfor LSP) and the net-new orchestration packets (role-scoped views, deterministic context budgets). The proposal safely reuses existing source-of-truth mechanisms (specs, active goals) rather than creating a parallel task hierarchy.Blockers
No immediate codebase blockers. This is greenfield implementation within
xtask(or a dedicated context crate).Readiness Assessment
ready-to-implement
Next Action
Begin implementing the TOML manifest schemas for
.ripr/context/and the basecargo xtask contextcommands.EffortlessSteven commentedon Jul 18, 2026
Status review (2026-07-17)
Current status:
not-started (design/spec only), blocked on #1692. Per AGENTS.md:582-587, this is explicitly not an assumed command surface — the commands it names do not exist.Evidence nothing landed
.ripr/context/directory does not exist. None of the proposed manifests (surfaces.toml,doc-types.toml,validation.toml,context-routes.toml) exist.contextsubcommand inxtask/src/command.rs(grepforcheck-doc-context,context index|query|route|packet|stale→ nothing).docs/agent-context/CONTEXT_SYSTEM.mdisstatus: proposed.ContextPacketstruct atcrates/ripr/src/domain/context_packet.rsis the LSP analyzer evidence packet (probe/reach/infect/discriminate) — a different domain type, explicitly not this issue's work-item packet.The #1631/#1692 supersession applies directly
Per the authority-correction on the parent, #1632 packets must bind
PortfolioBasis + SelectedWorkIdentity, not anactive-goaldigest. So this issue's stated snapshot-identity section needs rewrite before implementation.Recommended next step
Produce the manifest schemas + a
STATUS: proposed→acceptedspec/ADR first; resolve #1692 portfolio identity; then implement the read-only compiler as the first slice. The read-only, deterministic packet compiler is a sensible first artifact once identity is stable. Do not reuse the LSPContextPackettype — different domain.docs(spec): add RIPR-SPEC-0130 RIPR authority map + legacy conformanc…
docs(spec): add RIPR-SPEC-0130 RIPR authority map + legacy conformanc…
EffortlessSteven commentedon Aug 2, 2026
Earnest review (2026-08-02)
Context: typed repo graph + role-scoped work-item packet compiler. Slice #1786 (read-only repo-context packet compiler, PortfolioBasis-bound) is the execution.
Action: keep open; track via #1786. PortfolioBasis is not yet in src, so this is foundational.
EffortlessSteven commentedon Aug 3, 2026
Deep re-review (2026-08-02)
STATUS: stale
EVIDENCE:
status/blocked-upstream. (Context: implement typed repo graph + role-scoped work-item packet compiler.)grep -rniE 'repo.graph|work.item.packet|packet.compiler|role.scoped.packet' crates/ xtask/-> 0 hits; no packet compiler. #1731 owns the .ripr/context/*.toml manifest schemas this reads — and those manifests don't exist (ls .ripr/context/-> absent). 'Role-scoped packets' implies the role roster forbidden by AGENTS.md:576-579. Blocked upstream + doctrine-constrained.PLAN QUALITY: needs-update
ACTION: update (depends on re-baselined #1631 + #1731 manifests; the role-scoped framing needs to drop per AGENTS.md:576-579)
feat(orch): context packets migrate to selected-work basis (#1706)
feat(orch): migrate orchestration consumers to selected-work portfoli…