Skip to content

Commit 4eb9ae7

Browse files
authored
Merge pull request #26 from wcqxgjy6d8-pixel/codex/valp-full-repair-20260725
Harden first-install flow and runtime control
2 parents 50a7217 + efbccb4 commit 4eb9ae7

127 files changed

Lines changed: 10086 additions & 1338 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Machine-readable protocol evidence is byte-bound by recorded SHA-256 digests.
2+
*.json text eol=lf
3+
*.jsonl text eol=lf

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Unreleased
44

5+
- Redesigns Doctor and routing authority: Doctor commissions per-surface/session
6+
capability passports, the user selects the Leader, the Leader declares task
7+
assignments, and VALP validates without choosing or replacing Agents.
8+
- Changes `valp publish` to task creation only and requires
9+
`valp route --assignments <declaration>` before routing/dispatch artifacts are
10+
generated.
511
- Adds a public Pages explainer, `docs/when-agent-done-is-not-done.md`, for the
612
shortest PASS -> FAIL -> PASS audit demo.
713
- Adds a terminal-style hero demo asset to show PASS -> FAIL -> PASS before a
@@ -56,6 +62,9 @@
5662

5763
## 0.2.0-draft
5864

65+
The entries in this section describe the historical pre-Leader-declaration
66+
behavior and are retained as release history, not as current routing authority.
67+
5968
- Adds local coordinator commands: `valp publish`, `valp scan`, `valp route`,
6069
and `valp dispatch`.
6170
- `valp publish` now creates a task, scans local capability/overlay files, routes

INSTALL.md

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ multi-agent tasks.
1818
For working on this repository's reference CLI locally:
1919

2020
```bash
21+
python -m pip install --upgrade pip setuptools
2122
python -m pip install -e ".[dev]"
2223
valp audit examples/minimal-task
2324
scripts/verify-examples.sh
2425
```
2526

2627
This installs the `valp` console script from the local checkout and the
27-
development dependency used by the repository smoke check. It does not install
28-
or replace a runtime adapter.
28+
development dependency used by the repository smoke check. The VALP package
29+
includes its HERDR bridge, so clean installs do not need a separate
30+
`herdr-loop` command. HERDR itself remains an external reference runtime and is
31+
not installed or replaced by VALP.
2932

3033
## First Run Health Gate
3134

@@ -37,21 +40,38 @@ Recommended first-run order:
3740

3841
```text
3942
1. Resolve the actual VALP install root and `valp` executable path.
40-
2. Run `valp doctor --workspace <install-root>`.
41-
3. If the user wants Full Mode, run `valp preflight --runtime <runtime>`.
42-
4. Run a publish/dispatch dry run to prove routing and visible dispatch output.
43-
5. Show the report to the user before enabling real `--submit`.
44-
6. Enable Auto Visible Mode, watcher mode, or policy_auto only after opt-in.
43+
2. Run `valp doctor --workspace <install-root> --json` to commission
44+
capability passports for every discovered Agent surface/session.
45+
3. Show the passports, including observed model/provider/session, Skills, MCP,
46+
permissions, context, and limitations, and let the user choose the Leader.
47+
4. If the user wants Full Mode, run `valp preflight --runtime <runtime>`.
48+
5. Publish a dry-run task; let the Leader author the assignment declaration.
49+
6. Run `valp route --assignments`, then print dispatch output without submit.
50+
7. Show the validation and dry-run result before enabling real `--submit`.
51+
8. Enable Auto Visible Mode, watcher mode, or policy_auto only after opt-in.
4552
```
4653

4754
An installer or App must not hard-code a Desktop checkout path. It should store
4855
the actual install root it created and verify that `valp doctor` can find the
4956
protocol checkout, Python runtime, examples, schemas, and reference adapters.
5057

51-
A dry run may create a task folder and print submit commands. It must not
52-
actually send work to agents and must not be reported as a completed task.
53-
Newly published dry-run tasks normally fail `valp audit` because expected
54-
evidence and final synthesis do not exist yet.
58+
A dry run may create a task folder. It prints submit commands only after a
59+
user-selected Leader declaration passes validation. It must not actually send
60+
work to Agents and must not be reported as a completed task. Newly published
61+
dry-run tasks normally fail `valp audit` because receipts, expected evidence,
62+
and final synthesis do not exist yet.
63+
64+
Doctor does not choose the Leader or task Agents. Missing evidence stays
65+
`unknown`; installers must not infer a model from the Agent product name. The
66+
Leader declares task roles, and VALP may validate or block that declaration but
67+
cannot replace an Agent.
68+
69+
For HERDR, preflight probes command help rather than assuming capabilities from
70+
a version number. It accepts atomic `herdr agent prompt` when advertised, or the
71+
complete compatibility path consisting of `herdr pane send-text`, `herdr pane
72+
send-keys`, and `herdr agent wait`. An installed HERDR that exposes neither path
73+
is a failed Full Mode preflight with an actionable error; use Manual Mode until
74+
the runtime is updated or a compatible adapter is selected.
5575

5676
For the fastest stable setup:
5777

@@ -237,7 +257,7 @@ store evidence manually
237257
Manual Mode is not Full Mode. It cannot claim automatic dispatch submission,
238258
agent status proof, or runtime receipt equivalence.
239259

240-
Use Manual Mode for learning, documentation, PR review, or temporary audit
260+
Use Manual Mode for learning, documentation, external review, or temporary audit
241261
trails. Do not present it as the normal automated multi-agent experience.
242262

243263
## Quick Decision Tree

README.md

Lines changed: 94 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ It is closer to a control system than a chat convention.
125125
VALP is not a model ensemble or hidden consensus method. A model-level system
126126
such as Hermes Mixture of Agents (MoA) can improve one acting model's reasoning
127127
by collecting reference-model advice before the acting model responds. VALP
128-
governs multi-agent task execution: which runtime or agent was routed, what was
129-
dispatched, what evidence was expected, what actually completed, and whether
130-
the work passed review and audit.
128+
governs multi-agent task execution: which Leader the user selected, which
129+
Agents that Leader declared, what was dispatched, what evidence was expected,
130+
what actually completed, and whether the work passed review and audit. VALP
131+
does not choose or replace Agents.
131132

132133
## Entry Paths
133134

@@ -222,24 +223,37 @@ Windows runners for push and pull request.
222223
Editable local CLI install for development:
223224

224225
```bash
226+
python -m pip install --upgrade pip setuptools
225227
python -m pip install -e ".[dev]"
226228
valp audit examples/minimal-task
227229
```
228230

229231
Reference-runtime trial:
230232

231233
```bash
234+
bin/valp doctor --workspace /path/to/workspace --json
232235
bin/valp publish TASK-001 --workspace /path/to/workspace --prompt "Fix the bug and verify it"
236+
bin/valp route TASK-001 --workspace /path/to/workspace \
237+
--assignments /path/to/assignment-declaration.json
233238
bin/valp dispatch TASK-001 --workspace /path/to/workspace
234239
```
235240

236-
`publish` only creates and routes the task. It is not a completion signal. A
237-
new task will not pass `valp audit` until dispatch receipts, expected evidence,
238-
verification/review status, final synthesis, and required feedback records are
239-
recorded.
241+
Doctor commissions one capability passport per addressable Agent
242+
surface/session. Each passport separates official claims, local presence, live
243+
callability, and task-verified history, and records the observed model,
244+
provider, reasoning mode, session identity, skills, MCP, permissions, context,
245+
and limitations. The user chooses the Leader from those facts. `publish` only
246+
creates the task. The Leader then writes `assignment-declaration.json`, and
247+
`route --assignments` validates the declaration without choosing or replacing
248+
any Agent. See [examples/assignment-declaration.json](examples/assignment-declaration.json).
249+
250+
A new task will not pass `valp audit` until the Leader declaration and VALP
251+
validation agree, dispatch receipts and expected evidence exist,
252+
verification/review status is resolved, and final synthesis and required
253+
feedback records are recorded.
240254

241255
For Full Mode claims, completed receipts must be backed by actual runtime
242-
submission proof for each selected agent. Dry-run dispatch output, local
256+
submission proof for each Leader-declared Agent. Dry-run dispatch output, local
243257
sub-agent analysis, or a manually appended `dispatch_completed` receipt is not
244258
HERDR/live agent proof.
245259

@@ -253,15 +267,21 @@ task-local files such as `task.md`, `context-pack.json`, and
253267
Auto Visible Mode is the opt-in version of this entry path: a local policy or
254268
runtime watcher can decide that a user request should publish a VALP task
255269
without requiring the user to type the exact command. It must still show the
256-
trigger reason, task id, routing, skill recommendations, dispatches, evidence
257-
gates, and final report. Automatic trigger is not permission for silent
258-
high-risk execution.
270+
trigger reason, task id, Leader declaration status, validation, skill
271+
recommendations, dispatches, evidence gates, and final report. Without a valid
272+
user-selected Leader declaration, it stops after publish or capability refresh.
273+
Automatic trigger is not permission to select an Agent or execute high-risk
274+
work silently.
259275

260276
## Architecture
261277

262278
```text
263-
user request
279+
Doctor capability passports
280+
-> user-selected Leader
281+
-> user request
264282
-> VALP task folder
283+
-> Leader assignment declaration
284+
-> VALP declaration validation
265285
-> reference CLI or compatible runtime adapter
266286
-> agent sessions, queues, hosted runs, or manual handoffs
267287
-> dispatch receipts
@@ -308,13 +328,13 @@ Recommended first path:
308328

309329
```text
310330
1. Install VALP and resolve the actual install root.
311-
2. Run `valp doctor` before any real dispatch.
312-
3. Install HERDR, the reference VALP runtime, when Full Mode is desired.
313-
4. Run runtime preflight for the selected agents.
314-
5. Create or choose a workspace.
315-
6. Publish and dispatch a dry-run task first.
316-
7. Let the runtime scan agents, dispatch visibly, wait for status, and write
317-
receipts/evidence.
331+
2. Run `valp doctor --json` to commission current capability passports.
332+
3. Let the user explicitly choose the Leader.
333+
4. Install HERDR, the reference VALP runtime, when Full Mode is desired.
334+
5. Create or choose a workspace and publish a dry-run task.
335+
6. Let the Leader decompose the task and write an assignment declaration.
336+
7. Validate it with `valp route --assignments`, then preflight and dispatch.
337+
8. Let the runtime wait for status and write receipts/evidence.
318338
```
319339

320340
Linux/macOS recommended HERDR install:
@@ -340,19 +360,25 @@ VALP 0.2 starts with a local coordinator workflow plus an executable quality
340360
gate:
341361

342362
```bash
343-
bin/valp publish TASK-001 --workspace /path/to/workspace --prompt "Fix the bug and verify it"
344363
bin/valp doctor --workspace /path/to/Visible-Agent-Loop-Protocol
364+
bin/valp publish TASK-001 --workspace /path/to/workspace --prompt "Fix the bug and verify it"
365+
bin/valp route TASK-001 --workspace /path/to/workspace --assignments /path/to/assignment-declaration.json
345366
bin/valp preflight --runtime herdr --agent agy
346367
bin/valp dispatch TASK-001 --workspace /path/to/workspace
347368
bin/valp audit examples/full-mode-task
348369
```
349370

350-
`valp publish` creates the task, scans local capabilities when available, routes
351-
selected agents, writes dispatch files, and records `dispatch_written` receipts.
352-
The current reference scan reads VALP-local capability files first, then
353-
HERDR-compatible files as a compatibility fallback. If no local capability file
354-
is available, it falls back to a generic Manual Mode operator record rather than
355-
assuming a specific AI agent is installed.
371+
`valp doctor` reads VALP-local capability files first, then HERDR-compatible
372+
files as a compatibility fallback, and commissions capability passports. If
373+
evidence is missing, the corresponding passport layer stays `unknown`; Doctor
374+
does not invent a capability or infer the model from the Agent product name.
375+
376+
`valp publish` creates the task and waits for the Leader. It does not select
377+
Agents, write dispatches, or record `dispatch_written` receipts. `valp route`
378+
requires a Leader-authored declaration bound to an explicit user-selection
379+
reference. It verifies current capability, role, model/session, context, and
380+
permission gates before writing routing and dispatch evidence. A failed check
381+
blocks the declaration and suggests no replacement Agent.
356382

357383
`valp preflight` checks adapter-specific runtime readiness such as agent
358384
sessions, terminal size for pane adapters, queue/worker facts for headless
@@ -364,16 +390,23 @@ adapter submit commands for pane-controller tasks, or queue enqueue
364390
instructions for headless queue tasks. Use `--submit` only when the selected
365391
runtime is ready.
366392

393+
The HERDR submission adapter is packaged with the VALP CLI; a separate
394+
`herdr-loop` executable is not required. Preflight detects either atomic
395+
`herdr agent prompt` submission or the compatible `pane send-text` +
396+
`pane send-keys` + `agent wait` fallback and fails closed when neither complete
397+
path is available.
398+
367399
`valp audit` scans a task evidence folder and checks the Done Criteria from
368400
`SPEC.md`, including runtime preflight, skill recommendation evidence,
369-
correction-cycle evidence, invalid evidence status, and unsupported
370-
runtime/build/test claims.
401+
Leader declaration/validation consistency, correction-cycle evidence, invalid
402+
evidence status, and unsupported runtime/build/test claims.
371403

372404
`valp doctor` diagnoses a VALP protocol checkout without mutating by default. It
373405
checks local git tracking status, working tree cleanliness, ignored local
374406
residue, JSON/JSONL syntax, bundled example audits, and reference adapter
375-
probes. Use
376-
`--report <path>` or `--report desktop` to write a Markdown report.
407+
probes. It also commissions installation capability passports; use `--json` for
408+
their full machine-readable form. Use `--report <path>` or `--report desktop`
409+
to write a Markdown report.
377410

378411
See [docs/cli-audit.md](docs/cli-audit.md).
379412

@@ -383,11 +416,11 @@ The repository includes five self-verifying task examples:
383416

384417
| Example | What it proves | Expected audit |
385418
|---|---|---|
386-
| `examples/minimal-task/` | Manual Mode evidence can be audited without a runtime | `PASS`, `pass=13 warn=0 fail=0` |
387-
| `examples/full-mode-task/` | Synthetic Full Mode fixture satisfies runtime, receipt, correction-cycle, recommendation, review, and final synthesis audit gates | `PASS`, `pass=22 warn=0 fail=0` |
388-
| `examples/headless-queue-task/` | Synthetic Full Mode queue fixture passes without pane or terminal-size fields | `PASS`, `pass=21 warn=0 fail=0` |
389-
| `examples/real-doc-calibration-task/` | Sanitized real Manual Mode documentation calibration case study | `PASS`, `pass=14 warn=0 fail=0` |
390-
| `examples/langgraph-false-done/` | Real non-HERDR LangGraph false-done, repair, and independent review case | `PASS`, `pass=26 warn=0 fail=0` |
419+
| `examples/minimal-task/` | Manual Mode evidence can be audited without a runtime | `PASS`, `pass=14 warn=0 fail=0` |
420+
| `examples/full-mode-task/` | Synthetic Full Mode fixture satisfies runtime, receipt, correction-cycle, recommendation, review, and final synthesis audit gates | `PASS`, `pass=24 warn=0 fail=0` |
421+
| `examples/headless-queue-task/` | Synthetic Full Mode queue fixture passes without pane or terminal-size fields | `PASS`, `pass=22 warn=0 fail=0` |
422+
| `examples/real-doc-calibration-task/` | Sanitized real Manual Mode documentation calibration case study | `PASS`, `pass=15 warn=0 fail=0` |
423+
| `examples/langgraph-false-done/` | Real non-HERDR LangGraph false-done, repair, and independent review case | `PASS`, `pass=28 warn=0 fail=0` |
391424
| `docs/case-studies/visible-dispatch-process-proof.md` | Short public video of a real VALP/HERDR publish-and-dispatch process; not a standalone Full Mode completion case study | Process proof only |
392425

393426
Run the complete smoke check:
@@ -421,15 +454,17 @@ notes.
421454

422455
Full Mode is the intended VALP experience for automated multi-agent work:
423456

424-
- automatic agent and runtime scan;
457+
- Doctor-commissioned Agent capability passports;
458+
- explicit user-selected Leader;
459+
- Leader-declared assignments validated by VALP;
425460
- provider matrix and context policy scan;
426461
- visible dispatch;
427462
- submission proof;
428463
- status wait;
429464
- receipt ledger;
430465
- evidence gates;
431466
- review/fix/review loop;
432-
- selected-agent recommendation resolution;
467+
- Leader-declared Agent recommendation resolution;
433468
- approval gates for high-risk actions;
434469
- final synthesis record.
435470

@@ -443,32 +478,35 @@ runtime-backed receipt guarantees.
443478
Visible Agent Loop is a control system, not a chat convention:
444479

445480
```text
446-
publish task
447-
-> scan runtime, tools, skills, context budgets
481+
Doctor commissions one passport per Agent surface/session
482+
-> user selects Leader
483+
-> publish task
484+
-> Leader decomposes work and declares assignments
485+
-> VALP validates current runtime, tools, skills, models, and context budgets
448486
-> load local overlay, if present
449487
-> select runtime adapter
450488
-> classify task profile
451489
-> build provider matrix
452-
-> preflight runtime and agent sessions
453-
-> score and route agents by evidence
490+
-> score declared assignments as advisory evidence
491+
-> block invalid declarations without choosing replacements
492+
-> preflight runtime and declared Agent sessions
454493
-> run skill recommendation, if available
455-
-> route squad if needed
456494
-> dispatch visibly
457495
-> require receipts
458496
-> map runtime task states
459497
-> verify with real artifacts
460498
-> review/fix/review
461-
-> resolve selected-agent recommendations with scope control
499+
-> resolve Leader-declared Agent recommendations with scope control
462500
-> record final synthesis
463501
```
464502

465-
No agent is assumed to be known from memory. Agent selection is based on current
466-
runtime evidence: declared role, installed skills, available MCP/tools, runtime
467-
status, adapter preflight, permission boundary, context policy, optional skill
468-
recommendation evidence, local overlay hints, prior verification records, and
469-
routing feedback.
470-
Local capability profiles are hints, not fixed assignments. Every task reruns
471-
capability routing.
503+
No Agent is assumed to be known from memory or from its product name. Doctor
504+
records current evidence; the user chooses the Leader; the Leader assigns task
505+
roles. VALP scores and validates those declarations against declared role,
506+
installed skills, available MCP/tools, observed model/provider/session,
507+
runtime status, permission boundary, context policy, local overlay hints, and
508+
bound verification history. Scores are advice and audit evidence, never Agent
509+
selection authority.
472510

473511
Managed-agent platforms, daemon queues, and terminal-pane systems can all be
474512
VALP-compatible if they export the required runtime adapter evidence. A runtime
@@ -602,7 +640,7 @@ Visible-Agent-Loop-Protocol/
602640
- Dispatch completion requires receipts and expected evidence.
603641
- Full/Remote Mode completion also requires prior runtime submission proof; dry
604642
runs and local sub-agent simulations do not count as live dispatch.
605-
- Selected-agent recommendations must be visibly resolved; adoption means
643+
- Leader-declared Agent recommendations must be visibly resolved; adoption means
606644
explicit disposition and scope control, not unlimited task expansion.
607645
- Dispatch payloads must be concise; long context and full recommendation
608646
records are cited by file reference, not pasted into every worker prompt.
@@ -611,7 +649,11 @@ Visible-Agent-Loop-Protocol/
611649
- Long context is a reliability risk and must be scanned before dispatch.
612650
- Skill recommendation is evidence, not authority.
613651
- Local overlays are hints, not protocol overrides.
614-
- Agent profiles are routing hints, not fixed assignments.
652+
- Agent profiles and scores are assignment hints for the Leader, not VALP
653+
selection authority.
654+
- The user selects the Leader; only that Leader declares task Agents.
655+
- VALP validates declarations and may block them, but cannot choose or replace
656+
an Agent.
615657
- Provider capability is scanned, not assumed.
616658
- Routing feedback improves future routing but never replaces current scans.
617659
- Runtime queue completion is not VALP completion unless evidence gates pass.

0 commit comments

Comments
 (0)