loadout-ai 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +148 -1
  2. package/README.md +160 -315
  3. package/SECURITY.md +21 -1
  4. package/catalog/discovered.json +31269 -26003
  5. package/catalog/packages.json +4 -4
  6. package/dist/src/cli.js +13 -0
  7. package/dist/src/commands/agents.js +3 -1
  8. package/dist/src/commands/catalog-candidate.js +150 -0
  9. package/dist/src/commands/catalog-workflows.js +147 -0
  10. package/dist/src/commands/catalog.js +9 -367
  11. package/dist/src/commands/coordinate.js +586 -0
  12. package/dist/src/commands/coordination-discussions.js +194 -0
  13. package/dist/src/commands/coordination-sessions.js +197 -0
  14. package/dist/src/commands/inventory.js +4 -2
  15. package/dist/src/core/agents/agent-inspection.js +26 -4
  16. package/dist/src/core/{routing → agents}/model-config.js +7 -2
  17. package/dist/src/core/catalog/catalog.js +1 -0
  18. package/dist/src/core/catalog/registry.js +44 -10
  19. package/dist/src/core/catalog/safety.js +36 -7
  20. package/dist/src/core/coordination/adapters/claude-code.js +154 -0
  21. package/dist/src/core/coordination/adapters/codex.js +137 -0
  22. package/dist/src/core/coordination/adapters/types.js +64 -0
  23. package/dist/src/core/coordination/auth.js +59 -0
  24. package/dist/src/core/coordination/bridge-lease.js +79 -0
  25. package/dist/src/core/coordination/conflict-preview.js +167 -0
  26. package/dist/src/core/coordination/contract-diff.js +106 -0
  27. package/dist/src/core/coordination/coordinator.js +552 -0
  28. package/dist/src/core/coordination/crash-recovery.js +169 -0
  29. package/dist/src/core/coordination/daemon.js +667 -0
  30. package/dist/src/core/coordination/discussion.js +340 -0
  31. package/dist/src/core/coordination/events.js +161 -0
  32. package/dist/src/core/coordination/http-api.js +118 -0
  33. package/dist/src/core/coordination/interrupt-policy.js +89 -0
  34. package/dist/src/core/coordination/lock.js +110 -0
  35. package/dist/src/core/coordination/mcp-server.js +424 -0
  36. package/dist/src/core/coordination/redaction.js +85 -0
  37. package/dist/src/core/coordination/replay.js +188 -0
  38. package/dist/src/core/coordination/retention.js +128 -0
  39. package/dist/src/core/coordination/runtime.js +21 -0
  40. package/dist/src/core/coordination/session-manager.js +366 -0
  41. package/dist/src/core/coordination/watcher.js +128 -0
  42. package/dist/src/core/{routing → delegation}/first-party-skills.js +25 -13
  43. package/dist/src/core/{routing → delegation}/handoff.js +130 -63
  44. package/dist/src/core/discovery/candidate-intelligence-evidence.js +108 -0
  45. package/dist/src/core/discovery/candidate-intelligence-types.js +1 -0
  46. package/dist/src/core/discovery/candidate-intelligence-validation.js +108 -0
  47. package/dist/src/core/discovery/candidate-intelligence.js +3 -214
  48. package/dist/src/core/discovery/community.js +12 -4
  49. package/dist/src/core/discovery/github-discovery.js +6 -2
  50. package/dist/src/core/discovery/private-discovery.js +6 -2
  51. package/dist/src/core/install/reconcile.js +1 -1
  52. package/dist/src/core/install/source.js +21 -7
  53. package/dist/src/core/install/uninstall.js +39 -3
  54. package/dist/src/core/reporting/cli-guide.js +10 -6
  55. package/dist/src/core/reporting/completion.js +61 -109
  56. package/dist/src/core/reporting/doctor.js +4 -6
  57. package/dist/src/core/runtime/bounded-json.js +65 -0
  58. package/dist/src/core/runtime/github.js +30 -16
  59. package/dist/src/core/runtime/mcp-recipes.js +1 -1
  60. package/dist/src/core/workspace/active-policy.js +1 -1
  61. package/docs/CANDIDATE_INTELLIGENCE.md +9 -2
  62. package/docs/CATALOG.md +1 -1
  63. package/docs/CREDENTIAL_AND_UPDATE_POLICY.md +1 -1
  64. package/docs/DEMO_SCRIPT.md +19 -23
  65. package/docs/DISCOVERED.md +251 -250
  66. package/docs/FEATURE_TEST_MATRIX.md +10 -263
  67. package/docs/GITHUB_AUTHORIZATION.md +5 -0
  68. package/docs/LIVE_COLLABORATION.md +234 -0
  69. package/docs/PROVENANCE_AND_COMPARISON.md +1 -1
  70. package/docs/REFERENCE.md +163 -0
  71. package/docs/RELEASE_REVIEW.md +1 -2
  72. package/docs/TESTING.md +17 -1
  73. package/docs/USER_TEST_GUIDE.md +138 -3
  74. package/docs/assets/loadout-discover-activate.webp +0 -0
  75. package/docs/assets/loadout-handoff-coordinate.webp +0 -0
  76. package/docs/assets/loadout-social-preview.png +0 -0
  77. package/docs/decisions/001-coordination-jsonl-locking.md +35 -0
  78. package/docs/decisions/002-local-daemon-authentication.md +32 -0
  79. package/docs/decisions/003-bounded-agent-discussions.md +91 -0
  80. package/docs/specs/BOUNDED_AGENT_DISCUSSIONS.md +169 -0
  81. package/docs/superpowers/plans/2026-09-03-coordination-hardening.md +231 -0
  82. package/docs/superpowers/plans/2026-09-03-release-readiness.md +232 -0
  83. package/docs/superpowers/plans/2026-09-04-bounded-agent-discussions.md +121 -0
  84. package/package.json +18 -7
  85. package/skills/loadout-handoff/SKILL.md +238 -0
  86. package/MASTER_PLAN.md +0 -2207
  87. package/dist/src/core/routing/route.js +0 -539
  88. package/docs/ACTIVE_SET.md +0 -53
  89. package/docs/COMPATIBILITY_POLICY.md +0 -22
  90. package/docs/CONVERSION_AND_SANDBOX.md +0 -27
  91. package/docs/EVALUATION_PROTOCOL_V1.md +0 -300
  92. package/docs/HEAD_TO_HEAD_EVALUATION.md +0 -79
  93. package/docs/PROVIDER_CONFIGURATION.md +0 -45
  94. package/docs/README_RESEARCH.md +0 -36
  95. package/docs/REPOSITORY_STABILIZATION.md +0 -190
  96. package/docs/SAFE_UPDATE_DEMO.md +0 -25
  97. package/docs/SCHEMA_DECISIONS.md +0 -25
  98. package/docs/SUBMISSION_COPY.md +0 -90
  99. package/docs/TEAM_POLICY.md +0 -18
  100. package/docs/assets/loadout-workflow.png +0 -0
  101. package/docs/superpowers/plans/2026-07-19-relatable-readme-hero.md +0 -283
  102. package/docs/superpowers/plans/2026-07-20-loadout-readme-explainer.md +0 -116
  103. package/docs/superpowers/plans/2026-07-20-project-activation-safety.md +0 -469
  104. package/docs/superpowers/specs/2026-07-19-relatable-readme-hero-design.md +0 -80
  105. package/docs/superpowers/specs/2026-07-20-loadout-readme-explainer-design.md +0 -55
  106. package/docs/superpowers/specs/2026-07-20-project-activation-safety-design.md +0 -228
  107. package/skills/loadout-router/SKILL.md +0 -120
  108. /package/dist/src/core/{routing → agents}/credentials.js +0 -0
@@ -98,7 +98,6 @@ Confirm isolation before any applied command:
98
98
 
99
99
  ```bash
100
100
  loadout status --json
101
- loadout capabilities
102
101
  ```
103
102
 
104
103
  Expected: paths, if shown, are below `TEST_ROOT`; Codex and Claude Code are detected;
@@ -109,11 +108,11 @@ the capability table names native, adapted, and unsupported surfaces honestly.
109
108
  Run the entire required gate with one command:
110
109
 
111
110
  ```bash
112
- npm run verify
111
+ npm run verify:full
113
112
  ```
114
113
 
115
- `npm run verify:full` is an alias for the same CLI release gate. The individual stages
116
- are listed below for focused reruns and diagnosis.
114
+ This is the release gate. It runs the normal verification path plus coverage.
115
+ The individual stages are listed below for focused reruns and diagnosis.
117
116
 
118
117
  | Command | Coverage | Expected result |
119
118
  | -------------------------- | ----------------------------------------------------------------------- | -------------------------------------------------- |
@@ -158,8 +157,6 @@ loadout library --json
158
157
  loadout health --explain --json
159
158
  loadout report --json
160
159
  loadout card --json
161
- loadout outcomes --json
162
- loadout capabilities --inspect --json
163
160
  ```
164
161
 
165
162
  Expected:
@@ -184,7 +181,6 @@ Network variants must be run deliberately:
184
181
  loadout catalog --refresh --json
185
182
  loadout health --updates --json
186
183
  loadout scan --agents codex,claude-code --refresh-provenance --json
187
- loadout compare brainstorming --offline --json
188
184
  loadout discover --source mcp-registry --limit 10 --json
189
185
  loadout discover --source skills-sh --limit 10 --json
190
186
  ```
@@ -201,79 +197,7 @@ skills.sh path needs its request-scoped `VERCEL_OIDC_TOKEN`; without one it must
201
197
  previous complete cache or return an attributed `unavailable` result without making
202
198
  an unauthenticated request. Neither source installs or promotes a lead.
203
199
 
204
- ## 3. Package, manifest, lock, portability, and registry track (S/A)
205
-
206
- Create a package _inside_ the test project so its manifest can be exported portably:
207
-
208
- ```bash
209
- mkdir -p "$TEST_PROJECT/packages"
210
- loadout create "$TEST_PROJECT/packages/matrix-demo" \
211
- --name matrix-demo --description "Disposable matrix package"
212
- loadout pack "$TEST_PROJECT/packages/matrix-demo" --json
213
- loadout publish "$TEST_PROJECT/packages/matrix-demo" --local
214
- loadout search matrix-demo --json
215
-
216
- loadout init --path "$TEST_PROJECT/loadout.json" --name matrix \
217
- --agents codex,claude-code --scope project
218
- (
219
- cd "$TEST_PROJECT"
220
- loadout add local-demo --manifest loadout.json --local \
221
- --path packages/matrix-demo --agents codex,claude-code
222
- loadout sync --manifest loadout.json --lock loadout.lock
223
- loadout sync --manifest loadout.json --lock loadout.lock --yes
224
- loadout audit --manifest loadout.json --lock loadout.lock --json
225
- )
226
- ```
227
-
228
- Expected: `pack` returns a deterministic digest; local publication is immutable;
229
- the first `sync` is a dry run; applied sync prints one snapshot; `audit` returns
230
- `"valid": true`; skills appear only below the disposable profile.
231
-
232
- Exercise desired-state editing and portability:
233
-
234
- ```bash
235
- (
236
- cd "$TEST_PROJECT"
237
- loadout lock --manifest loadout.json --output loadout.lock
238
- loadout export portable.json --manifest loadout.json --lock loadout.lock
239
- loadout import portable.json --manifest imported.json --lock imported.lock
240
- loadout import portable.json --manifest imported.json --lock imported.lock --yes
241
- loadout unadd local-demo --manifest imported.json
242
- )
243
- ```
244
-
245
- Expected: import previews before writing; applied import snapshots destinations;
246
- `unadd` changes desired state only and does not delete installed files.
247
-
248
- The full authenticated remote-registry protocol, including wrong-token rejection,
249
- immutable-version conflict rejection, exact digest download, risk approval, and the
250
- HTTPS/non-loopback boundary, is reproducibly covered by:
251
-
252
- ```bash
253
- npx vitest run tests/registry-api.test.ts tests/package.test.ts
254
- ```
255
-
256
- Manual `registry-serve`/remote `publish` is an X test. After completing the throwaway
257
- credential setup in track 9, start this in one terminal:
258
-
259
- ```bash
260
- loadout registry-serve --port 7331 \
261
- --credential-keychain loadout-registry-test --credential-account tester
262
- ```
263
-
264
- Then publish from another terminal:
265
-
266
- ```bash
267
- loadout publish "$TEST_PROJECT/packages/matrix-demo" \
268
- --registry-url http://127.0.0.1:7331 \
269
- --credential-keychain loadout-registry-test --credential-account tester
270
- ```
271
-
272
- Never place the token on the command line. An identical version/content publish may
273
- be accepted idempotently; changed content at the same version must be rejected. Stop
274
- the server with Ctrl-C.
275
-
276
- ## 4. Install, active-set, outcome, and rollback track (A; Maximum is N)
200
+ ## 3. Install, active-set, and rollback track (A; Maximum is N)
277
201
 
278
202
  Exercise the new-user golden path before its constituent commands:
279
203
 
@@ -321,9 +245,6 @@ loadout disable direct-demo --agents codex
321
245
  loadout disable direct-demo --agents codex --yes --json
322
246
  loadout enable direct-demo --agents codex
323
247
  loadout enable direct-demo --agents codex --yes --json
324
- loadout outcome direct-demo/direct-demo --agent codex --task testing \
325
- --result success
326
- loadout outcomes --json
327
248
  loadout share "$TEST_PROJECT/share.json"
328
249
  loadout remove direct-demo
329
250
  loadout remove direct-demo --yes
@@ -355,7 +276,7 @@ and preserves matching active Stable units at the same reviewed commit; MCP-only
355
276
  packages remain explicit setup items. `--approve-risk` acknowledges displayed static
356
277
  findings but does not execute third-party repository scripts.
357
278
 
358
- ## 5. Existing-skill provenance, adoption, comparison, and freshness (R/S/A)
279
+ ## 4. Existing-skill provenance, adoption, and freshness (R/S/A)
359
280
 
360
281
  Copy one harmless skill into the disposable unmanaged profile, then inspect it:
361
282
 
@@ -366,7 +287,6 @@ cp "$TEST_PROJECT/packages/matrix-demo/skills/matrix-demo/SKILL.md" \
366
287
  loadout scan --agents codex --json
367
288
  loadout adopt unmanaged-demo --agent codex --json
368
289
  loadout adopt unmanaged-demo --agent codex --yes --json
369
- loadout compare unmanaged-demo --agent codex --offline --json
370
290
  ```
371
291
 
372
292
  Expected: scan labels the copy unmanaged; adoption preview does not change its bytes;
@@ -401,13 +321,12 @@ Only run the second command when the first reports a real reviewed update. Expec
401
321
  exact diff/safety plan, a snapshot on success, and refusal when new risky findings are
402
322
  not acknowledged with `--approve-risk`.
403
323
 
404
- ## 6. Discovery and human review queue (N/S)
324
+ ## 5. Discovery and human review queue (N/S)
405
325
 
406
326
  ```bash
407
327
  loadout discover --source hacker-news --limit 20 --min-score 20 --json
408
328
  loadout discover --source github --limit 20 --queue --json
409
329
  loadout discover --source all --limit 20 --queue --json
410
- loadout review-queue --decision pending --json
411
330
  ```
412
331
 
413
332
  Expected: results contain source evidence and public repository identifiers; queueing
@@ -415,12 +334,6 @@ deduplicates leads; nothing is promoted, cloned into an agent, or installed.
415
334
 
416
335
  For a repository printed by the queue:
417
336
 
418
- ```bash
419
- loadout review owner/repository --decision shortlisted
420
- loadout review-queue --decision shortlisted --json
421
- loadout review owner/repository --decision ignored
422
- ```
423
-
424
337
  Private GitHub discovery is opt-in and reads `GITHUB_TOKEN` only when `--private` is
425
338
  present. Prefer a native credential reference:
426
339
 
@@ -431,7 +344,7 @@ loadout discover --source github --private \
431
344
 
432
345
  Use a low-scope test token. The output and state must never contain its value.
433
346
 
434
- ## 7. Static inspection, MCP, conversion, canary, and sandbox (R/S/X)
347
+ ## 6. Static inspection, MCP, and conversion (R/S)
435
348
 
436
349
  Static package analysis never executes package content:
437
350
 
@@ -439,8 +352,6 @@ Static package analysis never executes package content:
439
352
  loadout inspect --source "$TEST_PROJECT/packages/matrix-demo" --json
440
353
  loadout evaluate --source "$TEST_PROJECT/packages/matrix-demo" --json
441
354
  loadout mcp --source "$TEST_PROJECT/packages/matrix-demo" --json
442
- loadout canary --source "$TEST_PROJECT/packages/matrix-demo" \
443
- --package matrix-demo --json
444
355
  ```
445
356
 
446
357
  Repeat `inspect`, `evaluate`, or `mcp` with `--repository owner/repository` for the
@@ -469,10 +380,6 @@ loadout mcp-config --config "$TEST_PROJECT/mcp.json" --name local-example \
469
380
  --command node --arg server.js
470
381
  loadout mcp-config --config "$TEST_PROJECT/mcp.json" --name local-example \
471
382
  --command node --arg server.js --yes
472
- loadout codex-mcp-config --config "$TEST_PROJECT/config.toml" \
473
- --name remote-example --url https://example.com/mcp
474
- loadout codex-mcp-config --config "$TEST_PROJECT/config.toml" \
475
- --name remote-example --url https://example.com/mcp --yes
476
383
  loadout mcp-recipe --json
477
384
  ```
478
385
 
@@ -486,148 +393,11 @@ requirements you have reviewed.
486
393
 
487
394
  Docker sandbox execution is intentionally separate:
488
395
 
489
- ```bash
490
- loadout sandbox-run --source "$TEST_PROJECT/packages/matrix-demo" \
491
- --image '<reviewed-image>@sha256:<digest>' \
492
- --command node --command --version --json
493
- loadout sandbox-run --source "$TEST_PROJECT/packages/matrix-demo" \
494
- --image '<reviewed-image>@sha256:<digest>' \
495
- --command node --command --version \
496
- --approve-risk --timeout 30000 --json
497
- ```
498
-
499
396
  Expected: the first invocation refuses/only plans without approval; the approved
500
397
  container has a read-only source mount, no inherited secrets, no Docker socket, no
501
398
  network, and a time bound. The image may need to be pulled beforehand.
502
399
 
503
- ## 8. Signing and head-to-head evidence (S)
504
-
505
- Validate the model-free benchmark campaign and card/compare surfaces with their
506
- deterministic automated contracts:
507
-
508
- ```bash
509
- npx vitest run tests/benchmark-campaign.test.ts tests/benchmark-cli.test.ts \
510
- tests/loadout-card.test.ts tests/share-report.test.ts
511
- ```
512
-
513
- Expected: campaign hashes and paired order are deterministic, every retry is included
514
- in the worst-case budget, over-budget plans are blocked, resumable metadata contains
515
- no prompt/output/credential bytes, and aggregate comparison never invents a quality
516
- delta. See `docs/EVALUATION_PROTOCOL_V1.md` for the campaign JSON contract. These
517
- tests do not call a model provider and consume no provider credit.
518
-
519
- ```bash
520
- loadout keygen --private-key "$TEST_ROOT/private.pem" \
521
- --public-key "$TEST_ROOT/public.pem"
522
- loadout catalog-sign --catalog "$LOADOUT_ROOT/catalog/packages.json" \
523
- --private-key "$TEST_ROOT/private.pem" --output "$TEST_ROOT/catalog.signed.json"
524
- loadout catalog-verify --snapshot "$TEST_ROOT/catalog.signed.json" \
525
- --public-key "$TEST_ROOT/public.pem"
526
- ```
527
-
528
- Expected: the private key is owner-only and outside the repository; verification
529
- succeeds; changing any byte in the signed payload makes verification fail.
530
-
531
- Preview and apply the same signed catalog inside the disposable profile:
532
-
533
- ```bash
534
- loadout catalog-update --source "$TEST_ROOT/catalog.signed.json" \
535
- --public-key "$TEST_ROOT/public.pem"
536
- loadout catalog-update --source "$TEST_ROOT/catalog.signed.json" \
537
- --public-key "$TEST_ROOT/public.pem" --yes
538
- loadout catalog --coverage --json
539
- ```
540
-
541
- Expected: preview prints an exact signed diff without mutation; apply creates a
542
- snapshot and trusted state; the effective catalog re-verifies the stored envelope.
543
- Repeating `--yes` refuses a replay. Test removal only in the disposable profile and
544
- only with the separate `--allow-removals` acknowledgement.
545
-
546
- The repository's generated feed can be triaged without network access:
547
-
548
- ```bash
549
- loadout candidate list --limit 5 --json
550
- loadout candidate list --query "codex skills"
551
- loadout capabilities --gaps --json
552
- loadout recommend --project "$TEST_PROJECT" --agent codex --json
553
- ```
554
-
555
- `candidate inspect owner/repository --output ./candidate-dossier.json` is a networked
556
- test: it performs a real public Git clone and writes a static immutable dossier to
557
- disposable Loadout state. Review that output before exercising `candidate propose`;
558
- proposal preview and approved proposal output never mutate the catalog.
559
-
560
- Graphify is an explicit executable recipe rather than a broad-setup component. With
561
- `uv` installed, exercise it only inside the disposable profile:
562
-
563
- ```bash
564
- loadout tool
565
- loadout tool graphify --agents codex
566
- loadout tool graphify --agents codex --yes --approve-risk
567
- "$LOADOUT_HOME/runtime/graphify/bin/graphify" --version
568
- test -f "$LOADOUT_USER_HOME/.codex/skills/graphify/SKILL.md"
569
- loadout tool graphify --remove
570
- loadout tool graphify --remove --yes --approve-risk
571
- test ! -e "$LOADOUT_USER_HOME/.codex/skills/graphify"
572
- test ! -e "$LOADOUT_HOME/runtime/graphify"
573
- ```
574
-
575
- Expected: preview identifies the exact wheel hash and all commands; apply reports
576
- Graphify 0.9.17, writes only the disposable target and isolated runtime, and removal
577
- restores the original target. The installer subprocess must not inherit API keys.
578
-
579
- Create a deterministic workflow fixture and five declared trials per candidate. This
580
- is harness input, not model-generated evidence, and it executes no candidate content:
581
-
582
- ```bash
583
- node --input-type=module <<'NODE'
584
- import { writeFile } from "node:fs/promises";
585
- const root = process.env.TEST_PROJECT;
586
- const fixture = {
587
- id: "matrix-workflow",
588
- version: "1",
589
- category: "workflow-adherence",
590
- requiredActions: ["inspect", "edit", "verify"],
591
- forbiddenActions: ["delete-unrelated"]
592
- };
593
- const trials = Array.from({ length: 5 }, () => [
594
- {
595
- candidateId: "baseline",
596
- fixtureId: fixture.id,
597
- observations: ["inspect", "edit", "verify"],
598
- durationMs: 10
599
- },
600
- {
601
- candidateId: "improved",
602
- fixtureId: fixture.id,
603
- observations: ["inspect", "edit", "verify", "report-uncertainty"],
604
- durationMs: 10
605
- }
606
- ]).flat();
607
- await writeFile(`${root}/fixture.json`, JSON.stringify(fixture, null, 2));
608
- await writeFile(`${root}/trials.json`, JSON.stringify(trials, null, 2));
609
- NODE
610
- ```
611
-
612
- Sign and inspect the resulting evidence:
613
-
614
- ```bash
615
- loadout head-to-head --fixture "$TEST_PROJECT/fixture.json" \
616
- --trials "$TEST_PROJECT/trials.json" --private-key "$TEST_ROOT/private.pem" \
617
- --output "$TEST_ROOT/evidence.json" --json
618
- loadout alerts --evidence "$TEST_ROOT/evidence.json" \
619
- --public-key "$TEST_ROOT/public.pem" --json
620
- ```
621
-
622
- The harness scores declared observations only. It never executes candidate content.
623
- The authoritative schema, safety-failure, minimum-trial, tamper, and practical-delta
624
- tests are also directly runnable:
625
-
626
- ```bash
627
- npx vitest run tests/head-to-head.test.ts tests/signing.test.ts
628
- ```
629
-
630
- ## 9. Credentials and model-provider verification (H/$)
400
+ ## 7. Credentials and model-provider verification (H/$)
631
401
 
632
402
  This track touches the real operating-system credential store even when
633
403
  `LOADOUT_HOME` is disposable. Use a unique throwaway service name and delete it.
@@ -668,7 +438,7 @@ unset OPENROUTER_API_KEY
668
438
  `models verify` makes one minimal request and may consume provider credit ($). Inspect
669
439
  provider billing before and after; do not run it in a loop.
670
440
 
671
- ## 10. Watchers, native scheduling, completions, and loopback UI/API (X/H)
441
+ ## 8. Watchers, native scheduling, completions, and loopback UI/API (X/H)
672
442
 
673
443
  One-shot update watching is safe and networked:
674
444
 
@@ -707,33 +477,10 @@ and `unschedule` commands remain available for job-specific control.
707
477
 
708
478
  The optional read-only loopback API can be checked separately:
709
479
 
710
- ```bash
711
- loadout serve --port 0
712
- ```
713
-
714
480
  Confirm that it binds only to `127.0.0.1`, inspect the API response, and stop it with
715
481
  Ctrl-C. It must not bind a public interface.
716
482
 
717
- ## 11. Improvement-cycle records (S)
718
-
719
- ```bash
720
- loadout improve --json
721
- loadout improve --write --output "$TEST_PROJECT/improvements" --json
722
- ```
723
-
724
- Copy the exact cycle id printed by the second command:
725
-
726
- ```bash
727
- loadout improve-feedback --id <cycle-id> --outcome partial \
728
- --note "Disposable matrix verification" \
729
- --directory "$TEST_PROJECT/improvements"
730
- ```
731
-
732
- Expected: the first command is read-only; `--write` persists a local prompt/cycle
733
- record only; feedback requires a human-selected outcome and stores no project source
734
- or prompt transcript.
735
-
736
- ## 12. Cleanup and pass criteria
483
+ ## 9. Cleanup and pass criteria
737
484
 
738
485
  First verify snapshot availability and roll back any remaining disposable mutation:
739
486
 
@@ -19,6 +19,11 @@ paste a token into a manifest, catalog, log, or command argument.
19
19
 
20
20
  ## Local flow and failure modes
21
21
 
22
+ > **Partly unimplemented.** `loadout connect` and `loadout disconnect` do not
23
+ > exist in the CLI today. `loadout discover --private` is real and reads
24
+ > credentials the user has already configured. Steps 1, 2, 3, and 5 describe the
25
+ > intended flow, not current behaviour.
26
+
22
27
  1. `loadout connect github` opens a browser using PKCE and a loopback callback.
23
28
  2. The local process verifies `state`, PKCE verifier, expiration, and callback host.
24
29
  3. It stores only an OS-keychain reference to the refresh/session material.
@@ -0,0 +1,234 @@
1
+ # Live Claude Code ↔ Codex coordination
2
+
3
+ Live coordination is beta in 0.9.0. The ordinary `loadout handoff` inbox is
4
+ the stable fallback: it is durable, understandable, and does not run either
5
+ provider automatically.
6
+
7
+ ## What “shared memory” means
8
+
9
+ Loadout shares structured project facts, not private conversations or model
10
+ context windows. Both agents can see the same tasks, file ownership, versioned
11
+ contracts, decisions, progress, blockers, verification results, and cursors.
12
+ Every accepted event is persisted before a watcher, dashboard, or provider
13
+ bridge sees it.
14
+
15
+ ```text
16
+ Claude Code CLI <----> provider bridge <----> Codex SDK
17
+ |
18
+ coordination protocol
19
+ .handoff/coordination.jsonl
20
+ / | \
21
+ CLI MCP HTTP/SSE
22
+ ```
23
+
24
+ The source of truth is an append-only project JSONL log protected by an
25
+ exclusive cross-process lock. There is no cloud service and no SQLite database.
26
+ Sequence numbers, acknowledgements, and snapshots make reconnects deterministic.
27
+
28
+ ## Three operating levels
29
+
30
+ 1. **Durable handoff (stable):** `loadout handoff` passes a bounded task and
31
+ context to the next agent session.
32
+ 2. **Shared coordination protocol (beta):** CLI or MCP tools publish and read
33
+ structured events. Agents see changes when they call `snapshot`/`subscribe`,
34
+ while the local daemon and dashboard can observe changes immediately.
35
+ 3. **Provider bridge (beta, opt-in):** a long-running local process resumes
36
+ provider sessions and submits relevant events as new follow-up turns.
37
+ 4. **Bounded design discussion (beta, opt-in):** Claude Code and Codex
38
+ alternate proposals and critiques on one question, then record a decision.
39
+
40
+ The bridge does not inject into an already-running turn. Delivery happens at a
41
+ safe turn boundary because that is what the supported Claude Code CLI and Codex
42
+ SDK interfaces provide.
43
+
44
+ ## Quick protocol test (no paid agent turn)
45
+
46
+ Run these commands in a disposable Git repository:
47
+
48
+ ```bash
49
+ loadout coord own claude-code src/api
50
+ loadout coord contract checkout-api --agent claude-code \
51
+ --body "POST /api/checkout -> 201 { id: string }"
52
+ loadout coord snapshot codex
53
+ loadout coord ack codex 1
54
+ loadout coord release claude-code src/api
55
+ loadout coord status
56
+ loadout coord replay
57
+ ```
58
+
59
+ The contract revision is allocated atomically when `--revision` is omitted.
60
+ Overlapping exclusive ownership is rejected. A future acknowledgement or stale
61
+ explicit contract revision is rejected as a conflict.
62
+
63
+ ## Connect the MCP server
64
+
65
+ `loadout serve` starts a protocol-only stdio MCP server in the current project.
66
+ It exposes `claim_task`, `release_ownership`, `publish_contract`,
67
+ `publish_update`, `subscribe`, `ack`, and `snapshot`. Contract revisions
68
+ auto-increment when omitted.
69
+
70
+ For Claude Code, add the server at project scope using its MCP command:
71
+
72
+ ```bash
73
+ claude mcp add --transport stdio --scope project loadout-coordination -- loadout serve
74
+ ```
75
+
76
+ For Codex, add this table to `~/.codex/config.toml` (or use the equivalent
77
+ Codex MCP configuration UI):
78
+
79
+ ```toml
80
+ [mcp_servers."loadout-coordination"]
81
+ command = "loadout"
82
+ args = ["serve"]
83
+ ```
84
+
85
+ Restart the host after changing its MCP configuration. The server inherits the
86
+ host process working directory, so confirm the agent opened the intended
87
+ project before publishing coordination state.
88
+
89
+ ## Run the provider bridge
90
+
91
+ First check what is available:
92
+
93
+ ```bash
94
+ loadout coord agents detect
95
+ ```
96
+
97
+ You can start sessions through Loadout (this runs paid provider turns):
98
+
99
+ ```bash
100
+ loadout coord agents start claude-code "Own the backend and publish endpoint contracts"
101
+ loadout coord agents start codex "Own the frontend and consume backend contracts"
102
+ ```
103
+
104
+ Copy the returned IDs, then keep both attached:
105
+
106
+ ```bash
107
+ loadout coord agents bridge \
108
+ claude-code:<session-id> \
109
+ codex:<thread-id>
110
+ ```
111
+
112
+ You can instead track an existing known host session without running a provider
113
+ turn with `loadout coord agents attach provider:session-id`. The provider validates
114
+ the ID when a later `send` or `bridge` operation submits a turn. `loadout coord
115
+ agents list` shows project-tracked sessions, and `loadout coord agents send`
116
+ performs one explicit follow-up turn.
117
+
118
+ Bridge safeguards:
119
+
120
+ - only one bridge process can own a project at a time;
121
+ - events route to different providers concurrently;
122
+ - update and acknowledgement events are passive by default and do not spend a
123
+ provider turn;
124
+ - contract, task, decision, done, ownership, and error events are delivered at
125
+ the next safe boundary;
126
+ - automatic delivery stops after 20 turns per session unless
127
+ `--max-turns <n>` changes the cap;
128
+ - provider responses are printed but never saved in `.handoff`;
129
+ - injected event text is labeled untrusted project data and must not authorize
130
+ commands, scope expansion, publishing, or destructive actions;
131
+ - the project kill switch blocks CLI, MCP, daemon, compaction, and provider
132
+ turns.
133
+
134
+ Use `loadout daemon kill "reason"` to stop coordination and
135
+ `loadout daemon resume` to re-enable it.
136
+
137
+ ## Let Claude Code and Codex debate one feature
138
+
139
+ Use a design room when both agents should compare approaches before either one
140
+ claims files or writes code:
141
+
142
+ ```bash
143
+ loadout coord discuss start "REST or GraphQL for checkout?" \
144
+ --agents claude-code,codex \
145
+ --rounds 2 \
146
+ --max-turns 5 \
147
+ --timeout 120
148
+ ```
149
+
150
+ `--agents` starts fresh sessions lazily. To continue existing conversations,
151
+ replace it with explicit IDs:
152
+
153
+ ```bash
154
+ loadout coord discuss start "REST or GraphQL for checkout?" \
155
+ --sessions claude-code:<session-id> codex:<thread-id> \
156
+ --rounds 2 --max-turns 5
157
+ ```
158
+
159
+ The first participant is the proposer; use `--proposer codex` to swap roles.
160
+ One round means one proposer turn and one reviewer turn. Synthesis costs one
161
+ additional turn, so the exact required count is `rounds * 2 + 1`. Loadout
162
+ rejects an insufficient budget, invalid provider set, invalid timeout, or mixed
163
+ fresh/existing mode before it starts a paid turn.
164
+
165
+ Every prompt says that the response is public, will be persisted, and must not
166
+ edit files, run commands, use tools, or reveal private reasoning. Every public
167
+ statement has a thread ID and reply ID. The final synthesis records the selected
168
+ decision, rationale, credible alternatives, and unresolved disagreement. Review
169
+ it later without spending quota:
170
+
171
+ ```bash
172
+ loadout coord discuss list
173
+ loadout coord discuss show <thread-id>
174
+ loadout coord replay
175
+ ```
176
+
177
+ The discussion holds the same singleton lease as the provider bridge, checks
178
+ the kill switch before every provider turn, never retries a rejected or invalid
179
+ response silently, and defaults to a 120-second per-turn timeout. It does not
180
+ begin implementation automatically.
181
+
182
+ ## Optional daemon and dashboard
183
+
184
+ ```bash
185
+ loadout daemon start
186
+ ```
187
+
188
+ The daemon binds only to `127.0.0.1`. It prints an authenticated dashboard URL
189
+ whose token is carried in the URL fragment, moved immediately into browser
190
+ session storage, and removed from visible history. REST and SSE accept bearer
191
+ headers only; query-string tokens, non-loopback Host headers, and cross-origin
192
+ browser requests are rejected. The token and session state are project-local
193
+ files with mode `0600`.
194
+
195
+ The dashboard is observability, not an agent injector. Use the MCP tools or the
196
+ provider bridge for agent-to-agent delivery.
197
+
198
+ ## Safety and data model
199
+
200
+ - Event schemas cap names, descriptions, context, payloads, arrays, and paths.
201
+ - Secret-like keys and values are redacted at the canonical write boundary, so
202
+ CLI, MCP, and HTTP writes follow the same rule.
203
+ - Ownership claims use normalized project-relative paths and detect directory /
204
+ child overlap.
205
+ - Contract revisions and event sequences are allocated while holding the same
206
+ project lock.
207
+ - Compaction first writes a complete archival copy and aborts if archival fails.
208
+ - Corrupt JSONL lines are reported rather than hiding valid neighboring events.
209
+ - `.handoff/coordination.jsonl` is project data. Do not commit it when its facts
210
+ are private; add the appropriate `.handoff` paths to `.gitignore`.
211
+
212
+ ## Honest limitations
213
+
214
+ - This is durable shared state plus follow-up turns, not one simultaneous model
215
+ context or provider-to-provider hidden channel.
216
+ - Claude Code and Codex authentication, quotas, billing, and host session IDs
217
+ remain provider concerns.
218
+ - The bridge cannot steer a turn already in progress.
219
+ - The design-room kill switch cannot cancel a provider call already in flight;
220
+ it prevents persistence and the next provider turn.
221
+ - A provider may fail, time out, reject a resume ID, or return output Loadout
222
+ cannot parse. The event stays durable and can still be consumed manually.
223
+ - The bridge is local to one machine and one repository. Remote teams need a
224
+ separately designed authenticated transport; this release intentionally does
225
+ not expose the daemon to a network.
226
+
227
+ ## Evidence
228
+
229
+ The coordination test suite covers concurrent writers, ownership conflicts,
230
+ revision allocation, malformed logs, redaction, authenticated HTTP/SSE, MCP
231
+ stdio framing, retention failure safety, kill-switch behavior, provider CLI/SDK
232
+ shapes, session replay, concurrent provider delivery, passive policy, and the
233
+ automatic-turn cap. The package smoke test verifies the compiled MCP artifact is
234
+ included in the npm tarball.
@@ -26,7 +26,7 @@ their `SKILL.md` files, and writes a local index below `LOADOUT_HOME/provenance`
26
26
 
27
27
  ## Relationship classification
28
28
 
29
- `loadout compare` uses deterministic relationships:
29
+ `loadout scan` uses deterministic relationships:
30
30
 
31
31
  - `exact-copy`: identical instruction fingerprint;
32
32
  - `divergent-same-name`: same normalized name, different instructions;