Private
Public Access
0
0

conductor(track): nagent_review_v3 §1 Campaigns cluster

This commit is contained in:
2026-06-20 08:04:09 -04:00
parent f76d73e822
commit c81ea78273
@@ -17,7 +17,50 @@
## §1 Campaigns
(filled in by Phase 2 — covers `24cf16d`, `199a36b`, `f3ec090`, `c1d2cad`, `6443d70`, `7a7e242`)
**Source:** nagent `24cf16d`, `199a36b`, `f3ec090`, `c1d2cad`, `6443d70`, `7a7e242` (`bin/nagent-campaign`, `bin/helpers/nagent_campaign_lib.py`, `bin/helpers/nagent_distill_lib.py:228-260` + `:793-979`, `bin/nagent-distill:107-200`, `prompts/campaign-decompose.md`, `prompts/campaign-item.md`, `prompts/knowledge-merge.md`, `prompts/knowledge-graduate.md`, `prompts/create-readme.md:248-251`, `issues/0002-campaign-system.md`, `issues/0004-conversation-safety-net.md`, `tests/test_nagent_campaign.py`, `tests/test_nagent_distill.py`, `README.md:474-484` + `:900-908`)
**One-liner:** Plans become operable artifacts. The plan is data (YAML), the driver is deterministic code, the model's non-determinism is relocated and bounded to narrow judgments.
**Pattern(s) vs v2.3:** NEW. v2.3 had the implicit "what to do next is the model's judgment, re-made every turn" loop. v3 makes the plan a first-class artifact: an inspectable, editable, durable spine that survives the conversation that created it. EXTENDS v2.3 Pattern 1 ("durable work, disposable workers") — campaigns make "durable work" an explicit artifact instead of a process convention. EXTENDS v2.3 Pattern 3 ("conversations are editable state") — plans-as-artifact is a new editable dimension, parallel to conversations.
**Manual Slop implications:** The conductor's `plan.md` could evolve toward a campaign-style `index.yaml` + per-task `task.yaml` + per-task `conversation` artifact set. The MMA WorkerPool's tier-3 workers already follow the spirit (structured result, no direct tree mutation) but lack a documented worker contract + review gate. The "plan changes pass a review gate, not a cap" invariant maps cleanly to the existing HITL flow — Manual Slop's gate is the modal confirm; nagent's gate is the `proposal.yaml` file with `auto_confirm_max_items`/`auto_confirm_max_depth` thresholds.
**Decision candidate:** NEW Candidate 17 (HIGH). "Campaign-style plan-as-data for the conductor": add a `.conductor/campaigns/{slug}/` layout with `index.yaml` + per-task `task.yaml` + per-task conversation artifacts; add a deterministic driver (1 pass, then exit) that mirrors `nagent-campaign update`'s 6 phases. See `decisions.md` Candidate 17.
**Cross-refs:** none direct (the §2 Conversation safety net cluster cross-references this one; the §9 Case-study methodology cluster cross-references the "open questions as text files" pattern).
**Source-read citations:**
- `bin/nagent-campaign` — new CLI entry point (24cf16d)
- `bin/helpers/nagent_campaign_lib.py` — driver implementation (24cf16d)
- `issues/0002-campaign-system.md:1-326` — full spec: layout + invariants + driver phases + costs + done criteria (199a36b)
- `bin/helpers/nagent_distill_lib.py:228-260` — finished-campaign-as-harvest-source (f3ec090)
- `bin/helpers/nagent_distill_lib.py:793-979``run_merge` + `run_graduate` (f3ec090)
- `bin/nagent-distill:107-200``--merge` + `--graduate` CLI surface (f3ec090)
- `prompts/knowledge-graduate.md:1-26` — graduation LLM prompt (f3ec090)
- `prompts/knowledge-merge.md:1-19` — merge LLM prompt (f3ec090)
- `README.md:474-484` — merge + graduate teaching (c1d2cad)
- `README.md:900-908``nagent-campaign` CLI examples (24cf16d)
- `prompts/create-readme.md:248-251` — graduation reduction: "Proven playbooks stay prose that must be re-read and re-trusted every time. Therefore: graduate them into self-describing tools and prompts — knowledge becomes capability, gated by review." (c1d2cad)
- `issues/0001-retry-attempts-persist-raw-invalid-output.md` + `issues/0002-invalid-output-sidecars-are-never-collected.md` — two deferred follow-ups, filed as issue files (7a7e242)
- `issues/0004-conversation-safety-net.md` (reworked at 6443d70) — wall-clock checkpoints + burst guard; the safety net that decomposition cannot bound
**Honest gaps in this cluster:** The issue file at `issues/0003-distill-passes.md` was DELETED at `6443d70` because the distill-passes content shipped in `f3ec090`; the issue numbering for the deferred followups at `7a7e242` starts fresh at 0001/0002 — so the "issue files" pattern is self-pruning (closed issues get deleted when their work merges). The driver spec at `issues/0002-campaign-system.md:159-191` lists 6 driver phases (Merge → Check → Propose → Review gate → Dispatch → Report), but the implementation commit `24cf16d` adds `bin/nagent-campaign` + `bin/helpers/nagent_campaign_lib.py` (the actual driver); the prompt files for decomposition (`prompts/campaign-decompose.md`) and worker context (`prompts/campaign-item.md`) also land in `24cf16d`, but their LLM prompts are not deep-dived here. Per the user's §0 cluster-scheme honesty note, "the source-read pass may surface new clusters" — these prompts are candidates for a future v3.1 deep-dive.
**Pattern deep-dive.** The campaigns abstraction is a four-piece composition: **artifact**, **driver**, **invariants**, **context surfaces**. The artifact is the YAML tree (`.nagent/campaigns/{slug}/index.yaml` + per-item `item.yaml` + per-item `conversation`); the driver is `bin/nagent-campaign` doing one bounded pass and exiting; the invariants are the four load-bearing rules from `issues/0002-campaign-system.md:139-164` (one pass then exit; one writer for the tree; review gate not cap; schema is the whole schema); the context surfaces are the three places the campaigns pattern appears in initial context (every project conversation gets a Campaigns block; dispatched item workers get the worker contract; campaign-level conversations are ordinary conversations with the campaign as subject). This decomposition is itself data-oriented — the campaign's behavior is the artifact's shape, not code branching on state.
The merge/graduate passes (f3ec090) extend the same idea to the knowledge store: knowledge files grow append-only until unreadable, so `--merge` rewrites each category file with provenance preserved; proven playbooks stay prose when they should become tools, so `--graduate` drafts them as non-executable `{name}.draft` files invisible to tool discovery until the user reviews them. The "nothing lands silently" property is load-bearing — drafts are deliberately not executable, so a graduate pass cannot accidentally expose a half-formed tool to a future conversation.
A code-shape sketch using survey grammar (per the format commitment §5.1):
```
campaign := { name: string, status: active|paused|done,
completion: [condition], items: [item] }
item := { id: string, status: todo|proposed|in-progress|done|failed|question,
blocked_by: [id], conversation: path }
update {slug} {
merge // collect structured results, update statuses (pure code)
check // run executable test: conditions; bounded judge for judge:
propose // decompose big items -> proposal.yaml, status proposed
review_gate // auto-confirm within thresholds; report scope of pending
dispatch // bounded N unblocked items, each as --campaign-item worker
report // tree summary + questions + tokens spent
}
```
**Honest gap (continued):** the `{ssdl}` shape tag for the campaign tree is best described as `[M]` (mutable aggregate, hand-edited by humans) — the artifact is the state of record, the worker contract returns data, the driver is the only mutator. The lineage to v2.3's harvest pattern is direct: workers produce data (harvest-JSON in v2.3; `result.json` here), code merges into the tree (regenerate_digest in v2.3; driver merge phase here).
## §2 Conversation safety net