@sockulags/agent-os 0.14.0 → 0.16.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 (101) hide show
  1. package/README.md +102 -49
  2. package/cli/doctor.mjs +307 -0
  3. package/cli/index.mjs +328 -151
  4. package/cli/index.test.mjs +406 -9
  5. package/package.json +5 -6
  6. package/plugins/agent-os-core/.claude-plugin/plugin.json +18 -0
  7. package/plugins/agent-os-core/.codex-plugin/plugin.json +24 -0
  8. package/plugins/agent-os-core/skills/capture-intent/SKILL.md +65 -0
  9. package/plugins/agent-os-core/skills/capture-intent/references/intent-template.md +47 -0
  10. package/plugins/agent-os-core/skills/explain-work/SKILL.md +42 -0
  11. package/{skills → plugins/agent-os-core/skills}/list-skills/SKILL.md +13 -6
  12. package/{skills → plugins/agent-os-core/skills}/plain-voice/SKILL.md +7 -4
  13. package/plugins/agent-os-core/skills/plan-work/SKILL.md +133 -0
  14. package/plugins/agent-os-core/skills/plan-work/references/elicitation.md +32 -0
  15. package/plugins/agent-os-core/skills/plan-work/references/map.md +108 -0
  16. package/plugins/agent-os-core/skills/plan-work/references/spec-template.md +64 -0
  17. package/plugins/agent-os-core/skills/record-lesson/SKILL.md +47 -0
  18. package/plugins/agent-os-core/skills/scope-guard/SKILL.md +53 -0
  19. package/{skills → plugins/agent-os-core/skills}/verify-before-done/SKILL.md +6 -2
  20. package/plugins/agent-os-dev/.claude-plugin/plugin.json +18 -0
  21. package/plugins/agent-os-dev/.codex-plugin/plugin.json +24 -0
  22. package/plugins/agent-os-dev/hooks/hooks.json +42 -0
  23. package/{skills → plugins/agent-os-dev/skills}/batch-work/SKILL.md +9 -4
  24. package/{skills → plugins/agent-os-dev/skills}/batch-work/references/manifest.md +8 -0
  25. package/{skills → plugins/agent-os-dev/skills}/check-work/SKILL.md +31 -14
  26. package/{skills/deliver-work/workflow.md → plugins/agent-os-dev/skills/deliver-work/SKILL.md} +85 -17
  27. package/plugins/agent-os-dev/skills/design-work/SKILL.md +145 -0
  28. package/plugins/agent-os-dev/skills/design-work/scripts/render-sketch.mjs +233 -0
  29. package/plugins/agent-os-dev/skills/design-work/scripts/render-sketch.test.mjs +73 -0
  30. package/plugins/agent-os-dev/skills/diagnose-before-fix/SKILL.md +29 -0
  31. package/{skills → plugins/agent-os-dev/skills}/dispatch-next/SKILL.md +10 -4
  32. package/plugins/agent-os-dev/skills/init-agent-os/SKILL.md +121 -0
  33. package/plugins/agent-os-dev/skills/init-agent-os/policy.md +88 -0
  34. package/plugins/agent-os-dev/skills/init-agent-os/references/guards.md +39 -0
  35. package/{skills → plugins/agent-os-dev/skills}/init-agent-os/references/repository-init.md +41 -9
  36. package/plugins/agent-os-dev/skills/init-agent-os/references/review-template.md +35 -0
  37. package/plugins/agent-os-dev/skills/init-agent-os/scripts/policy-block.mjs +187 -0
  38. package/plugins/agent-os-dev/skills/init-agent-os/templates/agent-review.yml +59 -0
  39. package/plugins/agent-os-dev/skills/init-agent-os/templates/lint-intents.yml +30 -0
  40. package/{skills → plugins/agent-os-dev/skills}/proportional-testing/SKILL.md +1 -1
  41. package/plugins/agent-os-dev/skills/quality-ratchet/SKILL.md +103 -0
  42. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/references/project-controls.md +31 -3
  43. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/analyzers.mjs +145 -0
  44. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/analyzers.test.mjs +158 -0
  45. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/guards.mjs +372 -0
  46. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/guards.test.mjs +138 -0
  47. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/intent-files.mjs +322 -0
  48. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/intent-files.test.mjs +172 -0
  49. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/project-controls.mjs +59 -8
  50. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/project-controls.test.mjs +134 -8
  51. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/quality-delta.mjs +296 -22
  52. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/quality-delta.test.mjs +114 -6
  53. package/plugins/agent-os-dev/skills/shape-work/SKILL.md +124 -0
  54. package/plugins/agent-os-dev/skills/shape-work/references/implementation-issues.md +143 -0
  55. package/{skills/chart-work → plugins/agent-os-dev/skills/shape-work}/references/prototypes.md +11 -13
  56. package/plugins/agent-os-dev/skills/simplify/SKILL.md +91 -0
  57. package/plugins/agent-os-dev/skills/simplify/scripts/audit-evidence.mjs +166 -0
  58. package/plugins/agent-os-dev/skills/simplify/scripts/audit-evidence.test.mjs +49 -0
  59. package/policy.md +53 -20
  60. package/hooks/hooks.json +0 -17
  61. package/skills/chart-work/SKILL.md +0 -42
  62. package/skills/chart-work/references/elicitation.md +0 -25
  63. package/skills/chart-work/references/map.md +0 -84
  64. package/skills/deliver-work/SKILL.md +0 -12
  65. package/skills/diagnose-before-fix/SKILL.md +0 -24
  66. package/skills/explain-work/SKILL.md +0 -27
  67. package/skills/guide-me/SKILL.md +0 -36
  68. package/skills/init-agent-os/SKILL.md +0 -54
  69. package/skills/init-agent-os/scripts/policy-block.ps1 +0 -87
  70. package/skills/notice-lesson/SKILL.md +0 -20
  71. package/skills/quality-ratchet/SKILL.md +0 -72
  72. package/skills/record-lesson/SKILL.md +0 -31
  73. package/skills/scope-guard/SKILL.md +0 -32
  74. package/skills/shape-work/SKILL.md +0 -48
  75. package/skills/shape-work/references/implementation-issues.md +0 -69
  76. package/skills/shape-work/references/mockups.md +0 -23
  77. package/skills/simplifier/SKILL.md +0 -35
  78. package/skills/simplifier/agents/openai.yaml +0 -2
  79. package/skills/simplifier-audit/SKILL.md +0 -30
  80. package/skills/simplifier-review/SKILL.md +0 -40
  81. package/skills/understand-work/SKILL.md +0 -31
  82. package/skills/understand-work/agents/openai.yaml +0 -2
  83. package/skills/writing-skills/SKILL.md +0 -68
  84. package/skills/writing-skills/agents/openai.yaml +0 -2
  85. /package/{skills/batch-work → plugins/agent-os-core/skills/capture-intent}/agents/openai.yaml +0 -0
  86. /package/{skills/chart-work → plugins/agent-os-core/skills/explain-work}/agents/openai.yaml +0 -0
  87. /package/{skills/deliver-work → plugins/agent-os-core/skills/list-skills}/agents/openai.yaml +0 -0
  88. /package/{skills → plugins/agent-os-core/skills}/plain-voice/references/tells.md +0 -0
  89. /package/{skills/dispatch-next → plugins/agent-os-core/skills/plan-work}/agents/openai.yaml +0 -0
  90. /package/{skills/explain-work → plugins/agent-os-dev/skills/batch-work}/agents/openai.yaml +0 -0
  91. /package/{skills → plugins/agent-os-dev/skills}/batch-work/scripts/manifest-hash.mjs +0 -0
  92. /package/{skills → plugins/agent-os-dev/skills}/batch-work/scripts/test-manifest-hash.mjs +0 -0
  93. /package/{skills → plugins/agent-os-dev/skills}/check-work/references/findings.md +0 -0
  94. /package/{skills/guide-me → plugins/agent-os-dev/skills/deliver-work}/agents/openai.yaml +0 -0
  95. /package/{skills/init-agent-os → plugins/agent-os-dev/skills/design-work}/agents/openai.yaml +0 -0
  96. /package/{skills/list-skills → plugins/agent-os-dev/skills/dispatch-next}/agents/openai.yaml +0 -0
  97. /package/{skills/record-lesson → plugins/agent-os-dev/skills/init-agent-os}/agents/openai.yaml +0 -0
  98. /package/{skills → plugins/agent-os-dev/skills}/proportional-testing/references/strategy.md +0 -0
  99. /package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/references/structure.md +0 -0
  100. /package/{skills → plugins/agent-os-dev/skills}/shape-work/agents/openai.yaml +0 -0
  101. /package/{skills/simplifier-audit → plugins/agent-os-dev/skills/simplify}/agents/openai.yaml +0 -0
@@ -1,4 +1,5 @@
1
1
  import assert from 'node:assert/strict'
2
+ import { spawnSync } from 'node:child_process'
2
3
  import fs from 'node:fs'
3
4
  import os from 'node:os'
4
5
  import path from 'node:path'
@@ -7,18 +8,22 @@ import { fileURLToPath } from 'node:url'
7
8
  import {
8
9
  buildManagedHookCommand,
9
10
  buildPlan,
11
+ CODEX_HOOK_TRUST_NOTICE,
10
12
  executeInstall,
11
13
  hookConfigPath,
12
14
  INSTALL_MANIFEST,
13
15
  PACKAGE_NAME,
14
16
  parseArgs,
15
- planManagedHookConfig,
17
+ planManagedHooks,
16
18
  planPolicyUpdate,
19
+ policyBlockVersion,
17
20
  resolveOptions,
18
21
  run,
19
22
  targetSkillRoot,
20
23
  VERSION
21
24
  } from './index.mjs'
25
+ import { compareVersions, latestPublishedVersion } from './doctor.mjs'
26
+ import { resolvePolicyVersion } from '../plugins/agent-os-dev/skills/init-agent-os/scripts/policy-block.mjs'
22
27
 
23
28
  const temporaryRoots = []
24
29
 
@@ -46,11 +51,13 @@ test('defaults to guided direct install', () => {
46
51
  platform: null,
47
52
  method: null,
48
53
  scope: null,
54
+ package: null,
49
55
  policy: null,
50
56
  yes: false,
51
57
  dryRun: false,
52
58
  help: false,
53
- version: false
59
+ version: false,
60
+ offline: false
54
61
  })
55
62
  })
56
63
 
@@ -69,11 +76,13 @@ test('parses non-interactive direct update flags', () => {
69
76
  platform: 'both',
70
77
  method: 'direct',
71
78
  scope: 'project',
79
+ package: null,
72
80
  policy: false,
73
81
  yes: true,
74
82
  dryRun: false,
75
83
  help: false,
76
- version: false
84
+ version: false,
85
+ offline: false
77
86
  })
78
87
  })
79
88
 
@@ -83,11 +92,13 @@ test('supports Claude Code as a platform alias and upgrade as update', () => {
83
92
  platform: 'claude',
84
93
  method: null,
85
94
  scope: null,
95
+ package: null,
86
96
  policy: null,
87
97
  yes: true,
88
98
  dryRun: false,
89
99
  help: false,
90
- version: false
100
+ version: false,
101
+ offline: false
91
102
  })
92
103
  })
93
104
 
@@ -220,7 +231,9 @@ test('direct project install configures both hosts without replacing unrelated h
220
231
  ]) {
221
232
  const config = JSON.parse(fs.readFileSync(file, 'utf8'))
222
233
  assert.deepEqual(config.permissions, unrelated.permissions)
223
- assert.deepEqual(config.hooks.PreToolUse, unrelated.hooks.PreToolUse)
234
+ assert.deepEqual(config.hooks.PreToolUse[0], unrelated.hooks.PreToolUse[0])
235
+ assert.equal(config.hooks.PreToolUse.filter((group) => JSON.stringify(group).includes('--agent-os-hook=guards')).length, 1)
236
+ assert.equal(config.hooks.SessionStart.filter((group) => JSON.stringify(group).includes('--agent-os-hook=guards')).length, 1)
224
237
  assert.deepEqual(config.hooks.Stop[0], unrelated.hooks.Stop[0])
225
238
  assert.equal(config.hooks.Stop.filter((group) => JSON.stringify(group).includes('--agent-os-hook=quality-ratchet')).length, 1)
226
239
  const command = config.hooks.Stop.find((group) =>
@@ -230,6 +243,21 @@ test('direct project install configures both hosts without replacing unrelated h
230
243
  }
231
244
  })
232
245
 
246
+ test('a changed Codex hook tells the developer to trust it in /hooks, and an unchanged one stays quiet', async () => {
247
+ const root = temporaryRoot()
248
+ const project = path.join(root, 'project')
249
+ fs.mkdirSync(project, { recursive: true })
250
+ const install = async () => {
251
+ let text = ''
252
+ await executeInstall({
253
+ command: 'install', platform: 'codex', method: 'direct', scope: 'project', policy: false
254
+ }, { output: { write(chunk) { text += chunk } }, homeDir: root, cwd: project })
255
+ return text
256
+ }
257
+ assert.equal((await install()).includes(CODEX_HOOK_TRUST_NOTICE), true)
258
+ assert.equal((await install()).includes(CODEX_HOOK_TRUST_NOTICE), false)
259
+ })
260
+
233
261
  test('managed hook updates replace only the exact Agent OS entry', () => {
234
262
  const durableScript = path.join(temporaryRoot(), '.codex', 'skills', 'quality-ratchet', 'scripts', 'quality-delta.mjs')
235
263
  const managedCommand = buildManagedHookCommand(durableScript)
@@ -243,7 +271,9 @@ test('managed hook updates replace only the exact Agent OS entry', () => {
243
271
  ]
244
272
  }
245
273
  }, null, 2) + '\n'
246
- const planned = planManagedHookConfig(original, managedCommand, 'test hooks.json')
274
+ const planned = planManagedHooks(original, [
275
+ { event: 'Stop', marker: '--agent-os-hook=quality-ratchet', command: managedCommand }
276
+ ], 'test hooks.json')
247
277
  assert.equal(planned.status, 'UPDATED')
248
278
  const config = JSON.parse(planned.content)
249
279
  assert.equal(config.unrelated, true)
@@ -417,11 +447,11 @@ test('upgrades a schema 1 direct manifest while retaining managed integration st
417
447
 
418
448
  test('packaged hook asset and direct command use the stable runner marker', () => {
419
449
  const packageJson = JSON.parse(fs.readFileSync(path.join(packageRootForTest(), 'package.json'), 'utf8'))
420
- const hooks = JSON.parse(fs.readFileSync(path.join(packageRootForTest(), 'hooks', 'hooks.json'), 'utf8'))
450
+ const hooks = JSON.parse(fs.readFileSync(path.join(packageRootForTest(), 'plugins', 'agent-os-dev', 'hooks', 'hooks.json'), 'utf8'))
421
451
  const durableScript = path.join(temporaryRoot(), '.claude', 'skills', 'quality-ratchet', 'scripts', 'quality-delta.mjs')
422
452
  const command = buildManagedHookCommand(durableScript)
423
453
  const nativeHook = hooks.hooks.Stop[0].hooks[0]
424
- assert.ok(packageJson.files.includes('hooks/'))
454
+ assert.ok(packageJson.files.includes('plugins/'))
425
455
  assert.equal(hooks.description.includes('quality-ratchet'), true)
426
456
  assert.match(nativeHook.command, /\$\{CLAUDE_PLUGIN_ROOT\}/)
427
457
  assert.equal(typeof nativeHook.commandWindows, 'string')
@@ -495,6 +525,43 @@ test('policy planning preserves surrounding text and rejects malformed markers',
495
525
  () => planPolicyUpdate('<!-- BEGIN AGENT OS -->\nbroken\n', policy),
496
526
  /Malformed Agent OS policy markers/
497
527
  )
528
+
529
+ const versioned = planPolicyUpdate(updated.content, policy, '9.9.9')
530
+ assert.equal(versioned.status, 'UPDATED')
531
+ assert.equal(policyBlockVersion(versioned.content), '9.9.9')
532
+ assert.match(versioned.content, /<!-- BEGIN AGENT OS -->\n<!-- agent-os version 9\.9\.9 -->\n# Policy\n/)
533
+ assert.equal(planPolicyUpdate(versioned.content, policy, '9.9.9').status, 'OK')
534
+ assert.equal(policyBlockVersion('no block here'), null)
535
+ })
536
+
537
+ test('policy sync follows the selected platform and the installed policy script works without a checkout', async () => {
538
+ const root = temporaryRoot()
539
+ const homeDir = path.join(root, 'home')
540
+ await executeInstall({
541
+ command: 'install',
542
+ platform: 'codex',
543
+ method: 'direct',
544
+ scope: 'user',
545
+ policy: true
546
+ }, { output: silentOutput(), homeDir, cwd: root })
547
+
548
+ const installedPolicy = fs.readFileSync(path.join(homeDir, '.codex', 'AGENTS.md'), 'utf8')
549
+ assert.match(installedPolicy, /BEGIN AGENT OS/)
550
+ assert.equal(policyBlockVersion(installedPolicy), VERSION)
551
+ assert.equal(fs.existsSync(path.join(homeDir, '.claude', 'CLAUDE.md')), false)
552
+
553
+ const script = path.join(homeDir, '.codex', 'skills', 'init-agent-os', 'scripts', 'policy-block.mjs')
554
+ // The installed skill resolves the same version from the install manifest, so it sees no drift.
555
+ const installedCheck = spawnSync(process.execPath, [script, '--check', '--target', path.join(homeDir, '.codex', 'AGENTS.md')], { encoding: 'utf8' })
556
+ assert.equal(installedCheck.status, 0, installedCheck.stdout + installedCheck.stderr)
557
+ const target = path.join(root, 'CLAUDE.md')
558
+ fs.writeFileSync(target, '# Mine\n')
559
+ const run = (...args) => spawnSync(process.execPath, [script, '--target', target, ...args], { encoding: 'utf8' })
560
+ assert.equal(run('--check').status, 1)
561
+ assert.equal(fs.readFileSync(target, 'utf8'), '# Mine\n')
562
+ assert.equal(run().status, 0)
563
+ assert.equal(run('--check').status, 0)
564
+ assert.match(fs.readFileSync(target, 'utf8'), /^# Mine\n\n<!-- BEGIN AGENT OS -->/)
498
565
  })
499
566
 
500
567
  test('malformed policy markers abort before direct skill installation', async () => {
@@ -569,6 +636,336 @@ test('plugin update skips Git refresh for a registered local Codex marketplace',
569
636
  assert.deepEqual(calls.map((call) => call[1]), [
570
637
  ['plugin', 'marketplace', 'list', '--json'],
571
638
  ['plugin', 'list', '--json'],
572
- ['plugin', 'add', 'agent-os@agent-os']
639
+ ['plugin', 'add', 'agent-os-core@agent-os'],
640
+ ['plugin', 'add', 'agent-os-dev@agent-os']
573
641
  ])
574
642
  })
643
+
644
+ test('core-only install copies core skills, adds no hooks, and installs the policy without its dev section', async () => {
645
+ const root = temporaryRoot()
646
+ const homeDir = path.join(root, 'home')
647
+ const options = { command: 'install', platform: 'claude', method: 'direct', scope: 'user', policy: true, package: 'core' }
648
+ await executeInstall(options, { output: silentOutput(), homeDir, cwd: root })
649
+ const skillsRoot = path.join(homeDir, '.claude', 'skills')
650
+ assert.equal(fs.existsSync(path.join(skillsRoot, 'plan-work', 'SKILL.md')), true)
651
+ assert.equal(fs.existsSync(path.join(skillsRoot, 'deliver-work')), false)
652
+ const manifest = JSON.parse(fs.readFileSync(path.join(skillsRoot, INSTALL_MANIFEST), 'utf8'))
653
+ assert.deepEqual(manifest.packages, ['agent-os-core'])
654
+ assert.equal(fs.existsSync(path.join(homeDir, '.claude', 'settings.json')), false)
655
+ const policy = fs.readFileSync(path.join(homeDir, '.claude', 'CLAUDE.md'), 'utf8')
656
+ assert.match(policy, /## Core policy/)
657
+ assert.doesNotMatch(policy, /^## Development workflows$/m)
658
+
659
+ const doctor = await runDoctor(homeDir, root)
660
+ assert.match(doctor.text, /OK {4}claude direct user .*version /)
661
+ assert.match(doctor.text, /OK {4}claude global policy/)
662
+ assert.doesNotMatch(doctor.text, /hook missing|hooks missing|skills missing/)
663
+ })
664
+
665
+ test('switching from all packages to core removes dev skills and every managed hook', async () => {
666
+ const root = temporaryRoot()
667
+ const homeDir = path.join(root, 'home')
668
+ const options = { command: 'install', platform: 'codex', method: 'direct', scope: 'user', policy: false }
669
+ await executeInstall(options, { output: silentOutput(), homeDir, cwd: root })
670
+ const hookFile = path.join(homeDir, '.codex', 'hooks.json')
671
+ const all = JSON.parse(fs.readFileSync(hookFile, 'utf8'))
672
+ assert.equal(all.hooks.PreToolUse[0].matcher.includes('Edit'), true)
673
+ assert.match(JSON.stringify(all.hooks.SessionStart), /guards\.mjs/)
674
+ await executeInstall({ ...options, command: 'update', package: 'core' }, { output: silentOutput(), homeDir, cwd: root })
675
+ assert.equal(fs.existsSync(path.join(homeDir, '.codex', 'skills', 'deliver-work')), false)
676
+ assert.doesNotMatch(fs.readFileSync(hookFile, 'utf8'), /--agent-os-hook=/)
677
+ })
678
+
679
+ test('a direct install names the setup command, and a core-only install does not', async () => {
680
+ const install = async (extra) => {
681
+ const root = temporaryRoot()
682
+ let text = ''
683
+ await executeInstall({
684
+ command: 'install', platform: 'claude', method: 'direct', scope: 'user', policy: false, ...extra
685
+ }, { output: { write(chunk) { text += chunk } }, homeDir: path.join(root, 'home'), cwd: root })
686
+ return text
687
+ }
688
+ assert.match(await install({}), /Next: run \/init-agent-os global once for your personal preferences, then \/init-agent-os in each repository/)
689
+ assert.doesNotMatch(await install({ package: 'core' }), /init-agent-os/)
690
+ })
691
+
692
+ test('lint-intents reports errors with a failing exit code and warnings only under --strict', async () => {
693
+ const root = temporaryRoot()
694
+ const folder = path.join(root, 'intents', '2026-11-export')
695
+ fs.mkdirSync(folder, { recursive: true })
696
+ fs.writeFileSync(path.join(folder, 'intent.md'), '---\nid: 2026-11-export\nstatus: accepted\nrev: 2\nsupersedes: null\n---\n# Export\n')
697
+ fs.writeFileSync(path.join(folder, 'spec.md'), '---\nintent: 2026-11-export\nrev: 1\nbuilt_on: intent@1\nstatus: accepted\n---\n# Export\n')
698
+ const lint = async (...args) => {
699
+ let text = ''
700
+ const code = await run(['lint-intents', ...args], { output: { write(chunk) { text += chunk } }, cwd: root })
701
+ return { code, text }
702
+ }
703
+ const relaxed = await lint()
704
+ assert.equal(relaxed.code, 0, relaxed.text)
705
+ assert.match(relaxed.text, /WARN intents\/2026-11-export\/spec\.md: stale/)
706
+ assert.equal((await lint('--strict')).code, 1)
707
+ fs.writeFileSync(path.join(folder, 'spec.md'), '---\nintent: other\nrev: 1\nbuilt_on: intent@3\nstatus: draft\n---\n')
708
+ const broken = await lint()
709
+ assert.equal(broken.code, 1)
710
+ assert.match(broken.text, /ERROR intents\/2026-11-export\/spec\.md: status must be one of accepted, superseded/)
711
+ })
712
+
713
+ test('doctor reports a current install as clean and names drift with the fixing command', async () => {
714
+ const root = temporaryRoot()
715
+ const homeDir = path.join(root, 'home')
716
+ const cwd = path.join(root, 'project')
717
+ fs.mkdirSync(cwd, { recursive: true })
718
+ await executeInstall({
719
+ command: 'install', platform: 'codex', method: 'direct', scope: 'user', policy: true
720
+ }, { output: silentOutput(), homeDir, cwd })
721
+
722
+ const doctor = async (args = ['doctor', '--offline'], extra = {}) => {
723
+ let text = ''
724
+ const code = await run(args, { output: { write(chunk) { text += chunk } }, homeDir, cwd, ...extra })
725
+ return { code, text }
726
+ }
727
+ const clean = await doctor()
728
+ assert.equal(clean.code, 0, clean.text)
729
+ assert.match(clean.text, /OK {4}codex direct user .*version /)
730
+ assert.match(clean.text, /OK {4}codex global policy/)
731
+ assert.match(clean.text, /No version drift found/)
732
+
733
+ const outdated = await doctor(['doctor'], { latestVersion: () => '999.0.0' })
734
+ assert.match(outdated.text, /WARN {2}installer: .*latest published version is 999\.0\.0/)
735
+
736
+ const skillsRoot = path.join(homeDir, '.codex', 'skills')
737
+ const manifestPath = path.join(skillsRoot, INSTALL_MANIFEST)
738
+ const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'))
739
+ manifest.version = '0.1.0'
740
+ manifest.skills.push('retired-skill')
741
+ fs.writeFileSync(manifestPath, JSON.stringify(manifest))
742
+ fs.mkdirSync(path.join(skillsRoot, 'retired-skill'))
743
+ fs.writeFileSync(path.join(skillsRoot, 'retired-skill', 'SKILL.md'), '---\nname: retired-skill\n---\n')
744
+ fs.mkdirSync(path.join(homeDir, '.claude', 'plugins'), { recursive: true })
745
+ fs.writeFileSync(path.join(homeDir, '.claude', 'plugins', 'installed_plugins.json'), JSON.stringify({
746
+ plugins: { 'agent-os@agent-os-marketplace': [{ scope: 'user', version: '0.2.0' }] }
747
+ }))
748
+ const policyPath = path.join(homeDir, '.codex', 'AGENTS.md')
749
+ fs.writeFileSync(policyPath, fs.readFileSync(policyPath, 'utf8').replace(/<!-- agent-os version [^>]+ -->\n/, ''))
750
+
751
+ const drifted = await doctor()
752
+ assert.equal(drifted.code, 1)
753
+ assert.match(drifted.text, /DRIFT codex direct user .*installed 0\.1\.0.*update --platform codex --scope user/)
754
+ assert.match(drifted.text, /retired skills still installed: retired-skill/)
755
+ assert.match(drifted.text, /DRIFT claude plugin agent-os@agent-os-marketplace \(user\): the single agent-os plugin is replaced by agent-os-core and agent-os-dev/)
756
+ assert.match(drifted.text, /DRIFT codex global policy .*no version line/)
757
+ assert.equal(fs.readFileSync(manifestPath, 'utf8'), JSON.stringify(manifest))
758
+ })
759
+
760
+ test('doctor finds no installation and suggests install', async () => {
761
+ const root = temporaryRoot()
762
+ let text = ''
763
+ const code = await run(['doctor', '--offline'], {
764
+ output: { write(chunk) { text += chunk } }, homeDir: path.join(root, 'home'), cwd: root
765
+ })
766
+ assert.equal(code, 0)
767
+ assert.match(text, /no Agent OS installation found/)
768
+ })
769
+
770
+ function snapshotTree(root) {
771
+ const entries = []
772
+ const visit = (dir) => {
773
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
774
+ const file = path.join(dir, entry.name)
775
+ if (entry.isDirectory()) {
776
+ entries.push(['dir', path.relative(root, file)])
777
+ visit(file)
778
+ } else {
779
+ entries.push(['file', path.relative(root, file), fs.readFileSync(file, 'utf8')])
780
+ }
781
+ }
782
+ }
783
+ visit(root)
784
+ return entries
785
+ }
786
+
787
+ async function runDoctor(homeDir, cwd, args = ['doctor', '--offline'], extra = {}) {
788
+ let text = ''
789
+ const code = await run(args, { output: { write(chunk) { text += chunk } }, homeDir, cwd, ...extra })
790
+ return { code, text }
791
+ }
792
+
793
+ test('doctor reports broken install files as findings instead of crashing, and writes nothing', async () => {
794
+ const root = temporaryRoot()
795
+ const homeDir = path.join(root, 'home')
796
+ const cwd = path.join(root, 'project')
797
+ fs.mkdirSync(cwd, { recursive: true })
798
+ fs.mkdirSync(path.join(homeDir, '.claude', 'skills'), { recursive: true })
799
+ fs.writeFileSync(path.join(homeDir, '.claude', 'skills', INSTALL_MANIFEST), 'null')
800
+ fs.mkdirSync(path.join(homeDir, '.claude', 'CLAUDE.md'), { recursive: true })
801
+ fs.mkdirSync(path.join(homeDir, '.claude', 'plugins'), { recursive: true })
802
+ fs.writeFileSync(path.join(homeDir, '.claude', 'plugins', 'installed_plugins.json'),
803
+ JSON.stringify({ plugins: { 'agent-os@m': [null, 5, 'text'] } }))
804
+ fs.mkdirSync(path.join(homeDir, '.codex', 'plugins'), { recursive: true })
805
+ fs.writeFileSync(path.join(homeDir, '.codex', 'plugins', 'cache'), 'not a directory')
806
+ await executeInstall({
807
+ command: 'install', platform: 'codex', method: 'direct', scope: 'project', policy: false
808
+ }, { output: silentOutput(), homeDir, cwd })
809
+ fs.rmSync(path.join(cwd, '.codex', 'hooks.json'))
810
+ fs.mkdirSync(path.join(cwd, '.codex', 'hooks.json'))
811
+
812
+ const before = snapshotTree(root)
813
+ const result = await runDoctor(homeDir, cwd)
814
+ assert.deepEqual(snapshotTree(root), before)
815
+ assert.equal(result.code, 1, result.text)
816
+ assert.match(result.text, /DRIFT claude direct user .*is not a readable Agent OS install manifest.*Move it aside/)
817
+ assert.match(result.text, /WARN {2}codex direct project .*cannot read .*hooks\.json/)
818
+ assert.match(result.text, /WARN {2}claude global policy .*cannot read the file/)
819
+ assert.doesNotMatch(result.text, /no Agent OS installation found/)
820
+ })
821
+
822
+ test('doctor covers plugin caches, duplicates, strays, scopes, and in-place local marketplaces', async () => {
823
+ const root = temporaryRoot()
824
+ const homeDir = path.join(root, 'home')
825
+ const cwd = path.join(root, 'project')
826
+ fs.mkdirSync(cwd, { recursive: true })
827
+ await executeInstall({
828
+ command: 'install', platform: 'codex', method: 'direct', scope: 'user', policy: false
829
+ }, { output: silentOutput(), homeDir, cwd })
830
+ const cache = path.join(homeDir, '.codex', 'plugins', 'cache', 'agent-os', 'agent-os-dev')
831
+ fs.mkdirSync(path.join(cache, '0.1.0'), { recursive: true })
832
+ fs.writeFileSync(path.join(cache, '.DS_Store'), '')
833
+ fs.mkdirSync(path.join(homeDir, '.agents', 'skills', 'shape-work'), { recursive: true })
834
+ fs.writeFileSync(path.join(homeDir, '.agents', 'skills', 'shape-work', 'SKILL.md'), '---\nname: shape-work\n---\n')
835
+
836
+ const checkout = path.join(root, 'checkout')
837
+ fs.mkdirSync(path.join(checkout, 'plugins', 'agent-os-core', '.claude-plugin'), { recursive: true })
838
+ fs.writeFileSync(path.join(checkout, 'plugins', 'agent-os-core', '.claude-plugin', 'plugin.json'), JSON.stringify({ name: 'agent-os-core', version: VERSION }))
839
+ const plugins = path.join(homeDir, '.claude', 'plugins')
840
+ fs.mkdirSync(plugins, { recursive: true })
841
+ fs.writeFileSync(path.join(plugins, 'known_marketplaces.json'), JSON.stringify({
842
+ local: { source: { source: 'directory', path: checkout }, installLocation: checkout },
843
+ remote: { source: { source: 'github', repo: 'sockulags/agent-os' } }
844
+ }))
845
+ fs.writeFileSync(path.join(plugins, 'installed_plugins.json'), JSON.stringify({ plugins: {
846
+ 'agent-os-core@local': [{ scope: 'user', version: '0.2.0' }],
847
+ 'agent-os-dev@remote': [{ scope: 'project', version: '0.1.0' }]
848
+ } }))
849
+
850
+ const { code, text } = await runDoctor(homeDir, cwd)
851
+ assert.equal(code, 1)
852
+ assert.match(text, /DRIFT codex plugin agent-os-dev@agent-os: cached version 0\.1\.0/)
853
+ assert.doesNotMatch(text, /\.DS_Store/)
854
+ assert.match(text, /WARN {2}codex: both the plugin and a direct install are present.*Keep one/)
855
+ assert.match(text, /Agent OS skills outside the managed install: shape-work/)
856
+ assert.match(text, /OK {4}claude plugin agent-os-core@local \(user\): loaded in place from .*version /)
857
+ assert.match(text, /claude plugin update agent-os-dev@remote --scope project/)
858
+ })
859
+
860
+ test('doctor names a policy-only fix for plugin users and handles a CLI newer than npm', async () => {
861
+ const root = temporaryRoot()
862
+ const homeDir = path.join(root, 'home')
863
+ fs.mkdirSync(path.join(homeDir, '.claude', 'plugins'), { recursive: true })
864
+ fs.writeFileSync(path.join(homeDir, '.claude', 'plugins', 'installed_plugins.json'), JSON.stringify({
865
+ plugins: {
866
+ 'agent-os-core@remote': [{ scope: 'user', version: VERSION }],
867
+ 'agent-os-dev@remote': [{ scope: 'user', version: VERSION }]
868
+ }
869
+ }))
870
+ fs.writeFileSync(path.join(homeDir, '.claude', 'CLAUDE.md'), '# Mine\n')
871
+ const { text } = await runDoctor(homeDir, root, ['doctor'], { latestVersion: () => '0.0.1' })
872
+ assert.match(text, /WARN {2}claude global policy .*no Agent OS block\. To add it: run \/agent-os-dev:init-agent-os global/)
873
+ assert.match(text, /INFO {2}installer: this CLI is .* newer than the published 0\.0\.1/)
874
+ })
875
+
876
+ test('version comparison and the npm lookup tolerate odd input', () => {
877
+ assert.ok(compareVersions('0.16.0', '0.15.9') > 0)
878
+ assert.equal(compareVersions('0.15.0', '0.15.0-beta.1'), 0)
879
+ assert.ok(compareVersions('1.0.0', '0.99.99') > 0)
880
+ const calls = []
881
+ const spawn = (command, options) => {
882
+ calls.push([command, options.shell])
883
+ return { status: 0, stdout: '1.2.3\n' }
884
+ }
885
+ assert.equal(latestPublishedVersion('@sockulags/agent-os', { spawn }), '1.2.3')
886
+ assert.deepEqual(calls, [['npm view @sockulags/agent-os version', true]])
887
+ assert.equal(latestPublishedVersion('@sockulags/agent-os', { spawn: () => ({ status: 1, stdout: '' }) }), null)
888
+ assert.equal(latestPublishedVersion('@sockulags/agent-os', { spawn: () => ({ status: 0, stdout: 'npm warn\n' }) }), null)
889
+ assert.equal(latestPublishedVersion('@sockulags/agent-os', { spawn: () => { throw new Error('spawn failed') } }), null)
890
+ assert.equal(latestPublishedVersion('x; rm -rf /', { spawn }), null)
891
+ assert.equal(calls.length, 1)
892
+ })
893
+
894
+ test('the policy script reads the version from the dev plugin or checkout package.json and ignores other packages', () => {
895
+ const root = temporaryRoot()
896
+ const pluginRoot = path.join(root, 'plugins', 'agent-os-dev')
897
+ const scriptDir = path.join(pluginRoot, 'skills', 'init-agent-os', 'scripts')
898
+ fs.mkdirSync(scriptDir, { recursive: true })
899
+ fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({ name: 'other-package', version: '9.9.9' }))
900
+ assert.equal(resolvePolicyVersion(scriptDir), null)
901
+ fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({ name: PACKAGE_NAME, version: '1.2.3' }))
902
+ assert.equal(resolvePolicyVersion(scriptDir), '1.2.3')
903
+ fs.mkdirSync(path.join(pluginRoot, '.claude-plugin'))
904
+ fs.writeFileSync(path.join(pluginRoot, '.claude-plugin', 'plugin.json'), JSON.stringify({ name: 'agent-os-dev', version: '1.5.0' }))
905
+ assert.equal(resolvePolicyVersion(scriptDir), '1.5.0')
906
+ fs.writeFileSync(path.join(pluginRoot, 'skills', INSTALL_MANIFEST), JSON.stringify({ version: '2.0.0' }))
907
+ assert.equal(resolvePolicyVersion(scriptDir), '2.0.0')
908
+ })
909
+
910
+ test('doctor names the recorded Claude plugin key and gives no install advice for an unreadable plugin record', async () => {
911
+ const root = temporaryRoot()
912
+ const homeDir = path.join(root, 'home')
913
+ await executeInstall({
914
+ command: 'install', platform: 'claude', method: 'direct', scope: 'user', policy: false
915
+ }, { output: silentOutput(), homeDir, cwd: root })
916
+ const plugins = path.join(homeDir, '.claude', 'plugins')
917
+ fs.mkdirSync(plugins, { recursive: true })
918
+ fs.writeFileSync(path.join(plugins, 'installed_plugins.json'), JSON.stringify({
919
+ plugins: { 'agent-os-core@team': [{ scope: 'user', version: VERSION }] }
920
+ }))
921
+ const duplicate = await runDoctor(homeDir, root)
922
+ assert.match(duplicate.text, /Keep one: claude plugin uninstall agent-os-core@team, or delete/)
923
+ assert.doesNotMatch(duplicate.text, /agent-os@agent-os-marketplace/)
924
+
925
+ const unreadableHome = path.join(root, 'unreadable')
926
+ fs.mkdirSync(path.join(unreadableHome, '.claude', 'plugins'), { recursive: true })
927
+ fs.writeFileSync(path.join(unreadableHome, '.claude', 'plugins', 'installed_plugins.json'), '{ not json')
928
+ fs.writeFileSync(path.join(unreadableHome, '.claude', 'CLAUDE.md'), '# Mine\n')
929
+ const unreadable = await runDoctor(unreadableHome, root)
930
+ assert.match(unreadable.text, /WARN {2}claude plugins: cannot read/)
931
+ assert.doesNotMatch(unreadable.text, /no Agent OS installation found/)
932
+ assert.doesNotMatch(unreadable.text, /install --platform claude/)
933
+ assert.match(unreadable.text, /To add it: run \/agent-os-dev:init-agent-os global/)
934
+ })
935
+
936
+ test('update without --package keeps an earlier core-only choice', async () => {
937
+ const root = temporaryRoot()
938
+ const homeDir = path.join(root, 'home')
939
+ const options = { command: 'install', platform: 'codex', method: 'direct', scope: 'user', policy: false, package: 'core' }
940
+ await executeInstall(options, { output: silentOutput(), homeDir, cwd: root })
941
+ const parsed = await resolveOptions(parseArgs(['update', '--platform', 'codex', '--yes', '--no-policy']), {
942
+ input: { isTTY: false }, output: { isTTY: false }
943
+ })
944
+ assert.equal(parsed.package, null)
945
+ await executeInstall(parsed, { output: silentOutput(), homeDir, cwd: root })
946
+ const skillsRoot = path.join(homeDir, '.codex', 'skills')
947
+ assert.equal(fs.existsSync(path.join(skillsRoot, 'deliver-work')), false)
948
+ assert.deepEqual(JSON.parse(fs.readFileSync(path.join(skillsRoot, INSTALL_MANIFEST), 'utf8')).packages, ['agent-os-core'])
949
+ assert.equal(fs.existsSync(path.join(homeDir, '.codex', 'hooks.json')), false)
950
+ })
951
+
952
+ test('Claude plugin update removes the single legacy plugin before installing core and dev', async () => {
953
+ const calls = []
954
+ await executeInstall({
955
+ command: 'update', platform: 'claude', method: 'plugin', scope: 'user', policy: false
956
+ }, {
957
+ output: silentOutput(),
958
+ exists: () => true,
959
+ execute: (command, args) => {
960
+ calls.push(args.join(' '))
961
+ if (args.join(' ') === 'plugin marketplace list --json') {
962
+ return { status: 0, stdout: JSON.stringify([{ name: 'agent-os-marketplace' }]), stderr: '' }
963
+ }
964
+ return { status: 0, stdout: '', stderr: '' }
965
+ }
966
+ })
967
+ const uninstall = calls.indexOf('plugin uninstall agent-os@agent-os-marketplace --scope user')
968
+ assert.ok(uninstall >= 0, calls.join('\n'))
969
+ assert.ok(uninstall < calls.indexOf('plugin install agent-os-core@agent-os-marketplace --scope user'))
970
+ assert.ok(calls.includes('plugin install agent-os-dev@agent-os-marketplace --scope user'))
971
+ })
package/package.json CHANGED
@@ -1,22 +1,21 @@
1
1
  {
2
2
  "name": "@sockulags/agent-os",
3
- "version": "0.14.0",
4
- "description": "A lightweight personal agent operating system with an npx installer for Claude Code and Codex.",
3
+ "version": "0.16.0",
4
+ "description": "A lightweight agent operating system for Claude Code and Codex: agent-os-core for intent, planning, and evidence, and agent-os-dev for delivery, review, and guard hooks.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "agent-os": "./cli/index.mjs"
8
8
  },
9
9
  "files": [
10
10
  "cli/",
11
- "hooks/",
12
- "policy.md",
13
- "skills/"
11
+ "plugins/",
12
+ "policy.md"
14
13
  ],
15
14
  "engines": {
16
15
  "node": ">=18.18"
17
16
  },
18
17
  "scripts": {
19
- "test": "node --test cli/index.test.mjs skills/quality-ratchet/scripts/quality-delta.test.mjs skills/quality-ratchet/scripts/project-controls.test.mjs",
18
+ "test": "node --test cli/index.test.mjs plugins/agent-os-dev/skills/quality-ratchet/scripts/quality-delta.test.mjs plugins/agent-os-dev/skills/quality-ratchet/scripts/project-controls.test.mjs plugins/agent-os-dev/skills/quality-ratchet/scripts/analyzers.test.mjs plugins/agent-os-dev/skills/quality-ratchet/scripts/guards.test.mjs plugins/agent-os-dev/skills/quality-ratchet/scripts/intent-files.test.mjs plugins/agent-os-dev/skills/simplify/scripts/audit-evidence.test.mjs plugins/agent-os-dev/skills/design-work/scripts/render-sketch.test.mjs",
20
19
  "test:evals": "node scripts/test-eval-agent-behavior.mjs",
21
20
  "validate": "node scripts/validate-agent-os.mjs",
22
21
  "verify:release": "node scripts/verify-release.mjs"
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "agent-os-core",
3
+ "description": "Agent OS core: capture intent, plan decisions, explain plainly, keep scope, and prove claims. Useful for any agent work, not only code.",
4
+ "version": "0.16.0",
5
+ "author": {
6
+ "name": "Lucas Skog"
7
+ },
8
+ "homepage": "https://sockulags.github.io/agent-os/",
9
+ "repository": "https://github.com/sockulags/agent-os",
10
+ "keywords": [
11
+ "workflow",
12
+ "planning",
13
+ "intent",
14
+ "scope-control",
15
+ "verification",
16
+ "skills"
17
+ ]
18
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "agent-os-core",
3
+ "description": "Agent OS core: capture intent, plan decisions, explain plainly, keep scope, and prove claims. Useful for any agent work, not only code.",
4
+ "version": "0.16.0",
5
+ "homepage": "https://sockulags.github.io/agent-os/",
6
+ "repository": "https://github.com/sockulags/agent-os",
7
+ "keywords": [
8
+ "workflow",
9
+ "planning",
10
+ "intent",
11
+ "scope-control",
12
+ "verification",
13
+ "skills"
14
+ ],
15
+ "skills": "./skills/",
16
+ "interface": {
17
+ "displayName": "Agent OS Core",
18
+ "shortDescription": "Intent, planning, and evidence disciplines",
19
+ "longDescription": "Captures what is needed and why as a versioned intent, plans decisions and ground truth as a spec with a plain-language summary, explains or shortens text for non-technical readers, keeps work inside its agreed scope, records durable lessons, and requires fresh evidence before any completion claim. Works for product, documentation, and analysis work as well as code.",
20
+ "developerName": "Lucas Skog",
21
+ "category": "Productivity",
22
+ "websiteURL": "https://sockulags.github.io/agent-os/"
23
+ }
24
+ }
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: capture-intent
3
+ description: Captures what is needed and why as a versioned intent file, questioning out the need behind a stated wish one load-bearing question at a time. User-invoked when a new need, feature request, or tracker item should become an intent, or as the questioning stage of plan-work. Not for requests whose goal is already articulated, small fixes, or facts the repository answers.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Capture intent
8
+
9
+ Find the need behind the stated wish and record it where the next person and agent will find it.
10
+ The deliverable is a settled intent: who needs what, why now, the desired outcome, what is out of
11
+ scope, and the questions that remain open. It is not a plan or a solution.
12
+
13
+ ## Questioning loop
14
+
15
+ Resolve everything the repository, project policy, existing intents, linked tracker items, and the
16
+ conversation already answer before asking anything. Then, for each open point that materially
17
+ changes the goal:
18
+
19
+ - Present the concrete tension with materially different alternatives.
20
+ - Recommend one and name its consequence.
21
+ - Ask one load-bearing question at a time and wait for the answer.
22
+ - Record the choice, the reason, and every ruled-out direction with its reason.
23
+
24
+ Dig beneath the stated wish: what becomes possible when this exists, who feels the difference, and
25
+ why it matters now. Do not treat silence, momentum, or approval of a larger bundle as an answer to
26
+ a specific question. Do not propose a technical solution while the goal is still moving.
27
+
28
+ Questioning ends when the person says it is done or when further answers stop changing the goal.
29
+
30
+ ## Write the intent
31
+
32
+ Write a file when the need outlives this session, needs an owner's agreement, or will be planned
33
+ and delivered in more than one step. A small fix or a question settled in the conversation needs no
34
+ file: report the settled understanding directly.
35
+
36
+ 1. Choose the location. Use `intents/` at the repository root unless the project policy names
37
+ another intent location, such as a separate product repository.
38
+ 2. Choose the id `<YYYY-MM>-<slug>` from the current month and a short kebab-case name. Search the
39
+ existing intent folders first: reuse an intent that already covers this need instead of creating
40
+ a second one.
41
+ 3. Write `intents/<id>/intent.md` from [references/intent-template.md](references/intent-template.md).
42
+ A new intent has `rev: 1` and `status: accepted`, because merging its review is what accepts it.
43
+ Keep any extra frontmatter keys the project policy asks for, such as a tracker key.
44
+ 4. Write in the language the project uses for product text. Keep it short enough to read in a few
45
+ minutes; behavior details, decisions, and ground truth belong in the spec that `plan-work` writes.
46
+
47
+ The invocation authorizes writing the intent file. Commit it on a branch and open a pull request
48
+ for the owner's review only when the request or the project's delivery defaults include that;
49
+ otherwise leave the file for the person to commit. Never merge the review yourself.
50
+
51
+ ## Changing an accepted intent
52
+
53
+ An accepted intent changes only through a new review. Increase `rev` by one, add a line to its
54
+ `## Decision log` with the date, what changed, and why, and keep the earlier wording addressable in
55
+ history rather than rewriting the reason away. Every spec or plan built on the earlier revision is
56
+ now stale; name them in the report so `plan-work` can reconsider them. Replace an intent with a new
57
+ one only when the need itself changed: give the new intent `supersedes: <old-id>` and set the old one
58
+ to `status: superseded` in the same review.
59
+
60
+ ## Exit
61
+
62
+ Report the intent path and id, the choices made with their reasons, the ruled-out directions, and
63
+ the questions that remain open. Recommend one next action: usually `plan-work` when behavior,
64
+ decisions, or ground truth still need settling. Under plan-work, this stage informs the spec and
65
+ adds no separate approval gate.