@ai-atomic-framework/cli 0.1.28 → 0.1.29

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.
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "schemaId": "atm.runtimeBuildIdentity.v1",
3
- "sourceCommit": "330522513f8e4a07bf56c30f2db26cef4392711a",
4
- "sourceDigest": "5cebaad08f6ef9d3d7cc6f899dbe7d407a7092798ea162031e2dc2cc6b9838b5",
3
+ "sourceCommit": "cd88b1d4904bd9811bc13a0eb3c067b60afd7813",
4
+ "sourceDigest": "3cd572271c907dd73172d7a3706019200a26b931400c74cf68b9f6c81d84b93b",
5
5
  "packageName": "@ai-atomic-framework/cli",
6
- "version": "0.1.28",
6
+ "version": "0.1.29",
7
7
  "files": [
8
8
  {
9
9
  "path": "atm.mjs",
@@ -331,8 +331,8 @@
331
331
  },
332
332
  {
333
333
  "path": "runtime.mjs",
334
- "sha256": "46efa9ee8ac113b0a09a1498f0ebae320880553b683e6bcabf96c668bff6a863"
334
+ "sha256": "ddd4aef2f517353a259cd8bdadb4ff317c53b6565df5bb73b7e757aa19344bda"
335
335
  }
336
336
  ],
337
- "buildId": "7b8a454595ef22f70d6474aa9a67448446901d953bb66a8ad866942f53a0c651"
337
+ "buildId": "9777073bbae216a03c4236db27cd9c2a0a8b3c2ca1ecf9091da873ce74a0ae80"
338
338
  }
@@ -76,7 +76,7 @@
76
76
  "path": "build-identity.json",
77
77
  "kind": "runtime-entrypoint",
78
78
  "bytes": 15023,
79
- "sha256": "sha256:484ef4b5e41a046f8c7f7e5e8a44a20c218ecb5099444fcb8dc4397b0854a477"
79
+ "sha256": "sha256:3ffdf65a2723614bc46666363e0d0f1eee9b5a5b7664bf7cf969a8acf924d6cb"
80
80
  },
81
81
  {
82
82
  "path": "data/_vendor/atm-markdown-task-source/templates/aao-l2-split-template.md",
@@ -561,10 +561,10 @@
561
561
  {
562
562
  "path": "runtime.mjs",
563
563
  "kind": "runtime-entrypoint",
564
- "bytes": 2678620,
565
- "sha256": "sha256:46efa9ee8ac113b0a09a1498f0ebae320880553b683e6bcabf96c668bff6a863"
564
+ "bytes": 2678854,
565
+ "sha256": "sha256:ddd4aef2f517353a259cd8bdadb4ff317c53b6565df5bb73b7e757aa19344bda"
566
566
  }
567
567
  ],
568
568
  "fileCount": 84,
569
- "totalBytes": 3013819
569
+ "totalBytes": 3014053
570
570
  }
@@ -6,7 +6,7 @@ var O_e=Object.defineProperty;var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var pi=(e,t)=>{
6
6
  `)}function qJ(e){let r=[`[${e.ok?"OK":"FAIL"}] ${e.command} (${e.cwd})`];for(let o of e.messages??[])r.push(`${o.level}: ${o.code} - ${o.text}`);return e.evidence&&Object.keys(e.evidence).length>0&&(r.push("evidence:"),r.push(JSON.stringify(e.evidence,null,2))),`${r.join(`
7
7
  `)}
8
8
  `}function j(e){return`"${String(e??"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function JD(e){return Array.isArray(e)?e.map(t=>t):[]}function HPe(e){let t=new Map;for(let r of e)r?.flag&&t.set(r.flag,r),r?.alias&&t.set(r.alias,r);return t}var qPe,GJ=y(()=>{"use strict";_J();MJ();KD();NJ();Fk();qPe=new Set(["--actor","--validator","--scope-path","--task","--task-id","--command","--id"])});import{existsSync as WPe,mkdirSync as UPe,readFileSync as VPe,writeFileSync as zPe}from"node:fs";import wb from"node:path";function JPe(e){let t=KPe[e]||[],r=["--cwd","--force","--json","--pretty","--output-json","--summary","--fields"];return[...new Set([...t,...r])].sort()}function Fe(e,t,r={}){let o=JPe(e);return new h("ATM_CLI_USAGE",t,{exitCode:2,details:{invalidFlags:r.invalidFlags??[],missingRequired:r.missingRequired??[],allowedFlags:o,suggestedCommand:null}})}function Ao(e,t){let r={cwd:process.cwd(),ciProfile:void 0,spec:void 0,validate:void 0,self:!1,neutrality:!1,agentsMd:!1,guards:!1,evidence:void 0,verify:!1,claim:!1,apply:!1,dryRun:!1,force:!1,adopt:void 0,integration:void 0,task:void 0,tasks:[],batch:void 0,scope:void 0,compact:!1,full:!1,hold:!1,atom:void 0,map:void 0,propagate:void 0,profile:void 0,suite:void 0,fingerprintCheck:!1,edgeContracts:!1,agent:void 0,prompt:void 0,planningRoot:void 0,intent:void 0,files:[],reason:void 0,skipChecks:[],outputJson:void 0,summary:!1,fields:null},o=[];for(let a=0;a<e.length;a+=1){let n=e[a];if(n==="--output-json"){r.outputJson=Tt(e,a,"--output-json",t),Fd(r.outputJson??null),a+=1;continue}if(n==="--cwd"){r.cwd=Tt(e,a,"--cwd",t),a+=1;continue}if(n==="--ci-profile"){if(t!=="doctor")throw Fe(t,`${t} does not support option --ci-profile`,{invalidFlags:["--ci-profile"]});r.ciProfile=Tt(e,a,"--ci-profile",t),a+=1;continue}if(n==="--skip-check"){if(t!=="doctor")throw Fe(t,`${t} does not support option --skip-check`,{invalidFlags:["--skip-check"]});let s=Tt(e,a,"--skip-check",t);r.skipChecks=r.skipChecks.concat(s.split(",").map(i=>i.trim()).filter(Boolean)),a+=1;continue}if(n==="--spec"){if(!["spec","init","bootstrap","validate","test"].includes(t))throw Fe(t,`${t} does not support option --spec`,{invalidFlags:["--spec"]});r.spec=Tt(e,a,"--spec",t),a+=1;continue}if(n==="--profile"){if(t!=="test")throw Fe(t,`${t} does not support option --profile`,{invalidFlags:["--profile"]});r.profile=Tt(e,a,"--profile",t),a+=1;continue}if(n==="--suite"){if(t!=="test")throw Fe(t,`${t} does not support option --suite`,{invalidFlags:["--suite"]});r.suite=Tt(e,a,"--suite",t),a+=1;continue}if(n==="--validate"){if(t!=="spec")throw Fe(t,`${t} does not support option --validate`,{invalidFlags:["--validate"]});r.validate=Tt(e,a,"--validate",t),a+=1;continue}if(n==="--self"){if(t!=="verify")throw Fe(t,`${t} does not support option --self`,{invalidFlags:["--self"]});r.self=!0;continue}if(n==="--neutrality"){if(t!=="verify")throw Fe(t,`${t} does not support option --neutrality`,{invalidFlags:["--neutrality"]});r.neutrality=!0;continue}if(n==="--agents-md"){if(t!=="verify")throw Fe(t,`${t} does not support option --agents-md`,{invalidFlags:["--agents-md"]});r.agentsMd=!0;continue}if(n==="--guards"){if(t!=="verify")throw Fe(t,`${t} does not support option --guards`,{invalidFlags:["--guards"]});r.guards=!0;continue}if(n==="--evidence"){if(t!=="verify")throw Fe(t,`${t} does not support option --evidence`,{invalidFlags:["--evidence"]});r.evidence=Tt(e,a,"--evidence",t),a+=1;continue}if(n==="--verify"){if(t!=="self-host-alpha")throw Fe(t,`${t} does not support option --verify`,{invalidFlags:["--verify"]});r.verify=!0;continue}if(n==="--agent"){if(t!=="self-host-alpha")throw Fe(t,`${t} does not support option --agent`,{invalidFlags:["--agent"]});r.agent=Tt(e,a,"--agent",t),a+=1;continue}if(n==="--claim"){if(t!=="next")throw Fe(t,`${t} does not support option --claim`,{invalidFlags:["--claim"]});r.claim=!0;continue}if(n==="--apply"){if(t!=="residue")throw Fe(t,`${t} does not support option --apply`,{invalidFlags:["--apply"]});r.apply=!0;continue}if(n==="--tasks"){if(t!=="next")throw Fe(t,`${t} does not support option --tasks`,{invalidFlags:["--tasks"]});let s=Tt(e,a,"--tasks",t);r.tasks=s.split(",").map(i=>i.trim()).filter(Boolean),a+=1;continue}if(n==="--batch"){if(t!=="batch")throw Fe(t,`${t} does not support option --batch`,{invalidFlags:["--batch"]});r.batch=Tt(e,a,"--batch",t),a+=1;continue}if(n==="--scope"){if(t!=="batch")throw Fe(t,`${t} does not support option --scope`,{invalidFlags:["--scope"]});r.scope=Tt(e,a,"--scope",t),a+=1;continue}if(n==="--compact"){if(t!=="batch")throw Fe(t,`${t} does not support option --compact`,{invalidFlags:["--compact"]});r.compact=!0;continue}if(n==="--full"){if(t!=="orient")throw Fe(t,`${t} does not support option --full`,{invalidFlags:["--full"]});r.full=!0;continue}if(n==="--hold"){if(t!=="batch")throw Fe(t,`${t} does not support option --hold`,{invalidFlags:["--hold"]});r.hold=!0;continue}if(n==="--actor"){if(!["next","batch","quickfix"].includes(t))throw Fe(t,`${t} does not support option --actor`,{invalidFlags:["--actor"]});r.agent=Tt(e,a,"--actor",t),a+=1;continue}if(n==="--prompt"){if(!["next","quickfix"].includes(t))throw Fe(t,`${t} does not support option --prompt`,{invalidFlags:["--prompt"]});r.prompt=Tt(e,a,"--prompt",t),a+=1;continue}if(n==="--planning-root"){if(t!=="next")throw Fe(t,`${t} does not support option --planning-root`,{invalidFlags:["--planning-root"]});r.planningRoot=Tt(e,a,"--planning-root",t),a+=1;continue}if(n==="--intent"){if(t!=="next")throw Fe(t,`${t} does not support option --intent`,{invalidFlags:["--intent"]});r.intent=Tt(e,a,"--intent",t),a+=1;continue}if(n==="--files"){if(!["next","quickfix"].includes(t))throw Fe(t,`${t} does not support option --files`,{invalidFlags:["--files"]});let s=Tt(e,a,"--files",t);r.files=s.split(",").map(i=>i.trim()).filter(Boolean),a+=1;continue}if(n==="--reason"){if(!["batch","quickfix"].includes(t))throw Fe(t,`${t} does not support option --reason`,{invalidFlags:["--reason"]});r.reason=Tt(e,a,"--reason",t),a+=1;continue}if(n==="--dry-run"){if(t!=="init")throw Fe(t,`${t} does not support option --dry-run`,{invalidFlags:["--dry-run"]});r.dryRun=!0;continue}if(n==="--force"){r.force=!0;continue}if(n==="--adopt"){if(t!=="init")throw Fe(t,`${t} does not support option --adopt`,{invalidFlags:["--adopt"]});!e[a+1]||e[a+1].startsWith("--")?r.adopt="default":(r.adopt=Tt(e,a,"--adopt",t),a+=1);continue}if(n==="--integration"){if(t!=="init")throw Fe(t,`${t} does not support option --integration`,{invalidFlags:["--integration"]});r.integration=Tt(e,a,"--integration",t),a+=1;continue}if(n==="--atom"){if(t!=="test")throw Fe(t,`${t} does not support option --atom`,{invalidFlags:["--atom"]});r.atom=Tt(e,a,"--atom",t),a+=1;continue}if(n==="--map"){if(t!=="test")throw Fe(t,`${t} does not support option --map`,{invalidFlags:["--map"]});r.map=Tt(e,a,"--map",t),a+=1;continue}if(n==="--equivalence-fixtures"){if(t!=="test")throw Fe(t,`${t} does not support option --equivalence-fixtures`,{invalidFlags:["--equivalence-fixtures"]});r.equivalenceFixtures=Tt(e,a,"--equivalence-fixtures",t),a+=1;continue}if(n==="--fingerprint-check"){if(t!=="test")throw Fe(t,`${t} does not support option --fingerprint-check`,{invalidFlags:["--fingerprint-check"]});r.fingerprintCheck=!0;continue}if(n==="--edge-contracts"){if(!["test"].includes(t))throw Fe(t,`${t} does not support option --edge-contracts`,{invalidFlags:["--edge-contracts"]});r.edgeContracts=!0;continue}if(n==="--propagate"){if(t!=="test")throw Fe(t,`${t} does not support option --propagate`,{invalidFlags:["--propagate"]});r.propagate=Tt(e,a,"--propagate",t),a+=1;continue}if(n==="--task"){if(!["init","bootstrap","next","tasks","batch"].includes(t))throw Fe(t,`${t} does not support option --task`,{invalidFlags:["--task"]});r.task=Tt(e,a,"--task",t),a+=1;continue}if(n==="--summary"){r.summary=!0,kf(!0);continue}if(n==="--fields"){let s=Tt(e,a,"--fields",t);r.fields=s.split(",").map(i=>i.trim()).filter(Boolean),yf(r.fields),a+=1;continue}if(!(n==="--json"||n==="--pretty")){if(n.startsWith("--"))throw Fe(t,`${t} does not support option ${n}`,{invalidFlags:[n]});o.push(n)}}return{options:{...r,cwd:wb.resolve(r.cwd)},positional:o}}function If(e){return wb.join(e,TJ)}function D(e,t){return wb.relative(e,t).replace(/\\/g,"/")}function Sb(e){let t=wb.join(e,".atm");return UPe(t,{recursive:!0}),t}function Xe(e,t="ATM_JSON_NOT_FOUND"){if(!WPe(e))throw new h(t,`JSON file not found: ${e}`,{details:{filePath:e}});try{return tr(VPe(e,"utf8"))}catch(r){throw new h("ATM_JSON_INVALID",`Invalid JSON file: ${e}`,{details:{filePath:e,reason:r instanceof Error?r.message:String(r)}})}}function zc(e,t){zPe(e,`${JSON.stringify(t,null,2)}
9
- `,"utf8")}function YPe(e){return e.charCodeAt(0)===65279?e.slice(1):e}function tr(e){return JSON.parse(YPe(e))}function Tt(e,t,r,o){let a=e[t+1];if(!a||a.startsWith("--"))throw Fe(o,`${o} requires a value for ${r}`,{missingRequired:[r]});return a}var KPe,HJ=y(()=>{"use strict";Fk();KPe={doctor:["--ci-profile","--skip-check"],spec:["--spec","--validate"],verify:["--spec","--self","--neutrality","--agents-md","--guards","--evidence"],"self-host-alpha":["--verify","--agent"],next:["--spec","--claim","--tasks","--actor","--prompt","--planning-root","--intent","--task"],batch:["--batch","--scope","--compact","--hold","--actor","--reason","--task"],quickfix:["--actor","--prompt","--files","--reason"],init:["--spec","--dry-run","--adopt","--integration","--task"],bootstrap:["--spec","--task"],test:["--atom","--spec","--profile","--suite","--map","--equivalence-fixtures","--fingerprint-check","--edge-contracts","--propagate"],welcome:["--dry-run"],status:[],validate:["--spec"],integration:["--integration"],orient:["--full"]}});var _=y(()=>{"use strict";Fk();GJ();HJ()});var G,H,W,z,ce=y(()=>{"use strict";G={flag:"--json",summary:"Force machine-readable JSON output with the standard result contract (ok, severity, exitCode, blocking, diagnostics)."},H={flag:"--pretty",summary:"Force human-readable pretty output."},W={flag:"--help",alias:"-h",summary:"Show command help."},z={flag:"--cwd",value:"path",summary:"Run the command against a specific repository root."}});var WJ,UJ=y(()=>{"use strict";_();ce();WJ=q({name:"actor",summary:"Manage actor identity registry records and verify repo-local git identity alignment.",positional:[{name:"action",summary:"register | list | resolve | verify-git | adopt",required:!0}],options:[z,{flag:"--id",value:"id",summary:"Actor id. Required for register; optional for resolve/verify-git when env vars are set."},{flag:"--kind",value:"kind",summary:"Actor kind: human | ai-agent | automation."},{flag:"--name",value:"text",summary:"Display name for register / adopt."},{flag:"--provider",value:"text",summary:"Provider label (for example: OpenAI, Anthropic)."},{flag:"--editor",value:"text",summary:"Editor or host tool label (for example: codex, claude-code). Required for adopt."},{flag:"--model",value:"text",summary:"Model slug (for example: opus-4-7). Required for adopt; combined with --editor to form the slug."},{flag:"--session",value:"text",summary:"Optional session id recorded in runtime identity default for adopt."},{flag:"--git-name",value:"text",summary:"Expected git user.name. Defaults to the composed slug for adopt."},{flag:"--git-email",value:"text",summary:"Expected git user.email. Defaults to <slug>@atm.local for adopt."},{flag:"--contact",value:"text",summary:"Optional contact or owner channel."},{flag:"--capabilities",value:"csv",summary:"Comma-separated capability tags."},G,H,W],examples:['node atm.mjs actor register --id codex-main --kind ai-agent --name "Codex Main" --provider OpenAI --editor codex --git-name "Codex Agent" --git-email codex@example.local --json',"node atm.mjs actor list --json","node atm.mjs actor resolve --id codex-main --json","node atm.mjs actor verify-git --id codex-main --json","node atm.mjs actor adopt --editor claude-code --model opus-4-7 --kind ai-agent --json"]})});var VJ,zJ=y(()=>{"use strict";_();ce();VJ=q({name:"atom-ref",summary:"Generate and validate readable atom/map refs for runAtm callsites.",positional:[{name:"subcommand",summary:"sweep",required:!0}],options:[{flag:"--repo",value:"path",repeatable:!0,summary:"Repository path to scan and optionally update."},{flag:"--apply",summary:"Write generated refs, reports, and safe callsite rewrites."},G,H,W],examples:["node atm.mjs atom-ref sweep --repo . --json","node atm.mjs atom-ref sweep --apply --repo C:\\Users\\User\\AI-Atomic-Framework --json"]})});var KJ,JJ=y(()=>{"use strict";_();ce();KJ=q({name:"atom-capsule",summary:"Export, import, roll back, or inspect atom capsules in the capsule registry.",positional:[{name:"action",summary:"export | import | rollback | advisories",required:!0}],options:[z,{flag:"--atom",value:"id",summary:"Atom id to export."},{flag:"--name",value:"text",summary:"Human-readable name recorded in the capsule registry."},{flag:"--source",value:"path",summary:"Source file to package during export."},{flag:"--cid",value:"cid",summary:"Capsule content id for import or rollback."},{flag:"--payload",value:"base64",summary:"Compressed capsule payload for import."},{flag:"--no-vendor",summary:"Skip vendoring the imported bundle into the repository vendor directory."},{flag:"--previous-cid",value:"cid",summary:"Previous capsule cid to link when exporting a new revision."},{flag:"--source-ref",value:"text",summary:"Optional source reference recorded in the registry entry."},{flag:"--exported-by",value:"id",summary:"Actor or tool id recorded for the export event."},G,H,W],examples:["node atm.mjs atom-capsule export --atom ATM-CORE-0001 --source packages/core/src/index.ts --json","node atm.mjs atom-capsule import --cid atm:cid:abc123 --payload <base64> --json","node atm.mjs atom-capsule rollback --cid atm:cid:abc123 --json","node atm.mjs atom-capsule advisories --json"]})});var YJ,QJ=y(()=>{"use strict";_();ce();YJ=q({name:"atomize",summary:"Inspect and improve ATM atomization coverage for the current repository, including inventory/score/backfill plus the official registration-receipt and task snapshot helper lane.",positional:[{name:"subcommand",summary:"inventory | score | backfill | register-receipt | snapshot | verify-task",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path to inspect or update."},{flag:"--dry-run",summary:"For backfill, generate a proposal without writing atomization artifacts."},{flag:"--apply",summary:"For backfill, write generatedDraft governance artifacts for review."},{flag:"--task",value:"id",summary:"For register-receipt/snapshot/verify-task: governed task id for receipts and task snapshots."},{flag:"--phase",value:"before|after",summary:"For snapshot: which task snapshot boundary to record."},{flag:"--shard",value:"path",summary:"For register-receipt: owner-shard file to update."},{flag:"--path-pattern",value:"glob",summary:"For register-receipt: production path pattern to register into the owner shard."},{flag:"--atom-id",value:"id",summary:"For register-receipt: owner atom or map id for the path pattern."},{flag:"--capability",value:"text",summary:"For register-receipt: capability description recorded in the owner-shard row."},{flag:"--source-task",value:"id",summary:"For register-receipt: source task id stored onto the owner-shard row."},{flag:"--map-id",value:"id",summary:"For register-receipt: referenced map id to record into the generated receipt. Repeatable."},{flag:"--validate-command",value:"text",summary:"For register-receipt: validator command to run before the receipt is marked healthy. Repeatable."},{flag:"--no-default-validator",summary:"For register-receipt: skip the default npm run validate:atomization-coverage command."},{flag:"--expected-atom-delta",value:"number",summary:"For verify-task: expected atom registry count delta between before/after snapshots."},{flag:"--expected-map-delta",value:"number",summary:"For verify-task: expected map registry count delta between before/after snapshots."},{flag:"--expected-path-delta",value:"number",summary:"For verify-task: expected path-to-atom-map row count delta between before/after snapshots."},G,H,W],examples:["node atm.mjs atomize inventory --repo . --json","node atm.mjs atomize score --repo . --json","node atm.mjs atomize backfill --dry-run --repo . --json","node atm.mjs atomize backfill --apply --repo . --json",'node atm.mjs atomize register-receipt --repo . --task TASK-CID-0104 --shard atomic_workbench/atomization-coverage/path-to-atom-map-shards/owner-shard-cli.json --path-pattern packages/cli/src/commands/evidence.ts --atom-id atm.historical-batch-evidence --capability "historical batch evidence slicing and close-readiness guards" --source-task TASK-CID-0104 --map-id atm.task-closure-map --json',"node atm.mjs atomize snapshot --repo . --task TASK-CID-0104 --phase before --json","node atm.mjs atomize verify-task --repo . --task TASK-CID-0104 --expected-atom-delta 0 --expected-map-delta 0 --expected-path-delta 1 --json"]})});var XJ,ZJ=y(()=>{"use strict";_();ce();XJ=q({name:"baseline",summary:"Create, inspect, or restore redteam test baselines for ATM framework work.",positional:[{name:"action",summary:"create | status | restore",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path for baseline operations."},{flag:"--name",value:"name",summary:"Baseline name, usually a git tag such as atm-redteam-baseline-2026-05-24."},{flag:"--framework-commit-range-cut",summary:"Also write the framework legacy commit-range cut manifest at this baseline commit."},{flag:"--worktree-only",summary:"Required for restore; resets the current test worktree to the baseline commit."},{flag:"--force",summary:"Allow restore on main/master/trunk. Use only for explicit recovery."},G,H,W],examples:["node atm.mjs baseline create --name atm-redteam-baseline-2026-05-24 --framework-commit-range-cut --json","node atm.mjs baseline status --name atm-redteam-baseline-2026-05-24 --json","node atm.mjs baseline restore --name atm-redteam-baseline-2026-05-24 --worktree-only --json"]})});var e6,t6=y(()=>{"use strict";_();ce();e6=q({name:"batch",summary:"Inspect, execute, repair, resume, skip, or checkpoint an active ATM batch run. Batch automates queue bookkeeping, but each task still needs real deliverables before closure.",options:[z,{flag:"--actor",value:"id",summary:"Actor id used for checkpoint, skip, resume, or abandon actions."},{flag:"--auto-batch",value:"on|off",summary:"For current/status wave selection: disable auto-batch wave dispatch with --auto-batch off."},{flag:"--auto-batch-collection-timeout-ms",value:"ms",summary:"For current/status wave selection: override the auto-batch collection timeout evidence value."},{flag:"--auto-batch-max-wave-size",value:"n",summary:"For current/status wave selection: override the maximum selected wave size."},{flag:"--batch",value:"id",summary:"Select a specific active batch run by batchId."},{flag:"--compact",summary:"Return only the current queue head, selected currentWave, deferredReasons, progress, allowed files, validators, and next commands for fast agent routing."},{flag:"--cancel",summary:"For execute-plan: cancel the durable plan executor and emit the recovery receipt."},{flag:"--delivery-commit",value:"commit",summary:"For checkpoint or deliver-and-close: verify a scoped delivery commit, equivalent to tasks close --historical-delivery."},{flag:"--deliver-and-close",summary:"Show the queue-head delivery flow: implement deliverables, record evidence, checkpoint, then commit the checkpoint state."},{flag:"--hold",summary:"For checkpoint: close and advance the current task, but do not auto-claim the next queue head before the commit window."},{flag:"--historical-batch",value:"id-or-path",summary:"For checkpoint: consume a close-ready historical-batch slice for the current queue head."},{flag:"--historical-delivery",value:"commit",summary:"For checkpoint: verify an earlier scoped delivery commit before closing the queue head."},{flag:"--waiver-out-of-scope-delivery",summary:"For checkpoint with historical delivery: allow a mixed historical delivery commit when task-matched files cover the queue head; requires --reason."},{flag:"--waive-out-of-scope",summary:"Alias for --waiver-out-of-scope-delivery."},{flag:"--emergency-approval",value:"leaseId",summary:"For checkpoint or deliver-and-close: forward a protected backend close approval lease when historical delivery closeback requires one."},{flag:"--wave",value:"id",summary:"For checkpoint-readiness: wave id to evaluate atomically."},{flag:"--manifest-digest",value:"digest",summary:"For checkpoint-readiness: wave manifest digest shared by receipts."},{flag:"--delivery-receipt",value:"path",summary:"For checkpoint-readiness: shared commit receipt path. Repeatable."},{flag:"--build-receipt",value:"path",summary:"For checkpoint-readiness: shared build receipt path. Repeatable."},{flag:"--projection-receipt",value:"path",summary:"For checkpoint-readiness: shared projection receipt path. Repeatable."},{flag:"--planning-closeback-blocked",summary:"For checkpoint-readiness: mark planning closeback as requiring reconciliation."},{flag:"--plan",value:"path",summary:"For execute-plan/plan-start: planning document or task-card path used for the durable plan digest."},{flag:"--pause",summary:"For execute-plan: pause the durable plan executor and emit a resume command."},{flag:"--reason",value:"text",summary:"For skip: required blocker reason recorded in the batch audit trail."},{flag:"--scope",value:"key",summary:"Select a specific active batch run by scopeKey when batchId is not available."},{flag:"--task",value:"id",summary:"For execute-plan/plan-start: repeat to seed a durable plan run; for skip/resume: task id to skip from the queue head or restore from the skipped list."},G,H,W],examples:["node atm.mjs batch status --json","node atm.mjs batch execute-plan --actor codex-main --plan docs/plan.md --task TASK-001 --task TASK-002 --json","node atm.mjs batch execute-plan --actor codex-main --batch plan-batch-abc123 --pause --json","node atm.mjs batch execute-plan --actor codex-main --batch plan-batch-abc123 --cancel --json","node atm.mjs batch status --batch batch-abc123 --compact --json","node atm.mjs batch current --compact --json","node atm.mjs batch current --auto-batch off --json","node atm.mjs batch current --batch batch-abc123 --compact --json","node atm.mjs batch deliver-and-close --actor codex-main --batch batch-abc123 --json","node atm.mjs batch repair --actor codex-main --batch batch-abc123 --json",'node atm.mjs batch skip --actor codex-main --batch batch-abc123 --task TASK-AAO-0044 --reason "external blocker" --json',"node atm.mjs batch resume --actor codex-main --batch batch-abc123 --task TASK-AAO-0044 --json","node atm.mjs batch resume --actor codex-main --scope TASK-ASA --json","node atm.mjs batch checkpoint --actor codex-main --batch batch-abc123 --delivery-commit abc123 --json","node atm.mjs batch checkpoint --actor codex-main --batch batch-abc123 --historical-batch hist-batch-2026-06-16T01-40-43-634Z --json","node atm.mjs batch checkpoint --actor codex-main --batch batch-abc123 --hold --json","node atm.mjs batch checkpoint --actor codex-main --batch batch-abc123 --json","node atm.mjs batch checkpoint-readiness --wave wave-123 --manifest-digest sha256:abc --task TASK-GOV-0100 --delivery-receipt .atm/history/evidence/wave-123.shared-write.json --build-receipt .atm/history/evidence/wave-123.build.json --projection-receipt .atm/history/evidence/wave-123.projection.json --json","node atm.mjs batch abandon --actor codex-main --batch batch-abc123 --json"]})});var r6,o6=y(()=>{"use strict";_();ce();r6=q({name:"bootstrap",summary:"Create or refresh the default ATM bootstrap pack.",positional:[],options:[z,{flag:"--task",value:"text",summary:'Override bootstrap task title (default: "Bootstrap ATM in this repository").'},{flag:"--force",summary:"Overwrite existing bootstrap files."},G,H,W],examples:["node atm.mjs bootstrap --cwd .",'node atm.mjs bootstrap --cwd <host-repo> --task "Bootstrap ATM in this repository"']})});var a6,n6=y(()=>{"use strict";_();ce();a6=q({name:"setup",summary:"Set up ATM in one selected project, discover supported agent configurations, safely reconcile integrations, and verify readiness.",positional:[],options:[z,{flag:"--agents",value:"csv",summary:"Explicit adapter IDs, or none for CLI-only setup. Defaults to all detected configurations."},{flag:"--dry-run",summary:"Inspect the selected target and all integration conflicts without writing."},G,H,W],examples:["node atm.mjs setup","node atm.mjs setup --cwd ../project --json","node atm.mjs setup --cwd ../project --agents codex,claude-code --json","node atm.mjs setup --cwd ../project --agents none --dry-run --json"]})});var s6,i6=y(()=>{"use strict";_();ce();s6=q({name:"budget",summary:"Evaluate context budget policy for a governed task.",positional:[{name:"action",summary:"Currently supports: check",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Work item id to evaluate."},{flag:"--budget-id",value:"id",summary:"Custom budget report id."},{flag:"--estimated-tokens",value:"number",summary:"Estimated token count for the pending turn."},{flag:"--inline-artifacts",value:"number",summary:"Inline artifact count in the pending turn."},{flag:"--requested-summary",value:"text",summary:"Requested summary guidance."},G,H,W],examples:["node atm.mjs budget check --task BOOTSTRAP-0001 --estimated-tokens 16000 --json"]})});var c6,l6=y(()=>{"use strict";_();ce();c6=q({name:"cache",summary:"Manage ATM guide cache and one-file runtime cache.",positional:[{name:"action",summary:"enable | disable | clear | status | prune",required:!1}],options:[z,{flag:"--goal",value:"text",summary:"Filter guide cache entries when clearing."},{flag:"--runtime",value:"onefile",summary:"Runtime cache kind to prune. Currently supports onefile."},{flag:"--keep",value:"count",summary:"Number of newest one-file cache entries to keep. Defaults to 3."},{flag:"--dry-run",summary:"Report prune candidates without deleting cache entries."},G,H,W],examples:["node atm.mjs cache status --json",'node atm.mjs cache clear --goal "rank candidates" --json',"node atm.mjs cache prune --runtime onefile --keep 3 --json"]})});var d6,m6=y(()=>{"use strict";_();ce();d6=q({name:"cleanup",summary:"Diagnose or safely reconcile receipt-classified disposable residue.",positional:[{name:"action",summary:"diagnose | apply",required:!1}],options:[z,G,H,W],examples:["node atm.mjs cleanup diagnose --json","node atm.mjs cleanup apply --json"],help:{audience:"operator",requiredFlagSets:[],relatedCommands:["node atm.mjs residue status --json"],commonMistakes:["Using raw deletion for active-owner or staged residue."],playbookNotes:["cleanup apply removes only receipt-classified, non-staged disposable residue and preserves foreign or active-owner files."]}})});var u6,f6=y(()=>{"use strict";_();ce();u6=q({name:"candidates",summary:"Rank legacy source candidates and emit source inventory plus police evidence.",positional:[{name:"action",summary:"Currently supports: rank",required:!1}],options:[z,{flag:"--include",value:"glob",summary:"Source include glob. Repeatable. Defaults to Python pipeline/script globs.",repeatable:!0},{flag:"--goal",value:"text",summary:"Original user goal preserved in the ranking artifact."},{flag:"--max-file-lines",value:"number",summary:"Line-count threshold for decomposition police and risk scoring."},{flag:"--limit",value:"number",summary:"Maximum ranked candidates to return."},{flag:"--out-dir",value:"path",summary:"Report output directory. Defaults to .atm/history/reports/candidates."},G,H,W],examples:['node atm.mjs candidates rank --include "pipelines/**/*.py" --json','node atm.mjs candidates rank --include "pipelines/**/*.py" --goal "Prioritize the messiest Python data pipelines" --json']})});var p6,h6=y(()=>{"use strict";_();ce();p6=q({name:"create",summary:"Create and register an atom through the provisioning facade.",options:[z,{flag:"--bucket",value:"bucket",summary:"Atom bucket segment (for example: CORE, FIXTURE)."},{flag:"--title",value:"title",summary:"Human-readable atom title."},{flag:"--description",value:"text",summary:"Atom description."},{flag:"--logical-name",value:"name",summary:"Optional logical name override."},{flag:"--dry-run",summary:"Preview generated paths and IDs without writing files."},G,H,W],examples:['node atm.mjs create --bucket CORE --title NormalizeCssColor --description "Canonicalize CSS color input." --dry-run']})});var g6,k6=y(()=>{"use strict";_();ce();g6=q({name:"atm-chart",summary:"Render or verify ATMChart markdown from ATM guard sources.",positional:[{name:"action",summary:"render | verify",required:!1}],options:[z,{flag:"--out",value:"path",summary:"Override ATMChart markdown output path (default: .atm/memory/atm-chart.md)."},{flag:"--version-check",summary:"Also verify ATMChart/framework/template compatibility against the bundled release train matrix."},G,H,W],examples:["node atm.mjs atm-chart render --cwd .","node atm.mjs atm-chart verify --cwd ."]})});var y6,I6=y(()=>{"use strict";_();ce();y6=q({name:"create-map",summary:"Create and register an atomic map through the provisioning facade.",options:[z,{flag:"--map-version",value:"semver",summary:"Map version, defaults to 0.1.0."},{flag:"--spec",value:"path",summary:"Create from an existing atm.atomicMap document instead of inline JSON members/entrypoints/quality-targets input."},{flag:"--from-plan",value:"path",summary:"Create from an atm.decompositionPlan document."},{flag:"--members",value:"json",summary:"JSON member list."},{flag:"--edges",value:"json",summary:"JSON dependency edge list."},{flag:"--entrypoints",value:"json",summary:"JSON entrypoint list."},{flag:"--quality-targets",value:"json",summary:"JSON quality targets object."},{flag:"--dry-run",summary:"Preview generated paths and IDs without writing files."},G,H,W],examples:['node atm.mjs create-map --members "[{\\"atomId\\":\\"ATM-CORE-0001\\",\\"version\\":\\"1.0.0\\"}]" --entrypoints "[\\"ATM-CORE-0001\\"]" --quality-targets "{\\"latency\\":\\"p95<100ms\\"}" --dry-run',"node atm.mjs create-map --spec samples/checkout-mini.map.json --json","node atm.mjs create-map --from-plan samples/checkout-mini.plan.json --json"]})});var v6,w6=y(()=>{"use strict";_();ce();v6=q({name:"daemon",summary:"Manage the advisory ATM background watcher daemon.",positional:[{name:"action",summary:"enable | disable | start | stop | status | log",required:!1}],options:[{flag:"--tail",value:"count",summary:"Number of notifications to include for `daemon log`."},{flag:"--actor",value:"id",summary:"Actor id recorded when enabling the daemon."},G,H,W],examples:["node atm.mjs daemon enable --actor codex-main --json","node atm.mjs daemon start --json","node atm.mjs daemon status --json","node atm.mjs daemon log --tail 20 --json"]})});var S6,A6=y(()=>{"use strict";_();ce();S6=q({name:"doctor",summary:"Inspect ATM engineering readiness and trust signals.",options:[z,{flag:"--ci-profile",value:"profile",summary:"CI-specific doctor policy profile. Supported: dependency-pr."},{flag:"--skip-check",value:"check",repeatable:!0,summary:"Skip an explicit doctor check. Supported: git-head-evidence."},G,H,W],examples:["node atm.mjs doctor --json","node atm.mjs doctor --ci-profile dependency-pr --json"]})});var b6,T6=y(()=>{"use strict";_();ce();b6=q({name:"emergency",summary:"Manage short-lived human-approved emergency maintenance leases for protected backend surfaces. Normal operators should use taskflow open/close; emergency approvals are for repair-only backend use.",positional:[{name:"action",summary:"approve | show | revoke | permissions | audit",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Task id the emergency lease is limited to."},{flag:"--actor",value:"id",summary:"Actor id allowed to consume the lease."},{flag:"--approved-by",value:"id",summary:"Human approver label. Defaults to human."},{flag:"--permission",value:"id",summary:"Permission id from emergency permissions."},{flag:"--approval-text",value:"text",summary:"Human approval sentence authorizing this emergency lane use."},{flag:"--reason",value:"text",summary:"Why normal taskflow open/close cannot be used."},{flag:"--lease",value:"id",summary:"Lease id for show/revoke."},{flag:"--emergency-approval",value:"id",summary:"Alias for --lease when inspecting an approval."},{flag:"--surface",value:"name",summary:"Optional protected surface label."},{flag:"--allowed-flag",value:"flag",summary:"Repeatable flag that this lease explicitly allows, such as --waiver-out-of-scope-delivery.",repeatable:!0},{flag:"--ttl-minutes",value:"number",summary:"Lease lifetime in minutes."},{flag:"--max-uses",value:"number",summary:"Maximum number of protected backend uses allowed by this lease."},G,H,W],examples:["node atm.mjs emergency permissions --json",'node atm.mjs emergency approve --task TASK-CID-0043 --actor 007 --permission backend.tasks.reconcile --approval-text "Human approved TASK-CID-0043 reconcile" --reason "Historical closeback repair" --json',"node atm.mjs emergency show --lease EMG-TASK-CID-0043-abc123 --json","node atm.mjs emergency audit --task TASK-MAO-0037 --json","node atm.mjs emergency revoke --lease EMG-TASK-CID-0043-abc123 --actor captain --json"]})});var C6,R6=y(()=>{"use strict";_();ce();C6=q({name:"experience",summary:"Extract reviewable learning artifacts from ATM evidence.",positional:[{name:"action",summary:"Currently supports: extract",required:!0}],options:[z,{flag:"--from-task",value:"id",summary:"Override source task id from the input evidence."},{flag:"--input",value:"path",summary:"Experience extraction input JSON path."},{flag:"--out",value:"path",summary:"Write the skill candidate JSON artifact."},{flag:"--advisory-out",value:"path",summary:"Write the review advisory JSON artifact."},{flag:"--queue",value:"path",summary:"Append the generated proposal to a human-review queue."},{flag:"--projection",value:"path",summary:"Write a Markdown projection for the human-review queue."},{flag:"--by",value:"actor",summary:"Actor label for behavior execution evidence."},G,H,W],examples:["node atm.mjs experience extract --input fixtures/experience-loop/task-evidence.json --json","node atm.mjs experience extract --input evidence.json --out .atm/history/artifacts/skill-candidate.json --json"]})});var x6,E6=y(()=>{"use strict";_();ce();x6=q({name:"health-report",summary:"Generate a map health report and highlight high-risk atoms or bottlenecks.",options:[z,{flag:"--map",value:"id",summary:"Map id to inspect."},G,H,W],examples:["node atm.mjs health-report --map ATM-MAP-0001 --json"]})});var _6,P6=y(()=>{"use strict";_();ce();_6=q({name:"identity",summary:"Manage per-actor runtime git identity profiles, inspect hints, and clear stale repo-default identities before agent handoff.",positional:[{name:"action",summary:"set | show | status | clear",required:!0}],options:[z,{flag:"--actor",value:"id",summary:"Actor id for the per-actor identity profile; omit on set to update repo default.json."},{flag:"--name",value:"text",summary:"Optional display name; when combined with --kind, also updates actor registry."},{flag:"--kind",value:"kind",summary:"Optional actor kind: human | ai-agent | automation."},{flag:"--provider",value:"text",summary:"Optional provider label for registry/default identity."},{flag:"--editor",value:"text",summary:"Optional editor/host label for registry/default identity."},{flag:"--git-name",value:"text",summary:"Preferred git author name for this actor."},{flag:"--git-email",value:"text",summary:"Preferred git author email for this actor."},{flag:"--contact",value:"text",summary:"Optional owner/contact for registry update."},{flag:"--capabilities",value:"csv",summary:"Optional capability tags for registry update."},{flag:"--active-session",value:"session-id",summary:"Override the active session hint stored with the default identity."},G,H,W],examples:['node atm.mjs identity set --actor codex-main --git-name "codex-main" --git-email codex-main@atm.local --editor codex --json','node atm.mjs identity set --git-name "solo-user" --git-email solo-user@example.local --json',"node atm.mjs identity clear --json","node atm.mjs identity clear --actor codex-main --json","node atm.mjs identity status --json","node atm.mjs identity show --actor codex-main --json","node atm.mjs identity show --json"]})});var M6,O6=y(()=>{"use strict";_();ce();M6=q({name:"orient",summary:"Inspect a repository and emit an ATM guidance orientation report.",options:[z,{flag:"--full",summary:"Include the complete test/validation entrypoint inventory; the default orientation keeps a compact summary."},G,H,W],examples:["node atm.mjs orient --cwd . --json","node atm.mjs orient --cwd . --full --json"]})});var D6,F6=y(()=>{"use strict";_();ce();D6=q({name:"plan",summary:"Manage registered planning families and create plan documents or task cards through the tool-first lane.",positional:[{name:"area",summary:"series | doc | card",required:!0},{name:"action",summary:"register | create",required:!0}],options:[z,{flag:"--planning-root",value:"path",summary:"Planning base directory. Defaults to ATM_PLANNING_ROOT, ATM_PLANNING_REPO_ROOT, or configured planning roots."},{flag:"--series",value:"key",summary:"Short series key such as ERR, TMP, RFT, or GOV."},{flag:"--prefix",value:"task-prefix",summary:"Task id prefix. Bare ERR becomes TASK-ERR; ATM-GOV is preserved."},{flag:"--family-dir",value:"dir",summary:"Family directory under the planning root."},{flag:"--plan",value:"path",summary:"Plan document path relative to the planning root."},{flag:"--title",value:"text",summary:"Title for a new plan document or task card."},{flag:"--doc-name",value:"file.md",summary:"File name for plan doc create. Defaults to a title slug."},{flag:"--task-id",value:"id",summary:"Explicit task id for card create. Defaults to the next id in the registered family tasks directory."},{flag:"--output",value:"path",summary:"Explicit task-card output path relative to the planning root."},{flag:"--owner-approved",summary:"Required for series register writes; records project-owner approval."},{flag:"--approved-by",value:"id",summary:"Approval identity recorded in the series registry. Defaults to owner."},{flag:"--status",value:"active|reserved|archived",summary:"Series registry status. Defaults to active."},{flag:"--target-repo",value:"repo",summary:"Target repo recorded in generated task cards."},{flag:"--closure-authority",value:"mode",summary:"Closure authority recorded in generated task cards."},{flag:"--dry-run",summary:"Preview the registry, plan, or card change without writing."},{flag:"--write",summary:"Write the registry, plan, or card artifact."},G,H,W],examples:['node atm.mjs plan doc create --planning-root C:/repo/docs/ai_atomic_framework --family-dir error-governance --title "ATM Error Governance" --doc-name error-governance-plan.md --write --json',"node atm.mjs plan series register --planning-root C:/repo/docs/ai_atomic_framework --series ERR --prefix TASK-ERR --family-dir error-governance --plan error-governance/error-governance-plan.md --owner-approved --write --json",'node atm.mjs plan card create --planning-root C:/repo/docs/ai_atomic_framework --series ERR --title "Error registry migration plan" --write --json'],help:{audience:"agent",requiredFlagSets:[{when:"Registering a new family",flags:["series register","--prefix","--family-dir","--plan","--owner-approved","--write"]},{when:"Creating a plan document before registration",flags:["doc create","--family-dir","--title","--write"]},{when:"Creating a task card",flags:["card create","--series","--title","--write"]}],relatedCommands:["node atm.mjs tasks import --from <generated-card.task.md> --dry-run --json","node atm.mjs integration add codex --json"],commonMistakes:["Writing a new docs/ai_atomic_framework/<family>/tasks/*.task.md file by hand instead of using plan card create.","Registering a prefix before the owner-approved plan document exists.","Inferring the next task id from target .atm/history instead of the planning family tasks directory."],playbookNotes:["Skills should call this CLI for planning family and card creation, then report structured CLI errors instead of bypassing the tool.","ErrorCode registry files remain under docs/governance until a governed ERR-family migration updates registry readers, generators, tests, and emitters together."]}})});var j6,$6=y(()=>{"use strict";_();ce();j6=q({name:"map-capsule",summary:"Export, import, or roll back map capsules backed by the map capsule registry.",positional:[{name:"action",summary:"export | import | rollback",required:!0}],options:[z,{flag:"--map",value:"id",summary:"Map id to export."},{flag:"--cid",value:"cid",summary:"Map capsule content id for import or rollback."},{flag:"--payload",value:"base64",summary:"Compressed map capsule payload for import."},{flag:"--no-vendor",summary:"Skip vendoring the imported map bundle into the repository vendor directory."},{flag:"--previous-cid",value:"cid",summary:"Previous map capsule cid to link when exporting a new revision."},{flag:"--exported-by",value:"id",summary:"Actor or tool id recorded for the export event."},{flag:"--name",value:"text",summary:"Human-readable name recorded in the map capsule registry."},G,H,W],examples:["node atm.mjs map-capsule export --map ATM-MAP-0001 --json","node atm.mjs map-capsule import --cid map:cid:abc123 --payload <base64> --json","node atm.mjs map-capsule rollback --cid map:cid:abc123 --json"]})});var L6,N6=y(()=>{"use strict";_();ce();L6=q({name:"police",summary:"Run the ATM police family gate and emit a PoliceFamilyGateReport.",positional:[{name:"action",summary:"Currently supports: run",required:!1}],options:[z,{flag:"--profile",value:"standard|full",summary:"Police family profile to run (default: standard)."},{flag:"--registry",value:"path",summary:"Registry document path for Dedup Police (default: atomic-registry.json)."},{flag:"--out",value:"path",summary:"Optional JSON report output path. Defaults to stdout evidence only."},G,H,W],examples:["node atm.mjs police run --profile standard --json","node atm.mjs police run --profile full --out .atm/history/reports/police-family-gate.json --json"]})});var B6,q6=y(()=>{"use strict";_();ce();B6=q({name:"quickfix",summary:"Manage the lightweight ATM quickfix runtime lock.",options:[z,{flag:"--actor",value:"id",summary:"Actor id used for claim or release actions."},{flag:"--prompt",value:"text",summary:"Prompt text used to infer quickfix scope during claim."},{flag:"--files",value:"csv",summary:"Optional comma-separated path scope for the quickfix lock."},{flag:"--reason",value:"text",summary:"Optional human-readable reason for the quickfix lock."},G,H,W],examples:["node atm.mjs quickfix status --json",'node atm.mjs quickfix claim --actor codex-main --prompt "fix tsconfig.json typo" --json',"node atm.mjs quickfix release --actor codex-main --json"]})});var G6,H6=y(()=>{"use strict";_();ce();G6=q({name:"residue",summary:"Inspect or reconcile ATM-managed worktree residue across tasks.",positional:[{name:"action",summary:"status | reconcile",required:!1}],options:[{flag:"--apply",summary:"For residue reconcile, remove only owner-aware safe disposable residue. Omit for dry-run."},z,G,H,W],examples:["node atm.mjs residue status --json","node atm.mjs residue reconcile --json","node atm.mjs residue reconcile --apply --json"],help:{audience:"operator",requiredFlagSets:[],relatedCommands:["node atm.mjs status --json","node atm.mjs tasks status --task TASK-ABC-0001 --residue --json"],commonMistakes:["Deleting .atm/history or .atm/runtime files directly before checking whether an active owner still holds them."],playbookNotes:["residue status is read-only. It classifies active-owner, auto-clean-safe, block-and-reconcile, and manual-review buckets so a reconciler can act safely.","residue reconcile is dry-run by default. --apply removes only non-staged, non-active-owner, disposable residue such as runtime push attempts or abandoned-task artifacts.","Each entry reports indexState/sharedIndexRisk plus governance-lock or close-commit-window owner metadata so staged residue can be triaged without raw git inspection."]}})});var W6,U6=y(()=>{"use strict";_();ce();W6=q({name:"rescue",summary:"Run rescue-family diagnostics and disaster-recovery operations for corrupted ATM state.",positional:[{name:"action",summary:"police | diagnose | rebuild-registry | reload-atoms | closure-packet | rebuild-maps | replay-lineage | clear-cache | factory-reset",required:!1}],options:[{flag:"--cwd",value:"path",summary:"Run rescue against a specific repository root."},{flag:"--dry-run",summary:"Report planned recovery steps without mutating state."},{flag:"--confirm",summary:"Allow destructive rescue actions to execute instead of staying in dry-run mode."},{flag:"--i-understand-this-deletes-state",summary:"Required acknowledgement for factory-reset execution."},{flag:"--map",value:"id",summary:"Map id required by replay-lineage."},{flag:"--task",value:"id",summary:"Task id required by closure-packet."},{flag:"--amend",summary:"For closure-packet, explicitly request HEAD rewrite after staging the repaired packet. ATM fails safely when no amend-capable governed wrapper is available."},{flag:"--no-amend",summary:"Compatibility alias for the default stage-only closure-packet flow."},G,H,W],examples:["node atm.mjs rescue police --json","node atm.mjs rescue diagnose --json","node atm.mjs rescue closure-packet --task TASK-AAO-0102 --json","node atm.mjs rescue rebuild-registry --dry-run --json","node atm.mjs rescue replay-lineage --map ATM-MAP-0001 --confirm --json"]})});var V6,z6=y(()=>{"use strict";_();ce();V6=q({name:"start",summary:"Start an ATM guidance session for a concrete goal.",options:[z,{flag:"--goal",value:"text",summary:"Goal the agent is trying to accomplish."},{flag:"--actor",value:"name",summary:"Optional actor label for session audit."},{flag:"--target-file",value:"path",summary:"Path (relative to --cwd) to a legacy source file to analyze and build a LegacyRoutePlan from."},{flag:"--release-blocker",value:"symbols",summary:"Comma-separated function names that are release blockers (used with --target-file or --legacy-flow)."},{flag:"--shadow",summary:"Mark the session as shadow mode: dry-run only, no host legacy file writes."},{flag:"--legacy-flow",summary:"Force legacy route flow; build a LegacyRoutePlan from --target-file or the first config hotspot declared in .atm/config.json."},G,H,W],examples:['node atm.mjs start --cwd . --goal "Extract legacy helper" --json','node atm.mjs start --cwd . --goal "Atomize leaf helper" --target-file src/utils.ts --release-blocker "processRequest" --legacy-flow --json']})});var K6,J6=y(()=>{"use strict";_();ce();K6=q({name:"explain",summary:"Explain guidance blocks and the evidence needed to proceed.",options:[z,{flag:"--why",value:"reason",summary:"Currently supports: blocked."},{flag:"--session",value:"id",summary:"Guidance session id; defaults to the active session."},G,H,W],examples:["node atm.mjs explain --why blocked --json","node atm.mjs explain --why blocked --session <session-id> --json"]})});var Y6,Q6=y(()=>{"use strict";_();ce();Y6=q({name:"evidence",summary:"Run validators as governed evidence, add raw/manual evidence for close/commit/PR gates, author diagnostic-loop receipts, author historical-batch envelopes that feed taskflow close, or finalize diagnostic historical-batch slices. Successful fresh evidence updates the per-task bundle manifest at .atm/history/evidence/<taskId>.bundle-manifest.json.",positional:[{name:"action",summary:"add | run | git-head-backfill | verify | diff | validators | missing | diagnose | historical-batch | historical-batch-finalize | wave-exit-observer",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Task id to append or verify evidence."},{flag:"--actor",value:"id",summary:"Actor id for evidence run/add (or set ATM_ACTOR_ID)."},{flag:"--kind",value:"type",summary:"Evidence kind for raw evidence add or evidence run: test|artifact|attestation|review|commit|waiver."},{flag:"--summary",value:"text",summary:"Optional short evidence summary."},{flag:"--artifacts",value:"csv",summary:"Optional artifact path list recorded with the evidence."},{flag:"--freshness",value:"type",summary:"Raw evidence add freshness: fresh|historical-reference|draft (default: fresh)."},{flag:"--validators",value:"csv",summary:"Optional validator override. Omit when the command matches a known gate or a task-card declared validator; evidence run will auto-link it."},{flag:"--command",value:"text",summary:"Command to run/capture. With evidence add this is raw metadata and also requires exit code plus sha256 outputs."},{flag:"--command-runs",value:"json-file",summary:"Raw evidence add only: append commandRuns from a JSON array or {commandRuns:[]} cache file."},{flag:"--symptom",value:"text",summary:"Diagnostic-loop only: exact observed symptom that the reproducer must trigger."},{flag:"--reproducer-command",value:"text",summary:"Diagnostic-loop only: command that reproduces the declared symptom."},{flag:"--symptom-observed",summary:"Diagnostic-loop only: assert the reproducer observed the declared symptom."},{flag:"--reproduction-rate",value:"0..1",summary:"Diagnostic-loop only: observed reproduction rate for the minimized fixture."},{flag:"--minimized-fixture",value:"path-or-id",summary:"Diagnostic-loop only: minimized fixture path or stable fixture id."},{flag:"--hypothesis",value:"id|summary|prediction|command|matched",summary:"Diagnostic-loop only: repeatable falsifiable hypothesis and one-variable experiment result."},{flag:"--winning-hypothesis",value:"id",summary:"Diagnostic-loop only: hypothesis id whose experiment matched."},{flag:"--regression-case-id",value:"id",summary:"Diagnostic-loop only: regression test case id added or selected for the repair."},{flag:"--exit",value:"EXIT-NN",summary:"wave-exit-observer only: sealed EXIT id from the observer policy. The writer selects the command; callers cannot pass a command."},{flag:"--observer-role",value:"role",summary:"wave-exit-observer only: sealed observer role such as wave-exit-observer.gemini or wave-exit-observer.claude."},{flag:"--basis-owners",value:"csv",summary:"wave-exit-observer only: evidence owner task ids used to derive the basis producer actor. Not an actor override."},{flag:"--declared-basis-actor",value:"id",summary:"wave-exit-observer only: optional cross-check against the derived basis actor. Mismatch fails closed."},{flag:"--exit-code",value:"number",summary:"Raw evidence add only: exit code paired with --command evidence. Forbidden for wave-exit-observer."},{flag:"--stdout-sha256",value:"sha256",summary:"Raw evidence add only: stdout digest paired with --command evidence."},{flag:"--stderr-sha256",value:"sha256",summary:"Raw evidence add only: stderr digest paired with --command evidence."},{flag:"--runner-kind",value:"kind",summary:"Runner kind for command proof: dev-source|frozen-runner|external."},{flag:"--source-commit",value:"sha",summary:"Source commit paired with dev-source command proof."},{flag:"--reason",value:"text",summary:"Optional rationale for git-head-backfill."},{flag:"--gate",value:"type",summary:"Evidence gate for verify: close|commit|pr."},{flag:"--list",summary:"List all required validators with tier and current evidence state (used with validators action)."},{flag:"--recent-run",summary:"Use the most recent cached command run if available in the task evidence (used with run action)."},{flag:"--tasks",value:"csv",summary:"Task ids to slice into per-task historical-batch close-readiness evidence."},{flag:"--commits",value:"csv",summary:"Delivery commit refs that historical-batch will inspect and match back to the listed tasks."},{flag:"--delivery-repo",value:"path",summary:"Repository that contains the historical delivery commits matched into the historical-batch envelope."},{flag:"--validator-command",value:"text",summary:"Validator command to run once for a historical batch; repeatable. The resulting passes are shared into task slices for later close-readiness checks."},{flag:"--write",summary:"Write the historical-batch envelope plus per-task slices that tasks close / taskflow close can consume later."},{flag:"--dry-run",summary:"Preview historical-batch matching and close-readiness evidence without writing."},{flag:"--allow-unmatched",summary:"Allow diagnostic historical batches even when some tasks have no scoped commit match."},{flag:"--approved-by",value:"actor",summary:"Required with --allow-unmatched: approver for diagnostic-only historical batch evidence."},{flag:"--approval-reason",value:"text",summary:"Required with --allow-unmatched: justification for recording unmatched historical batch diagnostics."},{flag:"--batch",value:"id-or-path",summary:"Historical-batch-finalize only: batch id or envelope path for the diagnostic slice disposition."},{flag:"--disposition",value:"type",summary:"Historical-batch-finalize only: keep-diagnostic|abandon|remove-evidence for non-close-ready task slices."},G,H,W],examples:['node atm.mjs evidence run --task ATM-GOV-0104 --actor codex-main --command "npm run typecheck" --json','node atm.mjs evidence run --task ATM-GOV-0104 --actor codex-main --command "npm run validate:cli" --validators validate:cli --recent-run --json','node atm.mjs evidence run --task TASK-TEAM-0014 --actor codex-main --command "node atm.mjs team patrol --task TASK-TEAM-0014 --json" --json','node atm.mjs evidence add --task ATM-GOV-0104 --actor codex-main --kind test --summary "raw artifact evidence" --artifacts reports/governance.json --json','node atm.mjs evidence add --task ATM-GOV-0104 --actor codex-main --kind test --freshness fresh --command "npm run typecheck" --exit-code 0 --stdout-sha256 sha256:1111111111111111111111111111111111111111111111111111111111111111 --stderr-sha256 sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 --validators typecheck --json','node atm.mjs evidence git-head-backfill --actor codex-main --reason "Backfill evidence for a pre-ATM HEAD commit" --json',"node atm.mjs evidence verify --task ATM-GOV-0104 --gate close --json","node atm.mjs evidence validators --list --task ATM-GOV-0104 --json","node atm.mjs evidence missing --task ATM-GOV-0104 --actor Augment --json",'node atm.mjs evidence diagnose --task ATM-GOV-0104 --actor codex-main --symptom "claim writes reserve before seal check" --reproducer-command "node atm.mjs next --claim ..." --symptom-observed --reproduction-rate 1 --minimized-fixture tests/fixtures/claim-seal --candidate-digest sha256:1111111111111111111111111111111111111111111111111111111111111111 --environment-digest sha256:2222222222222222222222222222222222222222222222222222222222222222 --hypothesis "h1|seal runs too late|ledger mutates before seal failure|node --strip-types tests/cli/claim-atomicity.test.ts|matched" --winning-hypothesis h1 --regression-case-id test_claim_atomicity --green-command "node --strip-types tests/cli/claim-atomicity.test.ts" --green-exit-code 0 --green-stdout-sha256 sha256:3333333333333333333333333333333333333333333333333333333333333333 --green-stderr-sha256 sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 --write --json','node atm.mjs evidence historical-batch --tasks TASK-A,TASK-B --commits abc123,def456 --actor codex-main --validator-command "npm run validate:cli" --dry-run --json','node atm.mjs evidence historical-batch --tasks TASK-A,TASK-B --commits abc123,def456 --actor codex-main --validators typecheck --validator-command "npm run typecheck" --write --json','node atm.mjs evidence historical-batch --tasks TASK-A,TASK-B --commits abc123 --actor codex-main --validator-command "npm test" --allow-unmatched --approved-by captain --approval-reason "diagnostic backfill" --write --json','node atm.mjs evidence historical-batch-finalize --task TASK-B --batch hist-batch-2026-06-16T01-40-43-634Z --actor codex-main --disposition keep-diagnostic --reason "partial slice kept for audit only" --write --json',"node atm.mjs evidence wave-exit-observer --exit EXIT-02 --actor gemini-wave-exit-observer --observer-role wave-exit-observer.gemini --basis-owners ATM-GOV-0341 --json","node atm.mjs evidence wave-exit-observer --exit EXIT-04 --actor claude-wave-exit-observer --observer-role wave-exit-observer.claude --basis-owners ATM-GOV-0341 --json"],help:{audience:"agent",requiredFlagSets:[{when:"Recording governed evidence for one task",flags:["--task","--actor"]},{when:"Running a command-backed validator",flags:["run","--command"]},{when:"Writing a diagnostic historical batch with unmatched tasks",flags:["--allow-unmatched","--approved-by","--approval-reason"]},{when:"Finalizing a diagnostic historical-batch slice",flags:["historical-batch-finalize","--task","--batch","--actor","--disposition","--reason"]},{when:"Writing a sealed wave-exit observer receipt",flags:["wave-exit-observer","--exit","--actor","--observer-role","--basis-owners"]}],relatedCommands:["node atm.mjs evidence validators --list --task TASK-ABC-0001 --json","node atm.mjs taskflow pre-close --task TASK-ABC-0001 --actor <actor-id> --json","node atm.mjs tasks status --task TASK-ABC-0001 --residue --json"],commonMistakes:["Manually typing validator names when evidence run can auto-link a declared validator from the command.","Using raw evidence add as a substitute for fresh command-backed validation when the task requires validators.","Writing historical-batch evidence without checking whether the matched commits actually cover the task deliverables.","Trying to use historical-batch-finalize on a close-ready slice; close-ready slices must go through taskflow close.","Treating git-head-backfill as a protected-push requirement instead of a repair/diagnostic tool for legacy HEAD evidence.","Hand-writing docs/reports/wave-exit-observer-receipts/<EXIT-id>.json or passing --command/--artifact-path to invent an observer receipt."],playbookNotes:["evidence validators --list is the fastest way to see what a task still needs before closeout.","Use --recent-run when a matching cached command run already exists and you only need to re-link it into the current evidence update.","Use historical-batch-finalize to explicitly keep, abandon, or remove diagnostic-only historical-batch residue without changing task lifecycle state.","git-head-backfill is retained for repair and audit trails; same-commit governed provenance should normally come from node atm.mjs git commit instead of a follow-up backfill.","evidence wave-exit-observer is the only official writer for canonical wave-exit observer receipts. It never writes certificates, completion evidence, or release verdicts."]}})});var X6,Z6=y(()=>{"use strict";_();ce();X6=q({name:"framework-mode",summary:"Inspect, claim, or release ATM framework-development hard gates for critical source changes, including staged residue warnings and same-actor stale temp-claim auto-reconcile.",positional:[{name:"action",summary:"status | claim | release",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path to inspect."},{flag:"--files",value:"csv",summary:"Optional comma-separated declared change scope instead of git diff."},{flag:"--files-from",value:"path",summary:"Newline-separated declared change scope. Each line is one path and is normalized like one --files field, so the list does not pass through a single argv string."},{flag:"--target-repo",value:"path",summary:"Optional cross-repo target repository path."},{flag:"--actor",value:"id",summary:"Actor id for temporary framework-development claim/release."},{flag:"--task",value:"id",summary:"Explicit active governed task to bind to a temporary framework claim; required when the actor has ambiguous active lanes."},{flag:"--reason",value:"text",summary:"Reason for temporary framework-development claim."},G,H,W],examples:["node atm.mjs framework-mode status --json","node atm.mjs framework-mode status --files packages/core/src/index.ts --json","node atm.mjs framework-mode status --target-repo ../AI-Atomic-Framework --json",'node atm.mjs framework-mode claim --actor codex-main --task ATM-GOV-0001 --files packages/cli/src/commands/next.ts --reason "temporary framework maintenance" --json','node atm.mjs framework-mode claim --actor ci --files-from /tmp/changed-files.txt --reason "CI preflight framework-development claim" --json',"node atm.mjs framework-mode release --actor codex-main --json"]})});var e5,t5=y(()=>{"use strict";_();ce();e5=q({name:"guard",summary:"Run governance guards for encoding, mutation scope, git metadata, framework development, and commit ranges.",positional:[{name:"guard-name",summary:"encoding | mutation | git | atom-callsite-readability | framework-development | commit-range",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path for atom-callsite-readability guard."},{flag:"--task",value:"id",summary:"Task id for mutation or git guard checks."},{flag:"--actor",value:"id",summary:"Actor id for mutation or git guard checks."},{flag:"--files",value:"csv",summary:"Comma-separated file paths for the guard or declared framework scope."},{flag:"--files-from",value:"path",summary:"Newline-separated file paths for the guard or declared framework scope. Same per-path normalization as --files."},{flag:"--base",value:"ref",summary:"Base ref for commit-range guard."},{flag:"--head",value:"ref",summary:"Head ref for commit-range guard."},{flag:"--fail-open",summary:"Return ok=true with warnings when violations are detected."},G,H,W],examples:["node atm.mjs guard encoding --files README.md,package.json --json","node atm.mjs guard mutation --task ATM-GOV-0106 --actor codex-main --files packages/cli/src/commands/guard.ts --json","node atm.mjs guard git --task ATM-GOV-0106 --actor codex-main --json","node atm.mjs guard atom-callsite-readability --repo . --json","node atm.mjs guard framework-development --files packages/core/src/index.ts --json","node atm.mjs guard commit-range --base origin/main --head HEAD --json"]})});var r5,o5=y(()=>{"use strict";_();ce();r5=q({name:"git",summary:"Prepare actor git identity, evaluate pre-push git admission, recover from rejected push attempts or a human-confirmed stale index lock, create governed commits with actor-scoped author env vars, create narrow record-only commits for low-risk .atm/history maintenance, verify ATM git-governance trailers, resolve task-scoped commit bundles, query the status of the last governed commit attempt plus live branch queue and stuck stdin pathspec staging diagnostics, and return copyable fallback plus host-git compatibility guidance when the wrapper cannot complete.",positional:[{name:"action",summary:"prepare | admit | push | recover-push-fail | recover-index-lock | reconcile-live-index | check | commit | record-commit | commit-status | attest",required:!0}],options:[z,{flag:"--actor",value:"id",summary:"Actor id used for git identity and trailer checks."},{flag:"--task",value:"id",summary:"Optional task id to enforce owner/claim/trailer consistency."},{flag:"--branch",value:"name",summary:"Branch name for git admit/push; defaults to the current HEAD branch."},{flag:"--remote",value:"name",summary:"Remote name for git admit/push; defaults to origin."},{flag:"--no-fetch",summary:"For git admit/push: do not fetch the remote branch before diffing."},{flag:"--dry-run",summary:"For git push: run admission and write push-attempt evidence without executing host git push."},{flag:"--branch",value:"name",summary:"Branch name for git recover-push-fail; defaults to the current HEAD branch."},{flag:"--remote",value:"name",summary:"Remote name for git recover-push-fail; defaults to origin."},{flag:"--steward-plan",summary:"For git admit composer-routed cases: emit a neutral steward dry-run merge plan without mutating files."},{flag:"--apply-to-working-tree",summary:"For git admit composer-routed cases: explicitly apply the steward merge result to scoped working-tree files without creating a commit."},{flag:"--name",value:"text",summary:"Override git author name for prepare/commit; with --email, also seeds the actor runtime identity profile during prepare."},{flag:"--email",value:"text",summary:"Override git author email for prepare/commit; with --name, also seeds the actor runtime identity profile during prepare."},{flag:"--session",value:"session-id",summary:"Optional ATM work session id for check/commit alignment."},{flag:"--message",value:"text",summary:"Commit summary for git commit; ATM appends governed trailers automatically."},{flag:"--trailer",value:"text",summary:"Repeatable extra trailer line for git commit (e.g. an editor-injected Co-authored-by line); folded into the governed trailer set instead of failing the commit."},{flag:"--auto-stage",summary:"Stage only the current task allowed delivery bundle with explicit git add -- <paths>; never use stdin pathspec staging, and report skipped external dirty files without using git add ."},{flag:"--delivery-slice-manifest",value:"path",summary:"Optional verified publication delivery-slice manifest. Restricts --auto-stage to outputInventory \u2229 current dirty plus receipt-derived required records; same-task certificate/closeout dirt is not absorbed."},{flag:"--delivery-slice-receipt",value:"path",summary:"Derive the publication delivery slice directly from the current task canonical published runner-sync receipt; mutually exclusive with --delivery-slice-manifest."},{flag:"--defer-foreign-staged",summary:"Snapshot and unstage foreign task governance files already in the index before resolving the bundle; never silent."},{flag:"--dry-run",summary:"Resolve the task-scoped commit bundle without staging or committing; for record-commit, validate the staged record-only scope without mutating HEAD."},{flag:"--no-verify",summary:"Emergency-only pass-through to git commit; requires --emergency-approval with backend.gitHookBypass permission and cannot override Team Broker conflicts by itself."},{flag:"--wip",summary:"For git commit: commit staged files with non-delivery ATM-WIP trailers and bypass full repository-wide typecheck."},{flag:"--emergency-approval",value:"leaseId",summary:"Required when --no-verify is used; must authorize backend.gitHookBypass."},{flag:"--write",summary:"For git reconcile-live-index: apply proven parent-blob residue after a dry-run; omitted or combined with --dry-run never mutates the index."},{flag:"--broker-conflict-override",value:"leaseId",summary:"High-authority override for Team Broker cross-task conflicts; must authorize backend.brokerConflictOverride and be paired with --broker-conflict-resolution."},{flag:"--broker-conflict-resolution",value:"path",summary:"Paper-style Team Broker conflict-resolution artifact proving conflict task id, shared paths, resolution order, and validator plan."},{flag:"--reason",value:"text",summary:"Human-readable reason for the governed hook bypass when using --no-verify."},{flag:"--no-trailers",summary:"Skip trailer checks in git check (identity/owner checks still run)."},{flag:"--timeout-ms",value:"ms",summary:"For git commit: override the default 420000ms timeout for the underlying git commit spawn (also settable via ATM_GIT_COMMIT_TIMEOUT_MS); a hung pre-commit hook fails as a retryable timeout instead of hanging forever. Commit also fails fast when a git add --pathspec-from-file=- helper is already waiting on stdin."},{flag:"--commit",value:"sha",summary:"For git attest: immutable historical commit to cover with a forward attestation. For git reconcile-live-index: the already-successful commit whose parent-tree residue may still occupy the live index."},{flag:"--lane",value:"lane-id",summary:"For git attest: lane/session id that reviewed and produced the forward attestation."},{flag:"--provenance-kind",value:"ticket|emergency",summary:"For git attest: provenance class for the forward attestation."},{flag:"--provenance-ref",value:"ref",summary:"For git attest: immutable evidence file or git:<sha> commit message used as provenance."},{flag:"--provenance-digest",value:"sha256:<digest>",summary:"For git attest: digest of the provenance reference."},{flag:"--reason",value:"text",summary:"For git attest emergency writes: human-readable reason for the forward attestation."},{flag:"--emergency-class",value:"class",summary:"For git attest emergency writes: emergency class such as runner-sync-publication or protected-push-recovery."},{flag:"--scope",value:"path",summary:"For git attest emergency writes: repeatable or comma-separated path scope covered by the attestation."},{flag:"--evidence-ref",value:"ref",summary:"For git attest emergency writes: repeatable or comma-separated supporting evidence reference."},{flag:"--status",summary:"For git attest: inspect the append-only attestation ledger without writing."},{flag:"--validate",summary:"For git attest: validate existing attestation ledger records without writing."},G,H,W],examples:["node atm.mjs git prepare --task ATM-GOV-0105 --actor codex-main --json",'node atm.mjs git prepare --actor codex-main --name "Codex Main" --email codex-main@atm.local --json',"node atm.mjs git admit --actor codex-main --branch main --remote origin --json","node atm.mjs git push --actor codex-main --branch main --remote origin --dry-run --json","node atm.mjs git push --actor codex-main --branch main --remote origin --json","node atm.mjs git admit --actor codex-main --branch main --remote origin --steward-plan --json","node atm.mjs git admit --actor codex-main --branch main --remote origin --apply-to-working-tree --json","node atm.mjs git recover-push-fail --actor codex-main --branch main --remote origin --json",'node atm.mjs git recover-index-lock --task ATM-GOV-0105 --actor codex-main --force-index-lock-recovery --emergency-approval <lease-id> --reason "human-confirmed stale lock" --json',"node atm.mjs git reconcile-live-index --commit <sha> --dry-run --json","node atm.mjs git reconcile-live-index --commit <sha> --write --json","node atm.mjs git check --task ATM-GOV-0105 --actor codex-main --json","node atm.mjs git check --actor codex-main --json",'node atm.mjs git commit --actor codex-main --task TASK-AAO-0036 --message "atm: sync TASK-AAO-0036 ledger mirror" --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0063 --message "atm: restore TASK-AAO-0063 historical ledger packet" --json','node atm.mjs git commit --actor codex-main --task ATM-GOV-0105 --message "complete ATM-GOV-0105" --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0141 --message "feat: scoped deliverable" --auto-stage --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0141 --message "build(runner): record sealed runner publication outputs" --auto-stage --delivery-slice-manifest .atm/history/evidence/TASK-AAO-0141.delivery-slice.json --dry-run --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0141 --message "build(runner): record sealed runner publication outputs" --auto-stage --delivery-slice-receipt .atm/history/evidence/TASK-AAO-0141.runner-sync-receipt.json --dry-run --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0141 --message "feat: scoped deliverable" --dry-run --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0141 --message "feat: scoped deliverable" --auto-stage --timeout-ms 30000 --json','node atm.mjs git record-commit --actor codex-main --message "atm: sync imported task records" --dry-run --json','node atm.mjs git record-commit --actor codex-main --message "atm: sync imported task records" --json',"node atm.mjs git commit-status --actor codex-main --task TASK-AAO-0141 --json","node atm.mjs git attest --status --json","node atm.mjs git attest --validate --json",'node atm.mjs git attest --commit <sha> --task TASK-GIT-0024 --actor codex-main --lane <lane-id> --provenance-kind emergency --provenance-ref git:<sha> --provenance-digest sha256:<digest> --reason "<reason>" --emergency-class protected-push-recovery --scope packages/cli/src --evidence-ref git:<sha> --dry-run --json']})});var a5,n5=y(()=>{"use strict";_();ce();a5=q({name:"git-hooks",summary:"Install or verify ATM-managed Git hooks for framework-development hard gates.",positional:[{name:"action",summary:"install | verify",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path."},{flag:"--framework-required",summary:"Treat missing hooks as an error even outside a detected framework repo."},G,H,W],examples:["node atm.mjs git-hooks install --framework-required --json","node atm.mjs git-hooks verify --framework-required --json"]})});var s5,i5=y(()=>{"use strict";_();ce();s5=q({name:"guide",summary:"Show guided ATM workflows, classify free-text goals, and record host-local intent phrases.",positional:[{name:"intent",summary:"overview | first-layer | create-atom | create-map | bootstrap | glossary | help | learn | install-skill",required:!1},{name:"command",summary:"Command name when intent is help.",required:!1}],options:[z,{flag:"--goal",value:"text",summary:"Classify a natural-language goal and return the required guidance flow."},{flag:"--phrase",value:"text",summary:"Host-local phrase to record when intent is learn."},{flag:"--intent",value:"id",summary:"Intent id for guide learn: legacy-atomization | legacy-candidate-ranking | task-plan-import."},{flag:"--reason",value:"text",summary:"Review reason for adding a learned host-local phrase."},{flag:"--status",value:"status",summary:"Learned phrase status: suggested | active-host | promoted-framework."},{flag:"--target",value:"host|codex",summary:"Skill installation target for guide install-skill."},{flag:"--skills-root",value:"path",summary:"Override Codex skills root when installing with --target codex."},{flag:"--force",summary:"Overwrite an existing installed skill."},G,H,W],examples:['node atm.mjs guide --goal "Atomize a legacy helper" --json','node atm.mjs guide --goal "Rank the messiest Python pipeline scripts" --json','node atm.mjs guide learn --phrase "brown path washing" --intent legacy-atomization --reason "host phrasing for legacy atomization" --status active-host --json',"node atm.mjs guide install-skill --target host --json","node atm.mjs guide first-layer --json","node atm.mjs guide overview --json","node atm.mjs guide glossary --json","node atm.mjs guide help next --json"]})});var c5,l5=y(()=>{"use strict";_();ce();c5=q({name:"handoff",summary:"Write continuation summaries for governed work.",positional:[{name:"action",summary:"Currently supports: summarize",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Work item id to summarize."},G,H,W],examples:["node atm.mjs handoff summarize --task BOOTSTRAP-0001 --json"]})});var d5,m5=y(()=>{"use strict";_();ce();d5=q({name:"hook",summary:"Run ATM-managed repository Git hook gates.",positional:[{name:"action",summary:"pre-commit | pre-push",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path."},{flag:"--base",value:"ref",summary:"Base ref for pre-push commit-range validation."},{flag:"--head",value:"ref",summary:"Head ref for pre-push commit-range validation."},G,H,W],examples:["node atm.mjs hook pre-commit --json","node atm.mjs hook pre-push --base origin/main --head HEAD --json"]})});var u5,f5=y(()=>{"use strict";_();ce();u5=q({name:"init",summary:"Adopt ATM in a repository.",options:[z,{flag:"--adopt",value:"profile",summary:"Adoption profile (default when flag is present without value: default)."},{flag:"--integration",value:"id",summary:"Install an integration adapter during init."},{flag:"--task",value:"text",summary:"Bootstrap task title override."},{flag:"--dry-run",summary:"Preview init/adopt changes without writing files."},{flag:"--force",summary:"Overwrite existing config and bootstrap files."},G,H,W],examples:["node atm.mjs init --adopt default --json","node atm.mjs init --integration claude-code --json"]})});var p5,h5=y(()=>{"use strict";_();ce();p5=q({name:"internal-release",summary:"Build the ATM framework runner and sync it to explicitly listed internal repositories.",positional:[{name:"action",summary:"sync",required:!0}],options:[z,{flag:"--framework-root",value:"path",summary:"Alias for --cwd when running from outside the framework repository."},{flag:"--repo",value:"path",summary:"Target repository to receive the built ATM runner. Repeatable."},{flag:"--skip",value:"name-or-path",summary:"Skip a target repository by basename or resolved path. Repeatable."},{flag:"--exclude",value:"name-or-path",summary:"Alias for --skip."},{flag:"--source",value:"path",summary:"Runner source path. Defaults to release/atm-onefile/atm.mjs."},{flag:"--no-build",summary:"Do not run npm run build before syncing."},{flag:"--dry-run",summary:"Plan sync targets without copying files."},{flag:"--keep-temp",summary:"Keep known ATM temporary scratch directories for debugging instead of cleaning them."},{flag:"--no-verify",summary:"Do not run target doctor/framework-mode/tasks audit after copying."},{flag:"--allow-verify-failure",summary:"Report verification failures without failing the sync command."},G,H,W],examples:["node atm.mjs internal-release sync --repo ../host-a --repo ../host-b --json","node atm.mjs internal-release sync --repo ../host-a --repo ../host-b --skip host-b --json","node atm.mjs internal-release sync --repo ../host-a --no-build --dry-run --json"]})});var g5,k5=y(()=>{"use strict";_();ce();g5=q({name:"integration",summary:"List, install, verify, remove, or run ATM agent integration adapters and hooks.",positional:[{name:"action",summary:"list | add | verify | parity | remove | hook | hooks",required:!1},{name:"adapter-id",summary:"Adapter id for add/verify/remove or hook event/action.",required:!1},{name:"hook-adapter-id",summary:"Adapter id for hooks install/verify/uninstall, including git-pre-push.",required:!1}],options:[z,{flag:"--repo",value:"path",summary:"Repository path for hook invocations."},{flag:"--actor",value:"name",summary:"Actor label recorded in install manifests."},{flag:"--at",value:"timestamp",summary:"Install timestamp override."},{flag:"--editor",value:"id",summary:"Editor id for integration hook pre-agent/pre-tool."},{flag:"--prompt",value:"text",summary:"Prompt text for pre-agent hook evaluation."},{flag:"--tool-name",value:"name",summary:"Tool name for pre-tool hook evaluation."},{flag:"--command",value:"command",summary:"Shell command for pre-tool hook evaluation."},{flag:"--files",value:"csv",summary:"Comma-separated paths for pre-tool hook evaluation."},{flag:"--dry-run",summary:"Preview integration install without writing files."},{flag:"--force",summary:"Overwrite existing manifests and target files."},{flag:"--merge",summary:"Safely reconcile digest-verified ATM content while preserving user-owned files; conflicts fail closed."},G,H,W],examples:["node atm.mjs integration list --json","node atm.mjs integration add claude-code --json","node atm.mjs integration add codex --json","node atm.mjs integration add antigravity --json","node atm.mjs integration verify claude-code --json","node atm.mjs integration parity --json","node atm.mjs integration remove claude-code --json","node atm.mjs integration hook pre-agent --editor copilot --json","node atm.mjs integration hook pre-tool --editor claude-code --files packages/core/src/index.ts --json","node atm.mjs integration hooks install copilot --json","node atm.mjs integration hooks verify claude-code --json","node atm.mjs integration hooks install git-pre-push --json","node atm.mjs integration hooks verify git-pre-push --json","node atm.mjs integration hooks uninstall git-pre-push --json"]})});var y5,I5=y(()=>{"use strict";_();ce();y5=q({name:"lane",summary:"Inspect, lazily mint, heartbeat, sweep, or explicitly adopt an ATM lane session and echo the lane envelope for tool callers.",positional:[{name:"action",summary:"status | adopt <lane-id> | heartbeat [lane-id] | sweep",required:!1}],options:[z,{flag:"--lane-session-id",value:"id",summary:"Lane session id to resolve before falling back to ATM_LANE_SESSION_ID."},{flag:"--lane-session",value:"id",summary:"Alias for --lane-session-id."},{flag:"--actor",value:"id",summary:"Actor id used when a missing or stale lane must be lazily minted, or when adopting a lane."},{flag:"--reason",value:"text",summary:"Optional reason recorded when adopting a lane."},{flag:"--confirm",summary:"Confirm adoption of a still-live lane owned by the same actor."},{flag:"--handoff-token",value:"token",summary:"Authorize adoption of a still-live lane with its handoff token."},{flag:"--grace-ms",value:"ms",summary:"Grace period used by lane sweep before a TTL-expired lane becomes sweepable."},{flag:"--write",summary:"For lane sweep, expire sweepable lanes and write sweep events. Without --write, sweep is report-only."},G,H,W],examples:["node atm.mjs lane status --json","node atm.mjs lane status --actor codex-main --json","node atm.mjs lane status --lane-session-id lane-20260716000000-codex-main-abc123 --json","node atm.mjs lane heartbeat lane-20260716000000-codex-main-abc123 --actor codex-main --json","node atm.mjs lane sweep --json","node atm.mjs lane sweep --grace-ms 60000 --write --json","node atm.mjs lane adopt lane-20260716000000-codex-main-abc123 --actor codex-main --confirm --json"]})});var v5,w5=y(()=>{"use strict";_();ce();v5=q({name:"lock",summary:"Check, acquire, or release a governed scope lock.",positional:[{name:"action",summary:"check | acquire | release",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Task id for lock operation."},{flag:"--owner",value:"name",summary:"Lock owner identity."},{flag:"--files",value:"csv",summary:"Comma-separated locked files for acquire."},G,H,W],examples:["node atm.mjs lock acquire --task BOOTSTRAP-0001 --owner atm-agent --json"]})});var S5,A5=y(()=>{"use strict";_();ce();S5=q({name:"migrate",summary:"Plan, apply, or verify ATM schema migration codemods for breaking framework version changes.",positional:[{name:"action",summary:"plan | apply | verify",required:!1}],options:[z,{flag:"--from",value:"version",summary:"Source ATM chart version to migrate from (e.g. 0.0.1)."},{flag:"--to",value:"version",summary:"Target ATM chart version to migrate to (e.g. 0.1.0)."},{flag:"--fixture",value:"path",summary:"Fixture directory path for verify action (must contain before/ and after/)."},G,H,W],examples:["node atm.mjs migrate plan --from 0.0.1 --to 0.1.0 --json","node atm.mjs migrate apply --from 0.0.1 --to 0.1.0 --json","node atm.mjs migrate verify --fixture fixtures/migrations/atm-chart-0.0.1-to-0.1.0 --json"]})});var b5,T5=y(()=>{"use strict";_();ce();b5=q({name:"next",summary:"Route the current prompt into the official ATM fast, normal, or batch work channel. When the selected task id is already known (via --task or an unambiguous --prompt resolution), the recommended claim command prefers the explicit --task TASK-XXX form over re-passing the natural-language prompt.",options:[z,{flag:"--claim",summary:"Start the selected fast/normal/batch route and create the required runtime state."},{flag:"--actor",value:"id",summary:"Actor id used for next --claim (or set ATM_ACTOR_ID)."},{flag:"--allow-stale-runner",summary:"Allow a human-approved runner-recovery lease to perform only the claim lifecycle while frozen runner publication is unavailable. This does not imply WIP adoption."},{flag:"--adopt-unowned-wip",summary:"With --claim and one explicit --task only, adopt unowned dirty WIP within the declared task scope. No --files, --tasks, --prompt or --intent override; foreign owners remain protected."},{flag:"--emergency-approval",value:"leaseId",summary:"Emergency lease required with --allow-stale-runner for a recovery claim."},{flag:"--atoms",value:"symbols",summary:"For next --claim: comma-separated symbols in the task scope files to reserve as derived atoms (an intent ceiling, not an exclusive guarantee). Tasks that reserve disjoint atoms of one file are admitted in parallel; the governed commit confirms the atoms the staged diff actually touched. Symbols that do not exist yet are confirmed at commit time."},{flag:"--auto-intent",summary:"For next --claim task routes, auto-resolve write vs closeout-only from in-scope dirty files and whether deliverables already landed in HEAD."},{flag:"--claim-intent",value:"mode",summary:"Override claim mode for next --claim: write or closeout-only/no-more-mutation."},{flag:"--closeout-only",summary:"Alias for --claim-intent closeout-only on next --claim."},{flag:"--no-more-mutation",summary:"Alias for --claim-intent closeout-only on next --claim."},{flag:"--files",value:"csv",summary:"Optional comma-separated scope files for next --claim; ATM still includes the task ledger record in the underlying claim."},{flag:"--prompt",value:"text",summary:"Scope next-action routing to the current user prompt before falling back to global state."},{flag:"--planning-root",value:"path",summary:"Use one explicit planning authority root and bypass ambiguous sibling discovery for this route."},{flag:"--task",value:"id",summary:"Route directly to one task id without writing a shared task-intent file."},{flag:"--tasks",value:"csv",summary:"Freeze an explicit comma-separated task id range for a batch claim."},{flag:"--intent",value:"path",summary:"Read an atm.taskIntent.v1 JSON file produced by a trusted skill or integration hook."},{flag:"--output",value:"path",summary:"Write JSON output to a file. When passed without a path, defaults to .atm-temp/next-<timestamp>.json."},{flag:"--verbose",summary:"Skip default output compaction and return the full untrimmed envelope (large frameworkStatus file lists, duplicated top-level aliases, full playbook echoed inside messages)."},G,H,W],examples:["node atm.mjs next --json","node atm.mjs next --json --output",'node atm.mjs next --prompt "implement TASK-ABC-0001" --json','node atm.mjs next --prompt "implement TASK-ABC-0001" --planning-root C:/planning/docs/ai_atomic_framework --json',"node atm.mjs next --task TASK-ABC-0001 --json",'node atm.mjs next --prompt "quick fix tsconfig.json typo" --json','node atm.mjs next --prompt "complete all task cards in PlanAlpha" --json','node atm.mjs next --claim --actor codex-main --prompt "complete selected cards" --tasks TASK-1,TASK-2 --json',"node atm.mjs next --intent .atm/runtime/task-intent.json --json","node atm.mjs next --cwd <host-repo> --json","node atm.mjs next --claim --actor codex-main --task TASK-ABC-0001 --auto-intent --json","node atm.mjs next --claim --actor codex-main --task TASK-ABC-0001 --adopt-unowned-wip --auto-intent --json","node atm.mjs next --claim --actor codex-main --task TASK-ABC-0001 --files packages/core/src/index.ts --claim-intent write --json",'node atm.mjs next --claim --actor codex-main --prompt "implement TASK-ABC-0001" --auto-intent --json',"node atm.mjs next --claim --actor codex-main --task TASK-ABC-0001 --claim-intent closeout-only --json"],help:{audience:"agent",requiredFlagSets:[{when:"Claiming a governed route",flags:["--claim","--actor"]},{when:"Routing one exact task without fuzzy prompt matching",flags:["--task"]}],relatedCommands:['node atm.mjs guide --goal "<goal>" --json',"node atm.mjs task-view --task TASK-ABC-0001 --json","node atm.mjs batch checkpoint --actor <actor-id> --json"],commonMistakes:["Passing one broad prompt that names many task ids; prefer --task, --tasks, or an intent file when the scope is already known.","Running low-level tasks claim loops after next selected a batch lane.","Treating next as task closure; next chooses the governed route, but evidence and closeout still happen in the selected playbook."],playbookNotes:["Read evidence.nextAction.playbook before editing, committing, or closing a task.","When the prompt already resolves to one exact task, prefer next --claim --task TASK-XXX over re-passing natural language.","If governanceReadiness is present, resolve doctor/framework claim/pre-push blockers before implementation.","Default output is compacted (large frameworkStatus file lists truncated, duplicated top-level aliases removed, playbook echoed once via evidence.nextAction.playbook); pass --verbose for the full untrimmed envelope."]}})});var C5,R5=y(()=>{"use strict";_();ce();C5=q({name:"self-host-alpha",summary:"Verify deterministic self-hosting alpha criteria.",options:[z,{flag:"--verify",summary:"Run the deterministic self-hosting alpha checklist."},{flag:"--agent",value:"profile",summary:"Optional advisory confidence profile."},G,H,W],examples:["node atm.mjs self-host-alpha --verify --json","node atm.mjs self-host-alpha --verify --agent claude-code --json"]})});var x5,E5=y(()=>{"use strict";_();ce();x5=q({name:"spec",summary:"Validate an atomic spec or supported report against schema contracts.",options:[z,{flag:"--validate",value:"path",summary:"Spec file path to validate."},G,H,W],examples:["node atm.mjs spec --validate tests/schema-fixtures/positive/hello-world.atom.json --json","node atm.mjs spec --validate tests/schema-fixtures/map-equivalence-report/positive.json --json"]})});var _5,P5=y(()=>{"use strict";_();ce();_5=q({name:"status",summary:"Inspect ATM status in framework or adopted repositories, including active worker claims for one-glance coordination.",options:[z,G,H,W],examples:["node atm.mjs status --json","node atm.mjs status --pretty"]})});var M5={};pi(M5,{default:()=>QD});var QD,XD=y(()=>{"use strict";_();ce();QD=q({name:"tasks",summary:"Backend and generator surfaces for task plans, runtime ledger, queues, and claim lifecycle. taskflow open/close is the official operator lane and the normal entry for governed work; the tasks subcommands below are backend/generator surfaces that should be invoked through taskflow when possible. taskflow close --write owns the exclusive close-window staged-index lock during governed staging; do not stage competing governance bundles while that lock is active. tasks new is the low-level template generator (no governed lifecycle, no runtime import). tasks import is the runtime synchronization surface that loads a planning markdown into the target ledger (taskflow open --write calls this internally). tasks close, tasks reconcile, tasks repair-closure, tasks repair-claim, tasks import --write --force, tasks reset, and tasks lock cleanup are protected backend surfaces and emergency mutations when used directly; prefer taskflow close for normal closeback. tasks repair-claim is diagnose-first: default mode reports stale, dangling, expired, or conflicting claim drift without mutation; pass --write --reason only when no valid active lease or session blocks repair. When historical delivery needs to be reconstructed across multiple commits, evidence historical-batch authors the close-ready task slice and tasks close consumes that slice as a backend surface. tasks import preserves task-card machine fields with high fidelity: scopePaths, deliverables, validators, target_repo, planning_repo, closure_authority, planningMirrorPaths, planningReadOnlyPaths, outOfScope, nonGoals, nested evidence.required, rollback.strategy, rollback.notes, atomizationImpact, compact dispatchPattern / conditionReview / mailboxAssignee dispatch metadata, and emits importDiagnostics for legacy aliases (allowed_files, blocked_by, upstream_repo).",positional:[{name:"action",summary:"create | import | mirror | verify | scope | audit | queue | parallel | lock | migrate-legacy-ledger | reset | claim | renew | release | handoff | takeover | block | abandon | close | reconcile | repair-closure | repair-claim | show | status | finalize | roster | new | realign-plan-source | seal-plan-source",required:!0}],options:[z,{flag:"--from",value:"path",summary:"Markdown plan path for tasks import.",subcommands:["import"]},{flag:"--dry-run",summary:"Parse the plan and emit a manifest without writing task files. Planning-source maintenance reports its narrow seal proposal without mutating ledger files or HEAD."},{flag:"--write",summary:"Write canonical task JSON files to .atm/history/tasks/ and persist import evidence. tasks seal-plan-source updates only a missing planning commit identity and appends a transition event."},{flag:"--map",value:"path",summary:"JSON path map for tasks realign-plan-source (object of from->to paths, or { mappings: [{ from, to }] }).",subcommands:["realign-plan-source"]},{flag:"--planning-repo",value:"path",summary:"Optional planning repository root for tasks realign-plan-source path resolution (defaults to ATM_PLANNING_REPO_ROOT or cwd)."},{flag:"--force",summary:"Overwrite existing task files even when the source hash differs. Active claims are still preserved unless --force-overwrite-claims is set."},{flag:"--force-overwrite-claims",summary:"Allow tasks import --write to overwrite tasks with active or handoff claims and emit claim-displaced-by-import transition events.",subcommands:["import"]},{flag:"--metadata-only",summary:"For tasks import: update only validator metadata and planning-source seal; requires --preserve-active-claim and --write.",subcommands:["import"]},{flag:"--preserve-active-claim",summary:"For tasks import: require the current active claim owner and preserve lifecycle/scope fields during metadata-only repair.",subcommands:["import"]},{flag:"--waive-planning-root",summary:"For framework-repo AAO/TEAM imports from .atm/task-plans: explicitly waive the canonical planning-root authorship preflight; requires --reason.",subcommands:["import"]},{flag:"--reason",value:"text",summary:"Required rationale when --waive-planning-root is set."},{flag:"--reset-open",summary:"Rebuild matching imported tasks as open during tasks import --write.",subcommands:["import"]},{flag:"--apply",summary:"Apply tasks migrate-legacy-ledger changes instead of reporting a dry-run.",subcommands:["migrate-legacy-ledger"]},{flag:"--all-stale",summary:"Clean every stale runtime task lock candidate for tasks lock cleanup.",subcommands:["lock"]},{flag:"--reserved-ok",summary:"Allow tasks release to return a reserved task with no active claim back to open.",subcommands:["release"]},{flag:"--wip-commit",summary:"For tasks release: commit dirty in-scope WIP files as a non-delivery preservation commit before releasing.",subcommands:["release"]},{flag:"--discard-wip",summary:"For tasks release: discard dirty in-scope WIP files with an auditable discard receipt before releasing.",subcommands:["release"]},{flag:"--staged",summary:"Run tasks audit in staged/pre-commit mode."},{flag:"--summary",summary:"For tasks audit: emit the read-only atm.taskReadProjection.v1 row set with the default field set instead of findings."},{flag:"--fields",value:"names",summary:"For tasks audit: comma-separated projection fields (taskId, status, claimState, owner, lastTransitionAt, residueBucket, nextActionCode, planningStatus, partialClose). Unknown fields fail closed."},{flag:"--tasks",value:"ids",summary:"For tasks audit projection: comma-separated task ids to project. Mutually exclusive with --series and --all."},{flag:"--series",value:"prefix",summary:"For tasks audit projection: project every ledger task under a task-id prefix such as GIT or TASK-GIT."},{flag:"--all",summary:"For tasks audit projection: project every task in the ledger. Explicit opt-in; no implicit default."},{flag:"--queue",value:"id",summary:"Task queue id for tasks queue abandon."},{flag:"--task",value:"id",summary:"Task id for claim/renew/release/handoff/takeover/close/reconcile/repair-closure/repair-claim/status/finalize diagnose/scope add/scope remove/scope repair."},{flag:"--residue",summary:"For tasks status, return residue-focused diagnosis evidence only (including source-done-governance-incomplete vs ambiguous-manual-review)."},{flag:"--allow-stale-runner",summary:"Allow write actions while the frozen runner is older than framework source (disaster recovery only)."},{flag:"--emergency-approval",value:"leaseId",summary:"Required for protected direct backend emergency surfaces; obtain via emergency approve after human approval."},{flag:"--with",value:"id",summary:"Second task id for tasks parallel pair analysis."},{flag:"--actor",value:"id",summary:"Actor id for reservation/claim/close/reconcile lifecycle actions (or set ATM_ACTOR_ID)."},{flag:"--auto-intent",summary:"For tasks claim, auto-resolve write vs closeout-only from in-scope dirty files and whether declared deliverables already landed in HEAD."},{flag:"--claim-intent",value:"mode",summary:"Claim mode for tasks claim: write (default) or closeout-only/no-more-mutation."},{flag:"--closeout-only",summary:"Alias for --claim-intent closeout-only when claiming for non-mutating closeback work."},{flag:"--no-more-mutation",summary:"Alias for --claim-intent closeout-only; keep for closeback-only intent surface."},{flag:"--title",value:"text",summary:"Optional title for tasks create when creating a manual task entry."},{flag:"--provider",value:"id",summary:"External provider id for tasks mirror."},{flag:"--origin-task",value:"id",summary:"External task id for tasks mirror."},{flag:"--origin-url",value:"url",summary:"External task URL for tasks mirror."},{flag:"--sync-status",value:"state",summary:"Mirror sync status for tasks mirror."},{flag:"--files",value:"csv",summary:"Comma-separated scope files for claim/takeover lock acquisition."},{flag:"--adopt-unowned-wip",summary:"Claim backend flag forwarded by exact-task next --claim adoption. It never permits taking foreign-owned WIP; use the normal next route.",subcommands:["claim"]},{flag:"--add",value:"csv",summary:"Comma-separated paths to add to the active task direction lock allowedFiles. Used with tasks scope add/repair."},{flag:"--remove",value:"csv",summary:"Comma-separated non-deliverable paths to remove from an active task runtime scope. Used with tasks scope remove; requires the active claim owner and never needs emergency approval."},{flag:"--claim-first",summary:"For tasks scope add, auto-claim the task with --auto-intent before scope amendment when no active claim exists."},{flag:"--ttl-seconds",value:"number",summary:"Lease ttl in seconds for claim/renew/takeover."},{flag:"--to",value:"id",summary:"Target actor id for handoff."},{flag:"--status",value:"state",summary:"Target status for tasks close: done|review|blocked|abandoned. done requires real non-.atm deliverables plus evidence."},{flag:"--reason",value:"text",summary:"Reason for release, handoff, takeover, close, or scope repair."},{flag:"--historical-delivery",value:"commit",summary:"Allow tasks close done or tasks reconcile to verify an earlier delivery commit."},{flag:"--historical-batch",value:"batchId-or-path",summary:"For tasks close done: consume an evidence historical-batch task slice and derive the matched delivery commits plus close-readiness verdict."},{flag:"--historical-delivery-repo",value:"path",summary:"For planning-repo authority closeback, verify --historical-delivery against this repo root instead of the target repo."},{flag:"--waiver-out-of-scope-delivery",summary:"Allow historical delivery when the commit also contains unrelated source files; requires --reason."},{flag:"--waive-out-of-scope",summary:"Alias for --waiver-out-of-scope-delivery."},{flag:"--scope",value:"taskId",summary:"For tasks repair-closure, limit dirty-tree blocking to files overlapping the scoped task claim/direction lock/deliverables; unrelated dirty files become warnings."},{flag:"--amend",summary:"For tasks repair-closure, explicitly request HEAD rewrite after staging the repaired packet. ATM fails safely when no amend-capable governed wrapper is available."},{flag:"--no-amend",summary:"Compatibility alias for the default stage-only tasks repair-closure flow."},{flag:"--template",value:"name",summary:"Template key for tasks new."},{flag:"--task-id",value:"id",summary:"Task id for tasks new."},{flag:"--output",value:"path",summary:"Output markdown path for tasks new."},{flag:"--atom-id",value:"id",summary:"Atom id placeholder for tasks new."},{flag:"--scope-path",value:"path",summary:"Scope path placeholder for tasks new."},{flag:"--test-path",value:"path",summary:"Test path placeholder for tasks new."},{flag:"--depends-on",value:"id",summary:"Depends on placeholder for tasks new."},{flag:"--capability",value:"text",summary:"Capability description placeholder for tasks new."},{flag:"--goal",value:"text",summary:"Goal description placeholder for tasks new."},{flag:"--index",value:"path",summary:"Roster README path for tasks roster update."},{flag:"--from",value:"path",summary:"Task markdown path for tasks roster update."},G,H,W],examples:["node atm.mjs tasks import --from docs/plan.md --dry-run --json","node atm.mjs tasks import --from docs/plan.md --write --json","node atm.mjs tasks realign-plan-source --map .atm/runtime/plan-path-realign-map.json --dry-run --json","node atm.mjs tasks realign-plan-source --map .atm/runtime/plan-path-realign-map.json --write --actor codex-main --json","node atm.mjs tasks seal-plan-source --task ATM-GOV-0324 --dry-run --json","node atm.mjs tasks seal-plan-source --task ATM-GOV-0324 --write --actor codex-main --json",'node atm.mjs tasks create --task ATM-GOV-0100 --actor codex-main --title "Governance task" --json',"node atm.mjs tasks mirror --provider github --origin-task 123 --origin-url https://github.com/org/repo/issues/123 --actor codex-main --json","node atm.mjs tasks verify --json","node atm.mjs tasks audit --json","node atm.mjs tasks audit --tasks TASK-GIT-0024,TASK-GIT-0025 --summary --json","node atm.mjs tasks audit --series GIT --summary --fields taskId,status,claimState,owner,lastTransitionAt,residueBucket,nextActionCode --json","node atm.mjs tasks audit --staged --json","node atm.mjs tasks scope add --task ATM-GOV-0101 --actor codex-main --add packages/cli/src/commands/new-feature.ts --json","node atm.mjs tasks scope add --task ATM-GOV-0101 --actor codex-main --claim-first --add docs/linked-surface.md --json","node atm.mjs tasks scope add --task ATM-GOV-0101 --actor codex-main --add packages/cli/src/commands/foo.ts,packages/cli/src/commands/bar.ts --json",'node atm.mjs tasks scope remove --task ATM-GOV-0101 --actor codex-main --remove packages/cli/src/commands/obsolete-glob.ts --reason "narrow to delivered files" --json','node atm.mjs tasks scope repair --task ATM-GOV-0101 --actor codex-main --add packages/cli/src/commands/foo.ts --reason "Add emergency in-scope docs" --emergency-approval EMG-... --json',"node atm.mjs tasks queue status --json","node atm.mjs tasks queue abandon --queue queue-abc123 --actor codex-main --json","node atm.mjs tasks parallel --task TASK-AAO-0130 --with TASK-AAO-0131 --json","node atm.mjs tasks parallel --task TASK-AAO-0130 --queue --json","node atm.mjs tasks parallel --queue --report --json","node atm.mjs tasks lock cleanup --all-stale --actor codex-main --json","node atm.mjs tasks migrate-legacy-ledger --actor codex-main --dry-run --json","node atm.mjs tasks migrate-legacy-ledger --actor codex-main --apply --json","node atm.mjs next --claim --actor codex-main --task ATM-GOV-0101 --auto-intent --json",'node atm.mjs tasks reset --task ATM-GOV-0101 --actor codex-main --to open --reason "rollback cleanup" --json',"node atm.mjs tasks claim --task ATM-GOV-0101 --actor codex-main --files packages/core/src/index.ts --json","node atm.mjs tasks claim --task ATM-GOV-0101 --actor codex-main --files packages/core/src/index.ts --auto-intent --json","node atm.mjs tasks claim --task ATM-GOV-0101 --actor codex-main --files packages/core/src/index.ts --claim-intent closeout-only --json","node atm.mjs tasks claim --task ATM-GOV-0101 --actor codex-main --files packages/core/src/index.ts --no-more-mutation --json","node atm.mjs tasks renew --task ATM-GOV-0101 --actor codex-main --ttl-seconds 3600 --json",'node atm.mjs tasks release --task ATM-GOV-0101 --actor codex-main --reason "handoff complete" --json','node atm.mjs tasks release --task ATM-GOV-0101 --actor codex-main --reserved-ok --reason "rollback cleanup" --json',"node atm.mjs tasks close --task ATM-GOV-0104 --actor codex-main --status done --json","node atm.mjs tasks close --task ATM-GOV-0104 --actor codex-main --status done --historical-delivery abc123 --emergency-approval EMG-... --json","node atm.mjs tasks close --task ATM-GOV-0104 --actor codex-main --status done --historical-batch hist-batch-2026-06-15T17-28-20-007Z --json","node atm.mjs tasks close --task ATM-GOV-0104 --actor codex-main --status done --historical-delivery abc123 --historical-delivery-repo ../planning --emergency-approval EMG-... --json","node atm.mjs tasks repair-closure --task TASK-AAO-0102 --json","node atm.mjs tasks repair-claim --task TASK-MAO-0043 --actor codex-main --json",'node atm.mjs tasks repair-claim --task TASK-MAO-0043 --actor codex-main --write --reason "release expired claim drift" --json','node atm.mjs tasks block --task ATM-GOV-0104 --actor codex-main --reason "waiting on target evidence" --json',"node atm.mjs tasks reconcile --task TASK-AAO-0055 --actor codex-main --delivery-commit abc1234 --emergency-approval EMG-... --json","node atm.mjs tasks status --task TASK-AAO-0137 --json","node atm.mjs tasks status --task TASK-AAO-0137 --residue --json","node atm.mjs tasks finalize diagnose --task TASK-AAO-0137 --json","node atm.mjs tasks roster update --index docs/tasks/README.md --from docs/tasks/TASK-ADOPTER-0001.task.md --dry-run --json","node atm.mjs tasks roster update --index docs/tasks/README.md --from docs/tasks/TASK-ADOPTER-0001.task.md --json"],help:{audience:"mixed",requiredFlagSets:[{when:"Checking one task status or residue",flags:["--task"]},{when:"Protected backend close or reconcile",flags:["--task","--actor"]},{when:"Emergency scope repair or protected backend mutation",flags:["--task","--actor","--emergency-approval"]}],relatedCommands:["node atm.mjs next --claim --task TASK-ABC-0001 --actor <actor-id> --auto-intent --json","node atm.mjs taskflow close --task TASK-ABC-0001 --actor <actor-id> --dry-run --json","node atm.mjs evidence validators --list --task TASK-ABC-0001 --json"],commonMistakes:["Treating tasks close or tasks reconcile as the first operator lane instead of taskflow close.","Writing force/import/reset style backend mutations before checking whether the task already has an active claim or a cleaner prompt-scoped route."],playbookNotes:["Use tasks status, show, audit, queue, and scope as read-only or repair surfaces around the main next/taskflow workflow.","tasks repair-claim is diagnose-first; add --write only after the diagnosis proves no valid active lease still owns the task."],maintainerNotes:["Protected backend surfaces remain available for maintainers and emergency reconcile work, but they must preserve evidence and lifecycle metadata.","tasks new is only the low-level template generator; it does not import or claim governed work by itself."],deprecatedGuidance:["Legacy reserve/promote lifecycle surfaces were removed; next --claim is the only claim entry."]}})});var O5,D5=y(()=>{"use strict";_();ce();O5=q({name:"upgrade",summary:"Propose upgrade evolution from report evidence inputs or plan safe ATM onboarding upgrades.",positional:[{name:"action",summary:"base-sync | plan | apply | rollback | experimental-api (or legacy --propose / --scan)",required:!1}],options:[z,{flag:"--actor",value:"id",summary:"Required actor for governed framework base-sync."},{flag:"--out",value:"path",summary:"Write a safe upgrade plan JSON file."},{flag:"--allow-unknown-chart",summary:"Allow upgrade plan generation when the local ATMChart version is unknown."},{flag:"--from-plan",value:"path",summary:"Apply a previously reviewed safe upgrade plan."},{flag:"--canary",value:"percent",summary:"Apply only a deterministic canary subset of a safe upgrade plan and record canary state."},{flag:"--backup",value:"path",summary:"Rollback from a backup directory created by upgrade apply."},{flag:"--api",value:"id",summary:"Experimental API id for upgrade experimental-api."},{flag:"--allow-experimental",summary:"Explicitly allow @experimental SDK API invocation."},{flag:"--propose",summary:"Generate an upgrade proposal."},{flag:"--scan",summary:"Run the evidence-driven draft bridge from detector reports."},{flag:"--dry-run",summary:"Generate proposal without mutating persisted artifacts."},{flag:"--atom",value:"id",summary:"Target atom id."},{flag:"--from",value:"version",summary:"Source version; expected full HEAD SHA for base-sync."},{flag:"--to",value:"version",summary:"Target version; descendant full commit SHA for base-sync."},{flag:"--target",value:"kind",summary:"Target kind: atom | map."},{flag:"--map",value:"id",summary:"Target map id when target kind is map."},{flag:"--replacement-mode",value:"mode",summary:"Requested replacement rollout mode for map proposals: draft | shadow | canary | active | legacy-retired."},{flag:"--equivalence-report",value:"path",summary:"Map equivalence report path for map proposals."},{flag:"--polymorph-impact-report",value:"path",summary:"Polymorph impact report path for active map proposals with template-bound members."},{flag:"--propagation-report",value:"path",summary:"Propagation report path for active map proposals."},{flag:"--review-advisory",value:"path",summary:"Review advisory report path for active map proposals."},{flag:"--human-review",value:"path",summary:"Human review decision path for active map proposals."},{flag:"--rollback-proof",value:"path",summary:"Rollback proof path for map proposals."},{flag:"--retirement-proof",value:"path",summary:"Retirement proof path for legacy-retired map proposals."},{flag:"--behavior",value:"id",summary:"Behavior id to route proposal generation."},{flag:"--decomposition-decision",value:"decision",summary:"Explicit decomposition decision override."},{flag:"--legacy-target",value:"path#symbol",summary:"LegacyRoutePlan-selected target for guided atomize/infect/split dry-run proposals."},{flag:"--guidance-session",value:"id",summary:"Guidance session id that authorized a guided legacy dry-run proposal."},{flag:"--fork-source",value:"id",summary:"Fork source atom id."},{flag:"--new-atom-id",value:"id",summary:"Fork destination atom id."},{flag:"--input",value:"path",summary:"Input report path (repeatable)."},{flag:"--proposal-id",value:"id",summary:"Override proposal id."},{flag:"--proposed-by",value:"name",summary:"Proposal author label."},{flag:"--proposed-at",value:"timestamp",summary:"Proposal timestamp override."},G,H,W],examples:["node atm.mjs upgrade base-sync --cwd ../ATM-source --actor grok-bot --from <full-current-SHA> --to <full-target-SHA> --json","node atm.mjs upgrade plan --cwd . --out .atm/history/reports/upgrade-plan.json --json","node atm.mjs upgrade plan --cwd . --allow-unknown-chart --json","node atm.mjs upgrade apply --from-plan .atm/history/reports/upgrade-plan.json --json","node atm.mjs upgrade apply --from-plan .atm/history/reports/upgrade-plan.json --canary 25 --json","node atm.mjs upgrade rollback --backup .atm/backups/<backup-id> --json","node atm.mjs upgrade experimental-api --api agent-pack-preview --allow-experimental --json","node atm.mjs upgrade --propose --atom ATM-CORE-0001 --to 1.1.0 --input fixtures/upgrade/hash-diff-report.json --json","node atm.mjs upgrade --propose --atom ATM-CORE-0001 --to 1.1.0 --target map --map ATM-MAP-0001 --replacement-mode active --equivalence-report atomic_workbench/maps/ATM-MAP-0001/map.equivalence.report.json --input fixtures/upgrade/hash-diff-report.json --json","node atm.mjs upgrade --propose --atom ATM-CORE-0001 --to 1.1.0 --target map --map ATM-MAP-0001 --replacement-mode active --polymorph-impact-report atomic_workbench/maps/ATM-MAP-0001/polymorph-impact-report.json --propagation-report .atm/history/reports/propagation-report.json --review-advisory .atm/history/reports/review-advisory.json --human-review .atm/history/reports/human-review-approve.json --input fixtures/upgrade/hash-diff-report.json --json","node atm.mjs upgrade --propose --atom ATM-CORE-0001 --to 1.1.0 --target map --map ATM-MAP-0001 --replacement-mode legacy-retired --retirement-proof .atm/history/reports/retirement-proof.json --input fixtures/upgrade/hash-diff-report.json --json",'node atm.mjs upgrade --propose --behavior behavior.infect --legacy-target "src/legacy.js#normalizeInput" --guidance-session <session-id> --dry-run --json',"node atm.mjs upgrade --scan --input fixtures/evolution/evidence-patterns/recurring-failure-candidate.json --json"]})});var F5,j5=y(()=>{"use strict";_();ce();F5=q({name:"test",summary:"Run atom smoke, spec, plugin-backed test runner, map integration, map equivalence, or propagation tests.",options:[z,{flag:"--atom",value:"name",summary:"Run canned atom smoke (currently: hello-world)."},{flag:"--spec",value:"path",summary:"Run spec-based test runner flow. If <spec>.test-runner.json exists beside the spec, ATM auto-loads plugin plans and default gate fixtures from it."},{flag:"--profile",value:"quick|standard|full",summary:"Select the catalog-aligned integration-test profile for plugin-backed spec tests."},{flag:"--suite",value:"key-or-family",summary:"Narrow plugin-backed spec tests to a declared suite, family, or command key."},{flag:"--map",value:"id",summary:"Run map integration test for a map id."},{flag:"--equivalence-fixtures",value:"path",summary:"Run map equivalence using a fixture set. Must be paired with --map."},{flag:"--propagate",value:"id",summary:"Run downstream propagation checks for an atom id."},G,H,W],examples:["node atm.mjs test --atom hello-world --json","node atm.mjs test --spec tests/test-runner-fixtures/plugin.atom.json --profile quick --json","node atm.mjs test --map ATM-MAP-0001 --json","node atm.mjs test --map ATM-MAP-0001 --equivalence-fixtures fixtures/equivalence/checkout-mini.json --json"],help:{audience:"general",requiredFlagSets:[{when:"Running equivalence fixtures",flags:["--map","--equivalence-fixtures"]}],relatedCommands:['node atm.mjs evidence run --task TASK-ABC-0001 --actor <actor-id> --command "node atm.mjs test --map ATM-MAP-0001 --json" --json',"node atm.mjs validate --json"],commonMistakes:["Passing --equivalence-fixtures without also selecting a map id.","Treating test output as durable close evidence without recording it through evidence run when governance requires it."]}})});var $5,L5=y(()=>{"use strict";_();ce();$5=q({name:"telemetry",summary:"Manage opt-in ATM CLI telemetry and local governance gate telemetry for the current repository.",positional:[],options:[z,{flag:"--on",summary:"Opt in to telemetry for this repository."},{flag:"--off",summary:"Opt out of telemetry for this repository."},{flag:"--status",summary:"Show telemetry status (default action)."},{flag:"--endpoint",value:"url",summary:"Optional telemetry endpoint recorded with opt-in."},{flag:"--gate-registry",summary:"Show the canonical local governance gate check registry."},{flag:"--coverage-report",summary:"Show required governance node coverage and M2 preflight readiness."},{flag:"--shared-write-coverage",summary:"Show canonical shared-write gate producer coverage with unavailable receipts."},{flag:"--m2-preflight",summary:"Alias for --coverage-report, intended for analyzer preflight."},{flag:"--task-summary",summary:"Show digest-only per-task gate telemetry summary from sealed history."},{flag:"--emit-fixture",summary:"Write one local governance gate telemetry fixture event to gitignored runtime scratch."},{flag:"--seal",summary:"Seal local governance gate telemetry runtime events to immutable history."},{flag:"--report",summary:"Report local governance gate telemetry from sealed history."},{flag:"--include-runtime",summary:"Include runtime scratch in a diagnostic gate telemetry report."},{flag:"--task",value:"id",summary:"Task id for local gate telemetry fixture or seal."},{flag:"--role",value:"baseline|treatment|m2-preflight|unknown",summary:"Task summary baseline/treatment role."},{flag:"--window",value:"id",summary:"Window id for local gate telemetry seal."},{flag:"--watermark",value:"iso-time",summary:"Watermark for local gate telemetry seal."},{flag:"--gate",value:"name",summary:"Gate name for local fixture emission."},{flag:"--check-id",value:"id",summary:"Canonical check id for local fixture emission."},{flag:"--result",value:"pass|block|warn|skip|error",summary:"Result for local fixture emission."},{flag:"--reason",value:"class",summary:"Reason class for local fixture emission."},{flag:"--duration-ms",value:"number",summary:"Duration for local fixture emission."},{flag:"--actor",value:"id",summary:"Actor id for local fixture emission."},{flag:"--run-id",value:"id",summary:"Run id correlation key for local fixture emission."},{flag:"--lane-session-id",value:"id",summary:"Lane session correlation key for local fixture emission."},{flag:"--batch-id",value:"id",summary:"Batch id correlation key for local fixture emission."},{flag:"--wave-id",value:"id",summary:"Wave id correlation key for local fixture emission."},{flag:"--correlation-id",value:"id",summary:"Correlation id for local fixture emission."},{flag:"--evidence-read-ref",value:"ref",summary:"Compact evidence readback reference consumed by this telemetry event."},G,H,W],examples:["node atm.mjs telemetry --status --json","node atm.mjs telemetry --on --json","node atm.mjs telemetry --off --json","node atm.mjs telemetry --gate-registry --json","node atm.mjs telemetry --coverage-report --json","node atm.mjs telemetry --shared-write-coverage --json","node atm.mjs telemetry --m2-preflight --json","node atm.mjs telemetry --task-summary --task ATM-GOV-0195 --role m2-preflight --json","node atm.mjs telemetry --emit-fixture --task ATM-GOV-0193 --json","node atm.mjs telemetry --seal --task ATM-GOV-0193 --json","node atm.mjs telemetry --report --json"]})});var QPe,XPe,ZPe,eMe,tMe,rMe,oMe,aMe,nMe,sMe,iMe,cMe,lMe,dMe,N5,B5=y(()=>{"use strict";_();ce();QPe={name:"team",summary:"Plan, start, or validate scoped ATM team agents for a task. Validates permissions, leases, task claim dependency gates, parallel CID advisor preflight, and broker lane routing for steward/composer paths.",positional:[{name:"action",summary:"Team action. Supports: plan, start, status, validate, patrol, lease, release, complete, abandon, handoff show|context|stats, wave, knowledge. Plan and start evaluate broker lanes plus task claim dependency gates, and fail closed before a run starts."}],options:[z,{flag:"--task",value:"id",summary:"Task id to plan, validate, or start a team for."},{flag:"--recipe",value:"id",summary:"Optional team recipe id. Defaults to a language-aware built-in recipe."},{flag:"--actor",value:"id",summary:"Actor id for team start."},{flag:"--batch",value:"id",summary:"For team wave plan/dispatch: consume the selected batch run as the wave manifest source."},{flag:"--runtime-mode",value:"mode",summary:"Team runtime mode: real-agent, editor-subagent, or broker-only. Defaults to broker-only."},{flag:"--runtime-language",value:"name",summary:"Runtime language contract for this team run. Defaults to node."},{flag:"--runtime-adapter",value:"id",summary:"Vendor-neutral runtime adapter id recorded on the team run."},{flag:"--provider",value:"id",summary:"Optional provider metadata recorded on the runtime contract."},{flag:"--sdk",value:"id",summary:"Optional SDK metadata recorded on the runtime contract."},{flag:"--model",value:"id",summary:"Optional model metadata recorded on the runtime contract."},{flag:"--role-provider",value:"role=provider:model[:sdk][:mode]",repeatable:!0,summary:"Override provider/model selection for one Team role. Repeatable."},{flag:"--team-size",value:"level",summary:"Manual team size/level override: small/L1 core, medium/L2 reader+evidence, large/L3 scope, L4 lieutenant, L5 review+knowledge."},{flag:"--disable-editor-bridge",summary:"Disable the editor-subagent bridge contract for this run while preserving Team governance semantics."},{flag:"--execute",summary:"Execute governed provider orchestration for selected Team roles after runtime state is written. Defaults off."},{flag:"--executor",value:"mode",summary:"For team wave plan/dispatch: executor mode auto, local-lanes, editor-subagents, team-agents, or manual."},{flag:"--team",value:"id",summary:"Team run id for status or patrol."},{flag:"--broker-proposal-file",value:"path",summary:"Validated broker proposal consumed by team plan (readiness preview) and a matching hot Team start. Proposal-first rejections emit a machine-actionable recovery contract (schema atm.patchProposal.v1); mismatched, stale, or out-of-scope proposals fail closed on both surfaces."},{flag:"--read-only",summary:"team plan only: read-only projection mode. Skips broker-registry cleanup persistence and downgrades proposal-first-required to a warning so diagnostics such as indexLane still return. Does not change team start fail-closed semantics."},{flag:"--permission",value:"id",summary:"Permission id for team lease or release."},{flag:"--paths",value:"csv",summary:"Comma-separated lease paths for team lease."},{flag:"--reason",value:"text",summary:"Reason recorded for team lease, release, complete, or abandon."},{flag:"--mode",value:"name",summary:"Team patrol mode: claim-preflight, close-preflight, big-script, or daily-noon."},{flag:"--compact",summary:"Return a compact status payload."},{flag:"--scope",value:"name",summary:"Knowledge build scope for team knowledge build."},{flag:"--dry-run",summary:"Run team knowledge build without writing generated runtime cache files."},{flag:"--write",summary:"Write team knowledge generated cache files under .atm/runtime/knowledge."},{flag:"--query",value:"text",summary:"Literal advisory query text for team knowledge query."},{flag:"--top",value:"n",summary:"Maximum advisory team knowledge hits to return."},{flag:"--repo",value:"name",summary:"Team knowledge metadata filter."},{flag:"--channel",value:"name",summary:"Team knowledge metadata filter."},{flag:"--domain",value:"name",summary:"Team knowledge metadata filter."},{flag:"--path",value:"glob",summary:"Team knowledge metadata path filter."},{flag:"--atom",value:"id",summary:"Team knowledge metadata atom filter."},{flag:"--validator",value:"command",summary:"Team knowledge metadata validator filter."},{flag:"--wave",value:"id",summary:"For team wave plan/dispatch: deterministic wave id from the batch selector."},{flag:"--worker-report",value:"path",repeatable:!0,summary:"For team wave dispatch: worker report JSON to reconcile into the executor-neutral runtime result."},G,H,W]},XPe={summary:"Plan examples for minimal crew briefing contract output (TASK-TEAM-0002 owns team.plan-crew-briefing-contract).",examples:["node atm.mjs team plan --task TASK-TEAM-0002 --json"]},ZPe={summary:"Plan examples for atomization planner advisory output (TASK-TEAM-0003 owns team.plan-atomization-planner).",examples:["node atm.mjs team plan --task TASK-TEAM-0003 --json"]},eMe={summary:"Plan examples for the TASK-TEAM-0009 dry-run resolver output, including the team implementer selector and atm.teamPlan.v1 evidence surface.",examples:["node atm.mjs team plan --task TASK-TEAM-0009 --json"]},tMe={summary:"Plan examples for deterministic role and implementer selection output with language, role, fallback, and confidence signals (TASK-TEAM-0010 owns the selector surface).",examples:["node atm.mjs team plan --task TASK-TEAM-0010 --json"]},rMe={summary:"Validate recipe permissions and scoped file.write leases before team start (TASK-TEAM-0012 owns structured permission lease findings; TASK-TEAM-0013 owns file.write scope checks).",examples:["node atm.mjs team validate --task TASK-TEAM-0013 --json","node atm.mjs team validate --task TASK-TEAM-0012 --json","node atm.mjs team validate --task TASK-AAO-0005 --recipe atm.default.normal.typescript --json"]},oMe={summary:"Team lease fencing and deadlock contract diagnostics cover duplicate exclusive owners, stale lease epochs, wait-for cycles, released tombstones, and allowedFiles write boundaries across real-agent, editor-subagent, and broker-only runs.",examples:["node --strip-types scripts/validate-team-agents.ts --case fencing-deadlock","node --strip-types scripts/validate-team-agents.ts --case active-resource-index-readonly"]},aMe={summary:"Plan/start claim-gate parity: team start fails closed when the normal task claim dependency gate would reject the task (TASK-TEAM-0029).",examples:["node atm.mjs team plan --task TASK-TEAM-0029 --json","node atm.mjs team start --task TASK-TEAM-0029 --actor codex-main --json"]},nMe={summary:"Plan examples for captain decision dry-run output that includes team sizing, confidence, and stop conditions (TASK-TEAM-0007 owns the decision surface).",examples:["node atm.mjs team plan --task TASK-TEAM-0007 --json"]},sMe={summary:"Plan examples for lieutenant escalation dry-run output that includes escalationRequired, escalationReason, needLieutenant, nextTeamShape, and the broker-over-coordinator authority chain (TASK-TEAM-0008 owns the escalation surface).",examples:["node atm.mjs team plan --task TASK-TEAM-0008 --json"]},iMe={summary:"Start and inspect a team runtime record with neutral runtime mode, adapter metadata, serialized commit lane, and broker subagent status fields (TASK-TEAM-0011 owns status; TASK-TEAM-0031 owns runtime contract fields).",examples:["node atm.mjs team start --task TASK-TEAM-0011 --actor codex-main --json","node atm.mjs team start --task TASK-TEAM-0031 --actor codex-main --runtime-mode broker-only --runtime-adapter atm.node.broker --json","node atm.mjs team start --task TASK-TEAM-0032 --actor codex-main --runtime-mode editor-subagent --runtime-adapter codex.desktop.subagent --json","node atm.mjs team start --task TASK-TEAM-0041 --actor codex-main --provider openai --sdk responses --model gpt-5-mini --json","node atm.mjs team status --compact --json"]},cMe={summary:"Read-only Team patrol report for runtime mode, broker-governance drift, rework readiness, missing artifacts, retry-budget risk, and close/claim preflight guidance (TASK-TEAM-0014).",examples:["node atm.mjs team patrol --task TASK-TEAM-0014 --json","node atm.mjs team patrol --task TASK-TEAM-0014 --mode close-preflight --json","node atm.mjs team patrol --task TASK-TEAM-0014 --team <teamRunId> --json"]},lMe={summary:"Advisory next/playbook teamRecommendation surface with plan/start/status/reason command hints without auto-running team commands (TASK-TEAM-0015).",examples:["node atm.mjs next --task TASK-TEAM-0015 --json","node atm.mjs team plan --task TASK-TEAM-0015 --json"]},dMe={summary:"Advisory Team knowledge build/query surface. Build discovers canonical .atm/knowledge shards; query and team plan expose compact Captain-facing hits from generated runtime cache without becoming a task gate.",examples:["node atm.mjs team knowledge build --scope project --dry-run --json","node atm.mjs team knowledge query --task TASK-AAO-0005 --top 5 --json","node atm.mjs team plan --task TASK-AAO-0005 --json"]},N5=q({...QPe,examples:[...XPe.examples,...ZPe.examples,...eMe.examples,...tMe.examples,...nMe.examples,...sMe.examples,...rMe.examples,...oMe.examples,...aMe.examples,...iMe.examples,...cMe.examples,...lMe.examples,...dMe.examples]})});var q5,G5=y(()=>{"use strict";_();ce();q5=q({name:"validate",summary:"Run repository, framework-development, taxonomy, or atomic spec validation checks.",positional:[{name:"validation-name",summary:"Optional named validation such as atom-callsite-readability, framework-development, or taxonomy.",required:!1}],options:[z,{flag:"--repo",value:"path",summary:"Repository path for named validation checks."},{flag:"--files",value:"csv",summary:"Optional declared file scope for framework-development validation."},{flag:"--target-repo",value:"path",summary:"Optional cross-repo target repository path for framework-development validation."},{flag:"--spec",value:"path",summary:"Validate a specific atomic spec path."},{flag:"--task",value:"id",summary:"Optional task id to query validator scope taxonomy for touched files."},G,H,W],examples:["node atm.mjs validate --json","node atm.mjs validate --spec tests/schema-fixtures/positive/hello-world.atom.json --json","node atm.mjs validate atom-callsite-readability --repo . --json","node atm.mjs validate framework-development --repo . --json","node atm.mjs validate framework-development --repo . --target-repo ../AI-Atomic-Framework --json","node atm.mjs validate taxonomy --task TASK-MAO-0042 --json"]})});var H5,W5=y(()=>{"use strict";_();ce();H5=q({name:"welcome",summary:"Summarize ATMChart, integration health, and the next ATM action for first-touch onboarding.",positional:[],options:[z,{flag:"--dry-run",summary:"Preview welcome output without writing welcome lineage."},G,H,W],examples:["node atm.mjs welcome --cwd . --json","node atm.mjs welcome --cwd . --dry-run --json"]})});var U5,V5=y(()=>{"use strict";_();ce();U5=q({name:"verify",summary:"Run verification checks for self hashes, neutrality, or AGENTS.md.",options:[z,{flag:"--self",summary:"Verify seed self-verification hashes."},{flag:"--neutrality",summary:"Verify protected-surface neutrality."},{flag:"--agents-md",summary:"Verify AGENTS bootstrap guidance contracts."},G,H,W],examples:["node atm.mjs verify --self --json","node atm.mjs verify --neutrality --json","node atm.mjs verify --agents-md --json"]})});var z5,K5=y(()=>{"use strict";_();ce();z5=q({name:"registry",summary:"Backfill adopter-owned registry lineage from verified evidence.",positional:[{name:"area",summary:"Registry area. Currently: lineage.",required:!0},{name:"action",summary:"Lineage action. Currently: backfill.",required:!0}],options:[z,{flag:"--atom",value:"atom-id",summary:"Adopter-owned atom member to backfill."},{flag:"--from",value:"version",summary:"Source version for registry-diff validation."},{flag:"--to",value:"version",summary:"Target version for registry-diff validation."},{flag:"--map",value:"map-id",summary:"Owning atomic map id."},{flag:"--registry",value:"path",summary:"Registry document path. Defaults to atomic-registry.json."},{flag:"--lineage-log",value:"path",summary:"Map lineage log carrying the member versionLineage evidence."},{flag:"--equivalence",value:"path",summary:"Passing map equivalence report evidence."},{flag:"--propagation",value:"path",summary:"Passing propagation report evidence."},{flag:"--review",value:"path",summary:"Review advisory report evidence."},{flag:"--review-advisory",value:"path",summary:"Alias for --review."},{flag:"--human-review",value:"path",summary:"Approved human review decision evidence."},{flag:"--actor",value:"id",summary:"Actor recorded in closeout evidence."},{flag:"--at",value:"iso-date",summary:"Deterministic timestamp for patch and closeout evidence."},{flag:"--dry-run",summary:"Emit the deterministic patch without mutating host files."},{flag:"--apply",summary:"Apply the lineage backfill after all required evidence validates."},G,H,W],examples:["node atm.mjs registry lineage backfill --atom ATM-NPCBRAIN-0002 --from 0.1.0 --to 0.1.1 --map ATM-MAP-0001 --lineage-log atomic_workbench/maps/ATM-MAP-0001/lineage-log.json --dry-run --json","node atm.mjs registry lineage backfill --atom ATM-NPCBRAIN-0002 --from 0.1.0 --to 0.1.1 --map ATM-MAP-0001 --lineage-log atomic_workbench/maps/ATM-MAP-0001/lineage-log.json --equivalence atomic_workbench/maps/ATM-MAP-0001/map.equivalence.report.json --propagation atomic_workbench/maps/ATM-MAP-0001/propagation.report.json --review atomic_workbench/maps/ATM-MAP-0001/review-advisory.report.json --human-review atomic_workbench/maps/ATM-MAP-0001/human-review.decision.json --apply --json"]})});var J5,Y5=y(()=>{"use strict";_();ce();J5=q({name:"registry-diff",summary:"Generate version hash diff report for a registry atom.",positional:[{name:"atom-id",summary:"Atom id to compare.",required:!0}],options:[{flag:"--from",value:"version",summary:"Source version."},{flag:"--to",value:"version",summary:"Target version."},{flag:"--registry",value:"path",summary:"Optional registry document path."},{flag:"--reason",value:"text",summary:"Optional drift reason annotation."},G,H,W],examples:["node atm.mjs registry-diff ATM-CORE-0001 --from 1.0.0 --to 1.1.0 --json"]})});var Q5,X5=y(()=>{"use strict";_();ce();Q5=q({name:"replacement-lane",summary:"Advance a map through the explicit replacement rollout lane.",positional:[{name:"action",summary:"transition",required:!1}],options:[z,{flag:"--map",value:"id",summary:"Target map id."},{flag:"--to",value:"mode",summary:"Next replacement mode: shadow | canary | active | legacy-retired."},{flag:"--evidence",value:"path",summary:"Evidence path or reference for the transition.",repeatable:!0},{flag:"--reason",value:"text",summary:"Optional reason recorded in the lineage transition log."},{flag:"--actor",value:"name",summary:"Optional actor label for the transition log."},{flag:"--at",value:"timestamp",summary:"Optional timestamp override for the transition log."},G,H,W],examples:["node atm.mjs replacement-lane transition --map ATM-MAP-0001 --to shadow --evidence atomic_workbench/maps/ATM-MAP-0001/map.test.report.json --json","node atm.mjs replacement-lane transition --map ATM-MAP-0001 --to active --evidence atomic_workbench/maps/ATM-MAP-0001/map.equivalence.report.json --evidence .atm/history/reports/review-advisory.json --json"]})});var Z5,e8=y(()=>{"use strict";_();ce();Z5=q({name:"rollback",summary:"Plan or apply rollback for atom/map registry targets.",options:[z,{flag:"--plan",summary:"Prepare rollback proof preview without applying."},{flag:"--apply",summary:"Apply rollback and persist proof artifacts."},{flag:"--target",value:"kind",summary:"Target kind: atom | map."},{flag:"--atom",value:"id",summary:"Target atom id."},{flag:"--map",value:"id",summary:"Target map id."},{flag:"--map-owner",value:"id",summary:"Map owner atom id override."},{flag:"--to",value:"version",summary:"Rollback destination version."},{flag:"--behavior",value:"id",summary:"Behavior id for rollback evidence."},{flag:"--registry",value:"path",summary:"Registry file path."},{flag:"--proof",value:"path",summary:"Success proof output path."},{flag:"--failure-proof",value:"path",summary:"Failure proof output path."},{flag:"--by",value:"name",summary:"Decision author label."},{flag:"--at",value:"timestamp",summary:"Verification timestamp."},G,H,W],examples:["node atm.mjs rollback --plan --atom ATM-CORE-0001 --to 1.0.0 --json","node atm.mjs rollback --apply --atom ATM-CORE-0001 --to 1.0.0 --json"]})});var t8,r8=y(()=>{"use strict";_();ce();t8=q({name:"review",summary:"List, inspect, approve, reject, or materialize apply-ready / rollout-ready packets for upgrade proposals.",positional:[{name:"action",summary:"list | show | approve | reject | apply-ready | rollout-ready",required:!1},{name:"proposal-id",summary:"Proposal id for show/approve/reject/apply-ready/rollout-ready.",required:!1}],options:[z,{flag:"--queue",value:"path",summary:"Human review queue JSON path."},{flag:"--projection",value:"path",summary:"Rendered markdown projection path."},{flag:"--decision-log",value:"path",summary:"Decision log JSON path."},{flag:"--reason",value:"text",summary:"Decision reason for approve/reject."},{flag:"--by",value:"name",summary:"Decision actor label."},{flag:"--at",value:"timestamp",summary:"Decision timestamp override."},G,H,W],examples:["node atm.mjs review list --json",'node atm.mjs review approve <proposal-id> --reason "approved" --json',"node atm.mjs review apply-ready <proposal-id> --json","node atm.mjs review rollout-ready <proposal-id> --json"]})});var o8,a8=y(()=>{"use strict";_();ce();o8=q({name:"agent-pack",summary:"Install, uninstall, diff, or list ATM agent packs.",positional:[{name:"action",summary:"install | uninstall | diff | list",required:!1}],options:[z,{flag:"--pack",value:"pack-id",summary:"Agent pack id for install/uninstall/diff."},{flag:"--dry-run",summary:"Preview install without writing files."},G,H,W],examples:["node atm.mjs agent-pack list --json","node atm.mjs agent-pack install --pack claude-code --dry-run --json","node atm.mjs agent-pack install --pack claude-code --json","node atm.mjs agent-pack diff --pack claude-code --json","node atm.mjs agent-pack uninstall --pack claude-code --json"]})});var n8,s8=y(()=>{"use strict";_();ce();n8=q({name:"review-advisory",summary:"Generate non-blocking semantic advisory findings.",options:[z,{flag:"--mode",value:"mode",summary:"stub | agent-bridge | external-cli"},{flag:"--stub-profile",value:"profile",summary:"pass | warn | unavailable"},{flag:"--out",value:"path",summary:"Advisory report output path."},{flag:"--report-id",value:"id",summary:"Advisory report id override."},{flag:"--target-kind",value:"kind",summary:"atom | map | proposal | diff | scope"},{flag:"--target-id",value:"id",summary:"Target identifier for advisory context."},{flag:"--source-path",value:"path",summary:"Source path to annotate (repeatable)."},{flag:"--provider-response",value:"path",summary:"JSON provider response for agent-bridge mode."},{flag:"--provider-cmd",value:"command",summary:"External provider command for external-cli mode."},{flag:"--machine-findings",value:"path",summary:"Optional machine findings JSON file."},{flag:"--queue",value:"path",summary:"Optional queue path for supplemental context."},{flag:"--proposal-id",value:"id",summary:"Optional proposal id for supplemental context."},G,H,W],examples:["node atm.mjs review-advisory --mode stub --stub-profile pass --json"]})});var i8,c8=y(()=>{"use strict";_();ce();i8=q({name:"taskflow",summary:"Official operator lane for governed task open and close. taskflow open is the normal opener lane; its dry-run returns a writeReadinessHint that names exactly what is missing when --write would fail closed, names the planning card, target repository, and next dry-run/import commands, and warns with ATM_TASK_ID_FAMILY_DRIFT when a new task family duplicates an existing semantic family. taskflow pre-close is the read-only first checkpoint before historical close --write; it reports scopeTrackedDirtyFiles, unexpectedStagedTasks, mixedDeliveryCommit, staleEvidence, autoEvidencePlan, and missingApprovalLease without mutating the worktree. taskflow close expands directory-style deliverables into explicit file manifests before metadata validation and stages optional evidence bundle manifests when present; it enforces validator scope taxonomy for close gates. taskflow close --write acquires an exclusive close-window staged-index lock before staging, blocks competing stage operations, and releases the lock on commit, rollback, or abort while surfacing closeWriteTransaction phase pending, committed, or rolled_back in JSON. taskflow close --auto-evidence runs missing declared validators through evidence run before backend close; explicit evidence --validators remains an override. Use task-view for a single-task read-only dashboard (status, evidence blockers, close completion checklist, next safe command) without replacing next routing. tasks new is a low-level template generator surface (no governed lifecycle). tasks import is the runtime synchronization surface (backend). Direct tasks close, tasks reconcile, tasks repair-closure are protected backend / emergency surfaces and must not be used as normal operator paths.",positional:[{name:"action",summary:"open | close | pre-close | abandon | status",required:!0}],options:[z,{flag:"--dry-run",summary:"Return the orchestration plan without writing. Default when --write is omitted."},{flag:"--write",summary:"Run the governed orchestration entry when prerequisites are satisfied; otherwise fail closed."},{flag:"--detach",summary:"For close --write: return one CLOSE_STARTED line after a durable child acknowledgement. Started is not committed."},{flag:"--status",summary:"For close: read a specific --attempt and print one result line."},{flag:"--wait",summary:"For close: wait for a specific --attempt and print one result line."},{flag:"--attempt",value:"id",summary:"Close attempt ID returned by --detach; required for --status/--wait."},{flag:"--timeout-ms",value:"ms",summary:"Maximum --wait duration in milliseconds (default 30000); a timeout never implies commit."},{flag:"--no-commit",summary:"For taskflow close --write: exact-stage the target and planning repo bundle, but do not commit. Auto-commit is on by default."},{flag:"--profile",value:"path",summary:"Path to the taskflow profile JSON file."},{flag:"--task",value:"id",summary:"Task id for taskflow close orchestration."},{flag:"--actor",value:"id",summary:"Actor id required for taskflow close --write."},{flag:"--task-id",value:"id",summary:"Explicit task id forwarded to the tasks new generation surface during governed open write."},{flag:"--output",value:"path",summary:"Explicit markdown output path forwarded to the tasks new generation surface during governed open write."},{flag:"--template",value:"name",summary:"Template key forwarded to tasks new (default: aao-l2-split)."},{flag:"--goal",value:"text",summary:"One-paragraph goal written into a built-in opener task card."},{flag:"--scope-path",value:"csv",summary:"Files the task may change (built-in opener; required for --write)."},{flag:"--validator",value:"csv",summary:"Commands that prove the task (built-in opener; required for --write)."},{flag:"--title",value:"text",summary:"Optional title forwarded to tasks new."},{flag:"--roster-index",value:"path",summary:"Optional roster README path override for roster sync policy."},{flag:"--historical-delivery",value:"commit",summary:"For taskflow close: verify an earlier delivery commit through tasks close or reconcile.",repeatable:!0},{flag:"--delivery-commit",value:"commit",summary:"Alias for --historical-delivery on taskflow close."},{flag:"--historical-batch",value:"batchId-or-path",summary:"For taskflow close: consume a task slice produced by evidence historical-batch, reuse its matched delivery commits, and treat the slice as the operator close-readiness source."},{flag:"--waiver-out-of-scope-delivery",summary:"For taskflow close with historical delivery or historical batch: allow a multi-task delivery commit when this task slice has matched deliverables; requires --reason."},{flag:"--waive-out-of-scope",summary:"Alias for --waiver-out-of-scope-delivery."},{flag:"--defer-foreign-staged",summary:"For taskflow close --write: snapshot and unstage foreign task governance files in the index before acquiring the close-window staged-index lock."},{flag:"--defer-governance-dirty",summary:"For taskflow close --write: snapshot, temporarily restore, and then reapply deferrable governance dirty files such as git-head evidence."},{flag:"--defer-foreign-state",summary:"Alias for --defer-foreign-staged plus --defer-governance-dirty."},{flag:"--auto-evidence",summary:"For taskflow close --write: auto-run missing task-card declared validators through evidence run before backend close. Dry-run and pre-close always expose autoEvidencePlan when --actor is supplied; --validators on evidence run remains an override for extra evidence."},{flag:"--emergency-approval",value:"leaseId",summary:"For taskflow close: forward a human-approved protected backend lease when the orchestrator must perform stale-runner recovery."},{flag:"--reason",value:"text",summary:"Required explanation for --waiver-out-of-scope-delivery; recorded in the recovery receipt for --recover/--abort."},{flag:"--recover",summary:"For taskflow close: recover an interrupted close whose holder is gone. Marks a landed close completed, or rolls a consistent staged close forward through the governed commit, then releases the close-window lock. Dry-run unless --write."},{flag:"--abort",summary:"For taskflow close: abort an interrupted close whose holder is gone. Unstages and archives the close artifacts, restores the ledger and planning card, and releases the close-window lock with a recovery receipt. Refused once the close landed. Dry-run unless --write."},{flag:"--stale-after-ms",value:"ms",summary:"For taskflow close --recover/--abort: how old a close-window lock without a live holder lease must be before it is treated as stale (default 120000)."},G,H,W],examples:['node atm.mjs taskflow abandon --task TASK-ADOPTER-0002 --actor codex-main --reason "User dropped the request" --write --json',"node atm.mjs taskflow open --dry-run --json","node atm.mjs taskflow open --dry-run --profile planning/taskflow.profile.json --json","node atm.mjs taskflow open --write --profile planning/taskflow.profile.json --task-id TASK-ADOPTER-0002 --output tasks/TASK-ADOPTER-0002.task.md --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --dry-run --json","node atm.mjs taskflow pre-close --task TASK-ADOPTER-0001 --actor codex-main --historical-delivery abc123 --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --historical-delivery abc123 --write --json",'node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --historical-batch hist-batch-2026-06-16T10-00-00-000Z --waiver-out-of-scope-delivery --reason "multi-task historical delivery" --write --json',"node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --historical-batch hist-batch-2026-06-16T10-00-00-000Z --dry-run --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --historical-batch hist-batch-2026-06-16T10-00-00-000Z --write --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --defer-foreign-staged --write --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --defer-foreign-state --write --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --recover --json",'node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --abort --reason "close process died mid-transaction" --write --json',"node atm.mjs taskflow status --task TASK-ADOPTER-0001 --json"],help:{audience:"agent",requiredFlagSets:[{when:"Pre-close or close one task",flags:["--task"]},{when:"taskflow close --write",flags:["--task","--actor","--write"]},{when:"Waiving mixed historical delivery",flags:["--waiver-out-of-scope-delivery","--reason"]}],relatedCommands:["node atm.mjs task-view --task TASK-ABC-0001 --json",'node atm.mjs evidence run --task TASK-ABC-0001 --actor <actor-id> --command "<validator>" --json',"node atm.mjs next --claim --task TASK-ABC-0001 --actor <actor-id> --auto-intent --json"],commonMistakes:["Jumping straight to --write without reading pre-close or dry-run readiness first.","Minting a new task id family before scanning existing task-card families; taskflow open reports ATM_TASK_ID_FAMILY_DRIFT when the semantic family already exists.","Staging competing governance files while taskflow close --write owns the close-window staged-index lock.","Using direct tasks close/reconcile as a shortcut for the normal operator lane."],playbookNotes:["Use taskflow pre-close as the first read-only checkpoint before historical close --write.","When validators are missing, taskflow close --auto-evidence can run the declared validators through evidence run before backend close.","Use task-view when you need a single-task close checklist without mutating runtime state."],maintainerNotes:["Directory-style deliverables expand into explicit file manifests during closeback validation, so scope drift is visible before commit."]}})});var ZD,eF=y(()=>{"use strict";_();ce();ZD=q({name:"task-view",summary:"Read-only task dashboard that unifies status triangulation, evidence blockers, close completion checklist, and the next safe operator command. task-view does not claim, repair, close, or route work; use next for deterministic routing and taskflow for governed open/close.",options:[z,{flag:"--task",value:"id",summary:"Task id to inspect."},{flag:"--actor",value:"id",summary:"Optional actor id for evidence freshness checks and pre-close command hints."},G,H,W],examples:["node atm.mjs task-view --task TASK-MAO-0044 --json","node atm.mjs task-view --task TASK-MAO-0044 --actor cursor-gpt-5.2 --pretty"]})});var l8,d8=y(()=>{"use strict";_();ce();l8=q({name:"broker",summary:"Manage write intents, proposal capsules, compose merge plans, runtime activation, steward apply, parallel admission policy, and inspect the local write-broker registry.",positional:[{name:"action",summary:"register | decision | status | release | cleanup | proposal | compose | steward | runtime | runner-sync | projection | plan-batch | schedule | batch | parallel-admission | replay | heat-status | heat-reset | post-compose-semantic-validation | claim",required:!0},{name:"proposal-action",summary:"create | list | show | validate",required:!1},{name:"steward-action",summary:"plan | apply | apply-live",required:!1},{name:"runtime-action",summary:"activate",required:!1},{name:"parallel-admission-action",summary:"status | set | trip | reset",required:!1},{name:"replay-action",summary:"status | run | dogfood",required:!1},{name:"claim-action",summary:"init | release | status (omit to claim --files)",required:!1},{name:"proposal-id",summary:"Proposal id for show / validate.",required:!1}],options:[z,{flag:"--task",value:"id",summary:"Task ID to register or release."},{flag:"--actor",value:"id",summary:"Actor id for register payload parity checks or runtime activate."},{flag:"--intent-file",value:"path",summary:"Path to WriteIntent JSON payload."},{flag:"--queue-ticket",value:"id",summary:"Explicitly revalidate an eligible native serial ticket using the unchanged scope and current repository HEAD."},{flag:"--ttl-seconds",value:"number",summary:"TTL lease duration in seconds for registering write intent (broker claim defaults to 900)."},{flag:"--files",value:"a,b",summary:"Comma-separated files for broker claim / broker claim release. Repeatable."},{flag:"--sealed-source-sha",value:"sha",summary:"Sealed source SHA for broker runner-sync enqueue."},{flag:"--surface",value:"path",summary:"Release surface path for broker runner-sync enqueue, or file path for broker heat-reset. Repeatable."},{flag:"--steward-work-id",value:"id",summary:"Runner-sync steward work id to release after one coalesced build."},{flag:"--receipt-ref",value:"path",summary:"Runner-sync build/publication receipt path used when releasing a steward entry or reconciling one verified stale receipt."},{flag:"--receipt-digest",value:"sha256",summary:"Runner-sync build/publication receipt digest used when releasing a steward entry."},{flag:"--projection-key",value:"key",summary:"Generated projection key for broker projection enqueue."},{flag:"--wave",value:"id",summary:"Wave id for broker schedule enqueue or plan."},{flag:"--surface-kind",value:"kind",summary:"Broker schedule surface kind: commit, build, runner-sync, projection, or checkpoint."},{flag:"--surface-family",value:"family",summary:"Broker schedule compatible surface family."},{flag:"--payload-digest",value:"digest",summary:"Broker schedule payload digest used in idempotency keys, or source digest for build/projection batch execution."},{flag:"--manifest-digest",value:"digest",summary:"Wave manifest digest for broker batch write receipts."},{flag:"--current-head",value:"sha",summary:"Current HEAD SHA observed by broker batch execute."},{flag:"--expected-head",value:"sha",summary:"Expected HEAD SHA for stale-head rejection in broker batch execute."},{flag:"--expected-task",value:"id",summary:"Expected task id for broker schedule plan. Repeatable."},{flag:"--claimed-task",value:"id",summary:"Task id with claim evidence for broker batch execute. Repeatable."},{flag:"--validator-task",value:"id",summary:"Task id with validator evidence for broker batch execute. Repeatable."},{flag:"--file-slice",value:"task:path",summary:"Task-owned file slice for shared delivery commit receipts. Repeatable."},{flag:"--command-manifest",value:"path",summary:"atm.commandManifest.v1 JSON used for shellless generated build/projection execution."},{flag:"--collection-timeout-ms",value:"ms",summary:"Broker schedule collection timeout before reseal or serial fallback."},{flag:"--source-item",value:"path",summary:"Source item shard for broker projection enqueue. Repeatable."},{flag:"--candidate-file",value:"path",summary:"Exact composed candidate JSON for post-compose semantic validation."},{flag:"--proposal-file",value:"path",summary:"Path to PatchProposal JSON payload. Repeatable for compose / steward."},{flag:"--proposal-id",value:"id",summary:"Proposal id for compose / steward or proposal show / validate."},{flag:"--persist-merge-plan",summary:"Persist a broker-computed compose plan to its canonical runtime path; compose is read-only unless this flag is present."},{flag:"--merge-plan-file",value:"path",summary:"Path to MergePlan JSON payload for steward plan / apply."},{flag:"--scope-file",value:"path",summary:"Scoped file-write target allowed for steward apply or runtime activate. Repeatable."},{flag:"--ack-overlap",value:"proposalId",summary:"steward apply-live: explicitly override another session's committed lines named by a cross-session-overlap rejection. Repeatable or comma-separated."},{flag:"--steward-id",value:"id",summary:"Neutral write steward identifier."},{flag:"--evidence-out",value:"path",summary:"Output path for steward apply or runtime activation evidence JSON."},{flag:"--run-evidence-dir",value:"path",summary:"Directory to write broker batch run records (default: .atm/runtime/broker-collision-evidence/runs, resolved against --cwd)."},{flag:"--mode",value:"mode",summary:"Parallel admission policy mode: enforce or observe."},{flag:"--fallback-mode",value:"mode",summary:"Parallel admission fallback mode: queue-only or fail-closed."},{flag:"--circuit-breaker",value:"boolean",summary:"Enable or disable the parallel admission circuit breaker."},{flag:"--reason",value:"text",summary:"Reason for broker parallel-admission trip."},{flag:"--store",value:"path",summary:"Path to broker proposal store JSON."},G,H,W],examples:["node atm.mjs broker register --task TASK-GOV-0100 --actor worker-1 --intent-file intent.json --json","node atm.mjs broker decision --intent-file intent.json --json","node atm.mjs broker status --json","node atm.mjs broker release --task TASK-GOV-0100 --json","node atm.mjs broker cleanup --json","node atm.mjs broker runner-sync enqueue --task TASK-GOV-0100 --actor worker-1 --sealed-source-sha <sha> --surface release/atm-onefile/atm.mjs --json","node atm.mjs broker runner-sync supersede --task TASK-GOV-0100 --actor worker-1 --sealed-source-sha <sha> --surface release/atm-onefile/atm.mjs --json","node atm.mjs broker runner-sync release --task TASK-GOV-0100 --steward-work-id runner-sync-1234abcd --receipt-ref .atm/history/evidence/TASK-GOV-0100.runner-sync-receipt.json --json","node atm.mjs broker runner-sync reconcile-receipt --task TASK-GOV-0100 --actor worker-1 --receipt-ref .atm/history/evidence/TASK-GOV-0099.runner-sync-receipt.json --json","node atm.mjs broker runner-sync takeover-publication --task TASK-GOV-0100 --actor worker-1 --sealed-source-sha <sha> --surface full --json","node atm.mjs broker projection enqueue --task TASK-GOV-0100 --actor worker-1 --projection-key atm.generated-projection.governance-backlog --source-item docs/governance/atm-bug-and-optimization-backlog.items/ATM-BUG-YYYY-MM-DD-NNN.json --json","node atm.mjs broker schedule enqueue --task TASK-GOV-0100 --wave wave-123 --surface-kind commit --surface-family cli --payload-digest sha256:abc --json","node atm.mjs broker schedule plan --wave wave-123 --surface-kind commit --surface-family cli --expected-task TASK-GOV-0100 --expected-task TASK-GOV-0101 --json","node atm.mjs broker batch execute --surface commit --wave wave-123 --surface-family cli --manifest-digest sha256:abc --sealed-source-sha <sha> --claimed-task TASK-GOV-0100 --validator-task TASK-GOV-0100 --scope-file src/a.ts --evidence-out .atm/history/evidence/wave-123.shared-write.json --json","node atm.mjs broker batch execute --surface build --wave wave-123 --surface-family cli --manifest-digest sha256:abc --sealed-source-sha <sha> --payload-digest sha256:source --command-manifest command-manifest.json --output-file dist/out.json --evidence-out .atm/history/evidence/wave-123.build.json --json","node atm.mjs broker proposal create --proposal-file proposal.json --json","node atm.mjs broker proposal list --json","node atm.mjs broker proposal show proposal-123 --json","node atm.mjs broker proposal validate proposal-123 --json","node atm.mjs broker compose --proposal-file proposal-a.json --proposal-file proposal-b.json --json","node atm.mjs broker compose --store .atm/runtime/broker-proposals.json --proposal-id proposal-a --proposal-id proposal-b --json","node atm.mjs broker compose --store .atm/runtime/broker-proposals.json --proposal-id proposal-a --proposal-id proposal-b --persist-merge-plan --json","node atm.mjs broker runtime activate --task TASK-GOV-0100 --actor team-planner --scope-file src/target.ts --json","node atm.mjs broker runtime activate --task TASK-GOV-0100 --actor team-planner --merge-plan-file merge-plan.json --proposal-file proposal.json --scope-file src/target.ts --evidence-out runtime-evidence.json --json","node atm.mjs broker steward plan --merge-plan-file merge-plan.json --proposal-file proposal.json --scope-file src/target.ts --json","node atm.mjs broker steward apply --merge-plan-file merge-plan.json --proposal-file proposal.json --scope-file src/target.ts --evidence-out steward-evidence.json --json","node atm.mjs broker steward apply-live --proposal-file proposal.json --scope-file src/target.ts --json","node atm.mjs broker plan-batch --request-file tmp/request-a.json --request-file tmp/request-b.json --apply --run-evidence-dir .atm/runtime/broker-collision-evidence/runs --json","node atm.mjs broker parallel-admission status --json","node atm.mjs broker parallel-admission set --mode enforce --fallback-mode queue-only --json",'node atm.mjs broker parallel-admission trip --actor worker-1 --reason "shared-write gate failed" --json',"node atm.mjs broker parallel-admission reset --actor worker-1 --receipt-digest sha256:<digest> --json","node atm.mjs broker replay status --json","node atm.mjs broker replay run --json","node atm.mjs broker replay dogfood --surface docs/governance/atm-3-replay-evidence.md --json","node atm.mjs broker claim init --json","node atm.mjs broker claim --files src/a.ts,src/b.ts --actor worker-1 --json","node atm.mjs broker claim status --json","node atm.mjs broker claim release --actor worker-1 --json","node atm.mjs broker heat-status --json","node atm.mjs broker heat-reset --actor worker-1 --surface packages/core/src/broker/team-lane.ts --json"]})});var m8,u8=y(()=>{"use strict";_();ce();m8=q({name:"route",summary:"Manage MAO route lifecycle records and legacy steward takeover. route pause exercises the broker freeze protocol and records a metadata-only patch envelope handoff sidecar; route handoff validates or compares envelopes without worktree apply. Worktree patch apply remains out of scope.",positional:[{name:"action",summary:"open | status | list | pause | resume | abandon | handoff | takeover",required:!0}],options:[z,{flag:"--route",value:"id",summary:"Route context id for status, pause, resume, abandon, or handoff."},{flag:"--route-id",value:"id",summary:"Explicit route context id when opening a route."},{flag:"--task",value:"id",summary:"Task id for route open."},{flag:"--actor",value:"id",summary:"Actor id for route open or lifecycle transition."},{flag:"--claim-intent",value:"intent",summary:"Route claim intent: read, write, review, steward, or release-sync."},{flag:"--read-set",value:"csv",summary:"Comma-separated declared read files."},{flag:"--write-set",value:"csv",summary:"Comma-separated declared write files."},{flag:"--atom-cids",value:"csv",summary:"Comma-separated target atom CIDs."},{flag:"--virtual-atom-cids",value:"csv",summary:"Comma-separated target virtual atom CIDs."},{flag:"--patch-envelope-ref",value:"ref",summary:"Optional patch envelope file for route handoff compare."},{flag:"--reason",value:"text",summary:"Reason for pause, resume, abandon, or handoff."},{flag:"--admission-rechecked",summary:"For route resume: confirm broker admission was re-checked before continuing after a freeze."},{flag:"--ttl-seconds",value:"seconds",summary:"Route lease TTL in seconds."},{flag:"--max-seconds",value:"seconds",summary:"Route lease maximum lifetime in seconds."},{flag:"--merge-plan-file",value:"path",summary:"Path to merge plan file."},{flag:"--proposal-file",value:"path",summary:"Path to patch proposal file."},{flag:"--steward-id",value:"name",summary:"Steward identity name."},{flag:"--evidence-out-path",value:"path",summary:"Path to save apply evidence."},{flag:"--scope-files",value:"csv",summary:"Comma-separated scoped files."},G,H,W],examples:["node atm.mjs route open --task TASK-MAO-0003 --actor captain --write-set packages/cli/src/commands/route.ts","node atm.mjs route status --route route-TASK-MAO-0003-captain","node atm.mjs route pause --route route-TASK-MAO-0003-captain --actor captain --reason review","node atm.mjs route handoff --route route-TASK-MAO-0003-captain --actor captain --patch-envelope-ref .atm/runtime/routes/route-TASK-MAO-0003-captain.patch-envelope.json","node atm.mjs route resume --route route-TASK-MAO-0003-captain --actor captain --admission-rechecked","node atm.mjs route abandon --route route-TASK-MAO-0003-captain --actor captain --reason superseded","node atm.mjs route takeover --merge-plan-file plan.json --proposal-file prop.json"]})});var f8,p8=y(()=>{"use strict";_();ce();f8=q({name:"write-ticket",summary:"Acquire and check task-scoped write tickets before editor writes, record post-write touched paths, and classify scope amendment, unattached WIP, stale ticket, missing ticket, and true violation outcomes.",positional:[{name:"action",summary:"acquire | check | record-touch | status",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Task id that owns the requested write authority."},{flag:"--actor",value:"id",summary:"Actor id requesting or checking the write ticket."},{flag:"--files",value:"csv",summary:"Comma-separated files being acquired, checked, or recorded as touched."},{flag:"--file",value:"path",summary:"Single file alias for --files."},{flag:"--intent",value:"text",summary:"Ticket intent such as write, stage, commit, close, or push."},{flag:"--operation",value:"kind",summary:"Operation boundary: write | stage | commit | close | push."},{flag:"--observed",value:"phase",summary:"Observation phase: pre-write | post-write | commit | close | push."},{flag:"--ticket",value:"path",summary:"Path to an existing write-ticket JSON document for check/status."},{flag:"--ticket-file",value:"path",summary:"Alias for --ticket."},{flag:"--lane-session",value:"id",summary:"Lane session id to compare against ticket and claim authority."},{flag:"--lane-session-id",value:"id",summary:"Alias for --lane-session."},{flag:"--ttl-seconds",value:"seconds",summary:"Ticket TTL for acquire; defaults to 3600 seconds."},{flag:"--recovery-bypassed",summary:"Escalate unresolved out-of-scope evidence to true violation at delivery boundary."},G,H,W],examples:["node atm.mjs write-ticket acquire --task TASK-0001 --actor codex --files src/a.ts --intent write --json","node atm.mjs write-ticket check --task TASK-0001 --actor codex --ticket .atm/runtime/write-ticket.json --files src/a.ts --json","node atm.mjs write-ticket record-touch --task TASK-0001 --actor codex --ticket .atm/runtime/write-ticket.json --files src/b.ts --observed post-write --json","node atm.mjs write-ticket status --task TASK-0001 --actor codex --ticket .atm/runtime/write-ticket.json --files src/a.ts --json"]})});function jk(e,t="public"){return Object.freeze({...e,visibility:t})}function Nt(e){return e in tF?tF[e]:null}function rF(e={}){return Object.values(tF).filter(t=>e.includeInternal||t.visibility!=="internal")}var tF,aa=y(()=>{"use strict";UJ();zJ();JJ();QJ();ZJ();t6();o6();n6();i6();l6();m6();f6();h6();k6();I6();w6();A6();T6();R6();E6();P6();O6();F6();$6();N6();q6();H6();U6();z6();J6();Q6();Z6();t5();o5();n5();i5();l5();m5();f5();h5();k5();I5();w5();A5();T5();R5();E5();P5();XD();D5();j5();L5();B5();G5();W5();V5();K5();Y5();X5();e8();r8();a8();s8();c8();eF();d8();u8();p8();tF=Object.freeze({setup:a6,actor:WJ,"agent-pack":o8,"atom-capsule":jk(KJ,"internal"),"atom-ref":VJ,atomize:YJ,"atm-chart":g6,baseline:XJ,batch:e6,bootstrap:r6,budget:s6,cache:c6,cleanup:d6,candidates:u6,create:p6,"create-map":y6,daemon:jk(v6,"internal"),doctor:S6,emergency:b6,experience:C6,explain:K6,evidence:Y6,"framework-mode":X6,git:r5,"git-hooks":a5,guide:s5,guard:e5,handoff:c5,"health-report":jk(x6,"internal"),hook:d5,identity:_6,init:u5,"internal-release":p5,integration:g5,lane:y5,lock:v5,"map-capsule":jk(j6,"internal"),migrate:S5,next:b5,orient:M6,plan:D6,police:L6,quickfix:B6,residue:G6,rescue:jk(W6,"internal"),registry:z5,"registry-diff":J5,"replacement-lane":Q5,review:t8,"review-advisory":n8,rollback:Z5,"self-host-alpha":C5,spec:x5,start:V6,status:_5,tasks:QD,test:F5,telemetry:$5,team:N5,upgrade:O5,validate:q5,welcome:H5,verify:U5,taskflow:i8,"task-view":ZD,broker:l8,route:m8,"write-ticket":f8})});import{createHash as fMe}from"node:crypto";import{readFileSync as pMe}from"node:fs";import oF from"node:path";function Wr(e){return`sha256:${fMe("sha256").update(e).digest("hex")}`}function jd(e){return Wr(pMe(e))}function $k(e){return`${JSON.stringify(e,null,2)}
9
+ `,"utf8")}function YPe(e){return e.charCodeAt(0)===65279?e.slice(1):e}function tr(e){return JSON.parse(YPe(e))}function Tt(e,t,r,o){let a=e[t+1];if(!a||a.startsWith("--"))throw Fe(o,`${o} requires a value for ${r}`,{missingRequired:[r]});return a}var KPe,HJ=y(()=>{"use strict";Fk();KPe={doctor:["--ci-profile","--skip-check"],spec:["--spec","--validate"],verify:["--spec","--self","--neutrality","--agents-md","--guards","--evidence"],"self-host-alpha":["--verify","--agent"],next:["--spec","--claim","--tasks","--actor","--prompt","--planning-root","--intent","--task"],batch:["--batch","--scope","--compact","--hold","--actor","--reason","--task"],quickfix:["--actor","--prompt","--files","--reason"],init:["--spec","--dry-run","--adopt","--integration","--task"],bootstrap:["--spec","--task"],test:["--atom","--spec","--profile","--suite","--map","--equivalence-fixtures","--fingerprint-check","--edge-contracts","--propagate"],welcome:["--dry-run"],status:[],validate:["--spec"],integration:["--integration"],orient:["--full"]}});var _=y(()=>{"use strict";Fk();GJ();HJ()});var G,H,W,z,ce=y(()=>{"use strict";G={flag:"--json",summary:"Force machine-readable JSON output with the standard result contract (ok, severity, exitCode, blocking, diagnostics)."},H={flag:"--pretty",summary:"Force human-readable pretty output."},W={flag:"--help",alias:"-h",summary:"Show command help."},z={flag:"--cwd",value:"path",summary:"Run the command against a specific repository root."}});var WJ,UJ=y(()=>{"use strict";_();ce();WJ=q({name:"actor",summary:"Manage actor identity registry records and verify repo-local git identity alignment.",positional:[{name:"action",summary:"register | list | resolve | verify-git | adopt",required:!0}],options:[z,{flag:"--id",value:"id",summary:"Actor id. Required for register; optional for resolve/verify-git when env vars are set."},{flag:"--kind",value:"kind",summary:"Actor kind: human | ai-agent | automation."},{flag:"--name",value:"text",summary:"Display name for register / adopt."},{flag:"--provider",value:"text",summary:"Provider label (for example: OpenAI, Anthropic)."},{flag:"--editor",value:"text",summary:"Editor or host tool label (for example: codex, claude-code). Required for adopt."},{flag:"--model",value:"text",summary:"Model slug (for example: opus-4-7). Required for adopt; combined with --editor to form the slug."},{flag:"--session",value:"text",summary:"Optional session id recorded in runtime identity default for adopt."},{flag:"--git-name",value:"text",summary:"Expected git user.name. Defaults to the composed slug for adopt."},{flag:"--git-email",value:"text",summary:"Expected git user.email. Defaults to <slug>@atm.local for adopt."},{flag:"--contact",value:"text",summary:"Optional contact or owner channel."},{flag:"--capabilities",value:"csv",summary:"Comma-separated capability tags."},G,H,W],examples:['node atm.mjs actor register --id codex-main --kind ai-agent --name "Codex Main" --provider OpenAI --editor codex --git-name "Codex Agent" --git-email codex@example.local --json',"node atm.mjs actor list --json","node atm.mjs actor resolve --id codex-main --json","node atm.mjs actor verify-git --id codex-main --json","node atm.mjs actor adopt --editor claude-code --model opus-4-7 --kind ai-agent --json"]})});var VJ,zJ=y(()=>{"use strict";_();ce();VJ=q({name:"atom-ref",summary:"Generate and validate readable atom/map refs for runAtm callsites.",positional:[{name:"subcommand",summary:"sweep",required:!0}],options:[{flag:"--repo",value:"path",repeatable:!0,summary:"Repository path to scan and optionally update."},{flag:"--apply",summary:"Write generated refs, reports, and safe callsite rewrites."},G,H,W],examples:["node atm.mjs atom-ref sweep --repo . --json","node atm.mjs atom-ref sweep --apply --repo C:\\Users\\User\\AI-Atomic-Framework --json"]})});var KJ,JJ=y(()=>{"use strict";_();ce();KJ=q({name:"atom-capsule",summary:"Export, import, roll back, or inspect atom capsules in the capsule registry.",positional:[{name:"action",summary:"export | import | rollback | advisories",required:!0}],options:[z,{flag:"--atom",value:"id",summary:"Atom id to export."},{flag:"--name",value:"text",summary:"Human-readable name recorded in the capsule registry."},{flag:"--source",value:"path",summary:"Source file to package during export."},{flag:"--cid",value:"cid",summary:"Capsule content id for import or rollback."},{flag:"--payload",value:"base64",summary:"Compressed capsule payload for import."},{flag:"--no-vendor",summary:"Skip vendoring the imported bundle into the repository vendor directory."},{flag:"--previous-cid",value:"cid",summary:"Previous capsule cid to link when exporting a new revision."},{flag:"--source-ref",value:"text",summary:"Optional source reference recorded in the registry entry."},{flag:"--exported-by",value:"id",summary:"Actor or tool id recorded for the export event."},G,H,W],examples:["node atm.mjs atom-capsule export --atom ATM-CORE-0001 --source packages/core/src/index.ts --json","node atm.mjs atom-capsule import --cid atm:cid:abc123 --payload <base64> --json","node atm.mjs atom-capsule rollback --cid atm:cid:abc123 --json","node atm.mjs atom-capsule advisories --json"]})});var YJ,QJ=y(()=>{"use strict";_();ce();YJ=q({name:"atomize",summary:"Inspect and improve ATM atomization coverage for the current repository, including inventory/score/backfill plus the official registration-receipt and task snapshot helper lane.",positional:[{name:"subcommand",summary:"inventory | score | backfill | register-receipt | snapshot | verify-task",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path to inspect or update."},{flag:"--dry-run",summary:"For backfill, generate a proposal without writing atomization artifacts."},{flag:"--apply",summary:"For backfill, write generatedDraft governance artifacts for review."},{flag:"--task",value:"id",summary:"For register-receipt/snapshot/verify-task: governed task id for receipts and task snapshots."},{flag:"--phase",value:"before|after",summary:"For snapshot: which task snapshot boundary to record."},{flag:"--shard",value:"path",summary:"For register-receipt: owner-shard file to update."},{flag:"--path-pattern",value:"glob",summary:"For register-receipt: production path pattern to register into the owner shard."},{flag:"--atom-id",value:"id",summary:"For register-receipt: owner atom or map id for the path pattern."},{flag:"--capability",value:"text",summary:"For register-receipt: capability description recorded in the owner-shard row."},{flag:"--source-task",value:"id",summary:"For register-receipt: source task id stored onto the owner-shard row."},{flag:"--map-id",value:"id",summary:"For register-receipt: referenced map id to record into the generated receipt. Repeatable."},{flag:"--validate-command",value:"text",summary:"For register-receipt: validator command to run before the receipt is marked healthy. Repeatable."},{flag:"--no-default-validator",summary:"For register-receipt: skip the default npm run validate:atomization-coverage command."},{flag:"--expected-atom-delta",value:"number",summary:"For verify-task: expected atom registry count delta between before/after snapshots."},{flag:"--expected-map-delta",value:"number",summary:"For verify-task: expected map registry count delta between before/after snapshots."},{flag:"--expected-path-delta",value:"number",summary:"For verify-task: expected path-to-atom-map row count delta between before/after snapshots."},G,H,W],examples:["node atm.mjs atomize inventory --repo . --json","node atm.mjs atomize score --repo . --json","node atm.mjs atomize backfill --dry-run --repo . --json","node atm.mjs atomize backfill --apply --repo . --json",'node atm.mjs atomize register-receipt --repo . --task TASK-CID-0104 --shard atomic_workbench/atomization-coverage/path-to-atom-map-shards/owner-shard-cli.json --path-pattern packages/cli/src/commands/evidence.ts --atom-id atm.historical-batch-evidence --capability "historical batch evidence slicing and close-readiness guards" --source-task TASK-CID-0104 --map-id atm.task-closure-map --json',"node atm.mjs atomize snapshot --repo . --task TASK-CID-0104 --phase before --json","node atm.mjs atomize verify-task --repo . --task TASK-CID-0104 --expected-atom-delta 0 --expected-map-delta 0 --expected-path-delta 1 --json"]})});var XJ,ZJ=y(()=>{"use strict";_();ce();XJ=q({name:"baseline",summary:"Create, inspect, or restore redteam test baselines for ATM framework work.",positional:[{name:"action",summary:"create | status | restore",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path for baseline operations."},{flag:"--name",value:"name",summary:"Baseline name, usually a git tag such as atm-redteam-baseline-2026-05-24."},{flag:"--framework-commit-range-cut",summary:"Also write the framework legacy commit-range cut manifest at this baseline commit."},{flag:"--worktree-only",summary:"Required for restore; resets the current test worktree to the baseline commit."},{flag:"--force",summary:"Allow restore on main/master/trunk. Use only for explicit recovery."},G,H,W],examples:["node atm.mjs baseline create --name atm-redteam-baseline-2026-05-24 --framework-commit-range-cut --json","node atm.mjs baseline status --name atm-redteam-baseline-2026-05-24 --json","node atm.mjs baseline restore --name atm-redteam-baseline-2026-05-24 --worktree-only --json"]})});var e6,t6=y(()=>{"use strict";_();ce();e6=q({name:"batch",summary:"Inspect, execute, repair, resume, skip, or checkpoint an active ATM batch run. Batch automates queue bookkeeping, but each task still needs real deliverables before closure.",options:[z,{flag:"--actor",value:"id",summary:"Actor id used for checkpoint, skip, resume, or abandon actions."},{flag:"--auto-batch",value:"on|off",summary:"For current/status wave selection: disable auto-batch wave dispatch with --auto-batch off."},{flag:"--auto-batch-collection-timeout-ms",value:"ms",summary:"For current/status wave selection: override the auto-batch collection timeout evidence value."},{flag:"--auto-batch-max-wave-size",value:"n",summary:"For current/status wave selection: override the maximum selected wave size."},{flag:"--batch",value:"id",summary:"Select a specific active batch run by batchId."},{flag:"--compact",summary:"Return only the current queue head, selected currentWave, deferredReasons, progress, allowed files, validators, and next commands for fast agent routing."},{flag:"--cancel",summary:"For execute-plan: cancel the durable plan executor and emit the recovery receipt."},{flag:"--delivery-commit",value:"commit",summary:"For checkpoint or deliver-and-close: verify a scoped delivery commit, equivalent to tasks close --historical-delivery."},{flag:"--deliver-and-close",summary:"Show the queue-head delivery flow: implement deliverables, record evidence, checkpoint, then commit the checkpoint state."},{flag:"--hold",summary:"For checkpoint: close and advance the current task, but do not auto-claim the next queue head before the commit window."},{flag:"--historical-batch",value:"id-or-path",summary:"For checkpoint: consume a close-ready historical-batch slice for the current queue head."},{flag:"--historical-delivery",value:"commit",summary:"For checkpoint: verify an earlier scoped delivery commit before closing the queue head."},{flag:"--waiver-out-of-scope-delivery",summary:"For checkpoint with historical delivery: allow a mixed historical delivery commit when task-matched files cover the queue head; requires --reason."},{flag:"--waive-out-of-scope",summary:"Alias for --waiver-out-of-scope-delivery."},{flag:"--emergency-approval",value:"leaseId",summary:"For checkpoint or deliver-and-close: forward a protected backend close approval lease when historical delivery closeback requires one."},{flag:"--wave",value:"id",summary:"For checkpoint-readiness: wave id to evaluate atomically."},{flag:"--manifest-digest",value:"digest",summary:"For checkpoint-readiness: wave manifest digest shared by receipts."},{flag:"--delivery-receipt",value:"path",summary:"For checkpoint-readiness: shared commit receipt path. Repeatable."},{flag:"--build-receipt",value:"path",summary:"For checkpoint-readiness: shared build receipt path. Repeatable."},{flag:"--projection-receipt",value:"path",summary:"For checkpoint-readiness: shared projection receipt path. Repeatable."},{flag:"--planning-closeback-blocked",summary:"For checkpoint-readiness: mark planning closeback as requiring reconciliation."},{flag:"--plan",value:"path",summary:"For execute-plan/plan-start: planning document or task-card path used for the durable plan digest."},{flag:"--pause",summary:"For execute-plan: pause the durable plan executor and emit a resume command."},{flag:"--reason",value:"text",summary:"For skip: required blocker reason recorded in the batch audit trail."},{flag:"--scope",value:"key",summary:"Select a specific active batch run by scopeKey when batchId is not available."},{flag:"--task",value:"id",summary:"For execute-plan/plan-start: repeat to seed a durable plan run; for skip/resume: task id to skip from the queue head or restore from the skipped list."},G,H,W],examples:["node atm.mjs batch status --json","node atm.mjs batch execute-plan --actor codex-main --plan docs/plan.md --task TASK-001 --task TASK-002 --json","node atm.mjs batch execute-plan --actor codex-main --batch plan-batch-abc123 --pause --json","node atm.mjs batch execute-plan --actor codex-main --batch plan-batch-abc123 --cancel --json","node atm.mjs batch status --batch batch-abc123 --compact --json","node atm.mjs batch current --compact --json","node atm.mjs batch current --auto-batch off --json","node atm.mjs batch current --batch batch-abc123 --compact --json","node atm.mjs batch deliver-and-close --actor codex-main --batch batch-abc123 --json","node atm.mjs batch repair --actor codex-main --batch batch-abc123 --json",'node atm.mjs batch skip --actor codex-main --batch batch-abc123 --task TASK-AAO-0044 --reason "external blocker" --json',"node atm.mjs batch resume --actor codex-main --batch batch-abc123 --task TASK-AAO-0044 --json","node atm.mjs batch resume --actor codex-main --scope TASK-ASA --json","node atm.mjs batch checkpoint --actor codex-main --batch batch-abc123 --delivery-commit abc123 --json","node atm.mjs batch checkpoint --actor codex-main --batch batch-abc123 --historical-batch hist-batch-2026-06-16T01-40-43-634Z --json","node atm.mjs batch checkpoint --actor codex-main --batch batch-abc123 --hold --json","node atm.mjs batch checkpoint --actor codex-main --batch batch-abc123 --json","node atm.mjs batch checkpoint-readiness --wave wave-123 --manifest-digest sha256:abc --task TASK-GOV-0100 --delivery-receipt .atm/history/evidence/wave-123.shared-write.json --build-receipt .atm/history/evidence/wave-123.build.json --projection-receipt .atm/history/evidence/wave-123.projection.json --json","node atm.mjs batch abandon --actor codex-main --batch batch-abc123 --json"]})});var r6,o6=y(()=>{"use strict";_();ce();r6=q({name:"bootstrap",summary:"Create or refresh the default ATM bootstrap pack.",positional:[],options:[z,{flag:"--task",value:"text",summary:'Override bootstrap task title (default: "Bootstrap ATM in this repository").'},{flag:"--force",summary:"Overwrite existing bootstrap files."},G,H,W],examples:["node atm.mjs bootstrap --cwd .",'node atm.mjs bootstrap --cwd <host-repo> --task "Bootstrap ATM in this repository"']})});var a6,n6=y(()=>{"use strict";_();ce();a6=q({name:"setup",summary:"Set up ATM in one selected project, discover supported agent configurations, safely reconcile integrations, and verify readiness.",positional:[],options:[z,{flag:"--agents",value:"csv",summary:"Explicit adapter IDs, or none for CLI-only setup. Defaults to all detected configurations."},{flag:"--dry-run",summary:"Inspect the selected target and all integration conflicts without writing."},G,H,W],examples:["node atm.mjs setup","node atm.mjs setup --cwd ../project --json","node atm.mjs setup --cwd ../project --agents codex,claude-code --json","node atm.mjs setup --cwd ../project --agents none --dry-run --json"]})});var s6,i6=y(()=>{"use strict";_();ce();s6=q({name:"budget",summary:"Evaluate context budget policy for a governed task.",positional:[{name:"action",summary:"Currently supports: check",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Work item id to evaluate."},{flag:"--budget-id",value:"id",summary:"Custom budget report id."},{flag:"--estimated-tokens",value:"number",summary:"Estimated token count for the pending turn."},{flag:"--inline-artifacts",value:"number",summary:"Inline artifact count in the pending turn."},{flag:"--requested-summary",value:"text",summary:"Requested summary guidance."},G,H,W],examples:["node atm.mjs budget check --task BOOTSTRAP-0001 --estimated-tokens 16000 --json"]})});var c6,l6=y(()=>{"use strict";_();ce();c6=q({name:"cache",summary:"Manage ATM guide cache and one-file runtime cache.",positional:[{name:"action",summary:"enable | disable | clear | status | prune",required:!1}],options:[z,{flag:"--goal",value:"text",summary:"Filter guide cache entries when clearing."},{flag:"--runtime",value:"onefile",summary:"Runtime cache kind to prune. Currently supports onefile."},{flag:"--keep",value:"count",summary:"Number of newest one-file cache entries to keep. Defaults to 3."},{flag:"--dry-run",summary:"Report prune candidates without deleting cache entries."},G,H,W],examples:["node atm.mjs cache status --json",'node atm.mjs cache clear --goal "rank candidates" --json',"node atm.mjs cache prune --runtime onefile --keep 3 --json"]})});var d6,m6=y(()=>{"use strict";_();ce();d6=q({name:"cleanup",summary:"Diagnose or safely reconcile receipt-classified disposable residue.",positional:[{name:"action",summary:"diagnose | apply",required:!1}],options:[z,G,H,W],examples:["node atm.mjs cleanup diagnose --json","node atm.mjs cleanup apply --json"],help:{audience:"operator",requiredFlagSets:[],relatedCommands:["node atm.mjs residue status --json"],commonMistakes:["Using raw deletion for active-owner or staged residue."],playbookNotes:["cleanup apply removes only receipt-classified, non-staged disposable residue and preserves foreign or active-owner files."]}})});var u6,f6=y(()=>{"use strict";_();ce();u6=q({name:"candidates",summary:"Rank legacy source candidates and emit source inventory plus police evidence.",positional:[{name:"action",summary:"Currently supports: rank",required:!1}],options:[z,{flag:"--include",value:"glob",summary:"Source include glob. Repeatable. Defaults to Python pipeline/script globs.",repeatable:!0},{flag:"--goal",value:"text",summary:"Original user goal preserved in the ranking artifact."},{flag:"--max-file-lines",value:"number",summary:"Line-count threshold for decomposition police and risk scoring."},{flag:"--limit",value:"number",summary:"Maximum ranked candidates to return."},{flag:"--out-dir",value:"path",summary:"Report output directory. Defaults to .atm/history/reports/candidates."},G,H,W],examples:['node atm.mjs candidates rank --include "pipelines/**/*.py" --json','node atm.mjs candidates rank --include "pipelines/**/*.py" --goal "Prioritize the messiest Python data pipelines" --json']})});var p6,h6=y(()=>{"use strict";_();ce();p6=q({name:"create",summary:"Create and register an atom through the provisioning facade.",options:[z,{flag:"--bucket",value:"bucket",summary:"Atom bucket segment (for example: CORE, FIXTURE)."},{flag:"--title",value:"title",summary:"Human-readable atom title."},{flag:"--description",value:"text",summary:"Atom description."},{flag:"--logical-name",value:"name",summary:"Optional logical name override."},{flag:"--dry-run",summary:"Preview generated paths and IDs without writing files."},G,H,W],examples:['node atm.mjs create --bucket CORE --title NormalizeCssColor --description "Canonicalize CSS color input." --dry-run']})});var g6,k6=y(()=>{"use strict";_();ce();g6=q({name:"atm-chart",summary:"Render or verify ATMChart markdown from ATM guard sources.",positional:[{name:"action",summary:"render | verify",required:!1}],options:[z,{flag:"--out",value:"path",summary:"Override ATMChart markdown output path (default: .atm/memory/atm-chart.md)."},{flag:"--version-check",summary:"Also verify ATMChart/framework/template compatibility against the bundled release train matrix."},G,H,W],examples:["node atm.mjs atm-chart render --cwd .","node atm.mjs atm-chart verify --cwd ."]})});var y6,I6=y(()=>{"use strict";_();ce();y6=q({name:"create-map",summary:"Create and register an atomic map through the provisioning facade.",options:[z,{flag:"--map-version",value:"semver",summary:"Map version, defaults to 0.1.0."},{flag:"--spec",value:"path",summary:"Create from an existing atm.atomicMap document instead of inline JSON members/entrypoints/quality-targets input."},{flag:"--from-plan",value:"path",summary:"Create from an atm.decompositionPlan document."},{flag:"--members",value:"json",summary:"JSON member list."},{flag:"--edges",value:"json",summary:"JSON dependency edge list."},{flag:"--entrypoints",value:"json",summary:"JSON entrypoint list."},{flag:"--quality-targets",value:"json",summary:"JSON quality targets object."},{flag:"--dry-run",summary:"Preview generated paths and IDs without writing files."},G,H,W],examples:['node atm.mjs create-map --members "[{\\"atomId\\":\\"ATM-CORE-0001\\",\\"version\\":\\"1.0.0\\"}]" --entrypoints "[\\"ATM-CORE-0001\\"]" --quality-targets "{\\"latency\\":\\"p95<100ms\\"}" --dry-run',"node atm.mjs create-map --spec samples/checkout-mini.map.json --json","node atm.mjs create-map --from-plan samples/checkout-mini.plan.json --json"]})});var v6,w6=y(()=>{"use strict";_();ce();v6=q({name:"daemon",summary:"Manage the advisory ATM background watcher daemon.",positional:[{name:"action",summary:"enable | disable | start | stop | status | log",required:!1}],options:[{flag:"--tail",value:"count",summary:"Number of notifications to include for `daemon log`."},{flag:"--actor",value:"id",summary:"Actor id recorded when enabling the daemon."},G,H,W],examples:["node atm.mjs daemon enable --actor codex-main --json","node atm.mjs daemon start --json","node atm.mjs daemon status --json","node atm.mjs daemon log --tail 20 --json"]})});var S6,A6=y(()=>{"use strict";_();ce();S6=q({name:"doctor",summary:"Inspect ATM engineering readiness and trust signals.",options:[z,{flag:"--ci-profile",value:"profile",summary:"CI-specific doctor policy profile. Supported: dependency-pr."},{flag:"--skip-check",value:"check",repeatable:!0,summary:"Skip an explicit doctor check. Supported: git-head-evidence."},G,H,W],examples:["node atm.mjs doctor --json","node atm.mjs doctor --ci-profile dependency-pr --json"]})});var b6,T6=y(()=>{"use strict";_();ce();b6=q({name:"emergency",summary:"Manage short-lived human-approved emergency maintenance leases for protected backend surfaces. Normal operators should use taskflow open/close; emergency approvals are for repair-only backend use.",positional:[{name:"action",summary:"approve | show | revoke | permissions | audit",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Task id the emergency lease is limited to."},{flag:"--actor",value:"id",summary:"Actor id allowed to consume the lease."},{flag:"--approved-by",value:"id",summary:"Human approver label. Defaults to human."},{flag:"--permission",value:"id",summary:"Permission id from emergency permissions."},{flag:"--approval-text",value:"text",summary:"Human approval sentence authorizing this emergency lane use."},{flag:"--reason",value:"text",summary:"Why normal taskflow open/close cannot be used."},{flag:"--lease",value:"id",summary:"Lease id for show/revoke."},{flag:"--emergency-approval",value:"id",summary:"Alias for --lease when inspecting an approval."},{flag:"--surface",value:"name",summary:"Optional protected surface label."},{flag:"--allowed-flag",value:"flag",summary:"Repeatable flag that this lease explicitly allows, such as --waiver-out-of-scope-delivery.",repeatable:!0},{flag:"--ttl-minutes",value:"number",summary:"Lease lifetime in minutes."},{flag:"--max-uses",value:"number",summary:"Maximum number of protected backend uses allowed by this lease."},G,H,W],examples:["node atm.mjs emergency permissions --json",'node atm.mjs emergency approve --task TASK-CID-0043 --actor 007 --permission backend.tasks.reconcile --approval-text "Human approved TASK-CID-0043 reconcile" --reason "Historical closeback repair" --json',"node atm.mjs emergency show --lease EMG-TASK-CID-0043-abc123 --json","node atm.mjs emergency audit --task TASK-MAO-0037 --json","node atm.mjs emergency revoke --lease EMG-TASK-CID-0043-abc123 --actor captain --json"]})});var C6,R6=y(()=>{"use strict";_();ce();C6=q({name:"experience",summary:"Extract reviewable learning artifacts from ATM evidence.",positional:[{name:"action",summary:"Currently supports: extract",required:!0}],options:[z,{flag:"--from-task",value:"id",summary:"Override source task id from the input evidence."},{flag:"--input",value:"path",summary:"Experience extraction input JSON path."},{flag:"--out",value:"path",summary:"Write the skill candidate JSON artifact."},{flag:"--advisory-out",value:"path",summary:"Write the review advisory JSON artifact."},{flag:"--queue",value:"path",summary:"Append the generated proposal to a human-review queue."},{flag:"--projection",value:"path",summary:"Write a Markdown projection for the human-review queue."},{flag:"--by",value:"actor",summary:"Actor label for behavior execution evidence."},G,H,W],examples:["node atm.mjs experience extract --input fixtures/experience-loop/task-evidence.json --json","node atm.mjs experience extract --input evidence.json --out .atm/history/artifacts/skill-candidate.json --json"]})});var x6,E6=y(()=>{"use strict";_();ce();x6=q({name:"health-report",summary:"Generate a map health report and highlight high-risk atoms or bottlenecks.",options:[z,{flag:"--map",value:"id",summary:"Map id to inspect."},G,H,W],examples:["node atm.mjs health-report --map ATM-MAP-0001 --json"]})});var _6,P6=y(()=>{"use strict";_();ce();_6=q({name:"identity",summary:"Manage per-actor runtime git identity profiles, inspect hints, and clear stale repo-default identities before agent handoff.",positional:[{name:"action",summary:"set | show | status | clear",required:!0}],options:[z,{flag:"--actor",value:"id",summary:"Actor id for the per-actor identity profile; omit on set to update repo default.json."},{flag:"--name",value:"text",summary:"Optional display name; when combined with --kind, also updates actor registry."},{flag:"--kind",value:"kind",summary:"Optional actor kind: human | ai-agent | automation."},{flag:"--provider",value:"text",summary:"Optional provider label for registry/default identity."},{flag:"--editor",value:"text",summary:"Optional editor/host label for registry/default identity."},{flag:"--git-name",value:"text",summary:"Preferred git author name for this actor."},{flag:"--git-email",value:"text",summary:"Preferred git author email for this actor."},{flag:"--contact",value:"text",summary:"Optional owner/contact for registry update."},{flag:"--capabilities",value:"csv",summary:"Optional capability tags for registry update."},{flag:"--active-session",value:"session-id",summary:"Override the active session hint stored with the default identity."},G,H,W],examples:['node atm.mjs identity set --actor codex-main --git-name "codex-main" --git-email codex-main@atm.local --editor codex --json','node atm.mjs identity set --git-name "solo-user" --git-email solo-user@example.local --json',"node atm.mjs identity clear --json","node atm.mjs identity clear --actor codex-main --json","node atm.mjs identity status --json","node atm.mjs identity show --actor codex-main --json","node atm.mjs identity show --json"]})});var M6,O6=y(()=>{"use strict";_();ce();M6=q({name:"orient",summary:"Inspect a repository and emit an ATM guidance orientation report.",options:[z,{flag:"--full",summary:"Include the complete test/validation entrypoint inventory; the default orientation keeps a compact summary."},G,H,W],examples:["node atm.mjs orient --cwd . --json","node atm.mjs orient --cwd . --full --json"]})});var D6,F6=y(()=>{"use strict";_();ce();D6=q({name:"plan",summary:"Manage registered planning families and create plan documents or task cards through the tool-first lane.",positional:[{name:"area",summary:"series | doc | card",required:!0},{name:"action",summary:"register | create",required:!0}],options:[z,{flag:"--planning-root",value:"path",summary:"Planning base directory. Defaults to ATM_PLANNING_ROOT, ATM_PLANNING_REPO_ROOT, or configured planning roots."},{flag:"--series",value:"key",summary:"Short series key such as ERR, TMP, RFT, or GOV."},{flag:"--prefix",value:"task-prefix",summary:"Task id prefix. Bare ERR becomes TASK-ERR; ATM-GOV is preserved."},{flag:"--family-dir",value:"dir",summary:"Family directory under the planning root."},{flag:"--plan",value:"path",summary:"Plan document path relative to the planning root."},{flag:"--title",value:"text",summary:"Title for a new plan document or task card."},{flag:"--doc-name",value:"file.md",summary:"File name for plan doc create. Defaults to a title slug."},{flag:"--task-id",value:"id",summary:"Explicit task id for card create. Defaults to the next id in the registered family tasks directory."},{flag:"--output",value:"path",summary:"Explicit task-card output path relative to the planning root."},{flag:"--owner-approved",summary:"Required for series register writes; records project-owner approval."},{flag:"--approved-by",value:"id",summary:"Approval identity recorded in the series registry. Defaults to owner."},{flag:"--status",value:"active|reserved|archived",summary:"Series registry status. Defaults to active."},{flag:"--target-repo",value:"repo",summary:"Target repo recorded in generated task cards."},{flag:"--closure-authority",value:"mode",summary:"Closure authority recorded in generated task cards."},{flag:"--dry-run",summary:"Preview the registry, plan, or card change without writing."},{flag:"--write",summary:"Write the registry, plan, or card artifact."},G,H,W],examples:['node atm.mjs plan doc create --planning-root C:/repo/docs/ai_atomic_framework --family-dir error-governance --title "ATM Error Governance" --doc-name error-governance-plan.md --write --json',"node atm.mjs plan series register --planning-root C:/repo/docs/ai_atomic_framework --series ERR --prefix TASK-ERR --family-dir error-governance --plan error-governance/error-governance-plan.md --owner-approved --write --json",'node atm.mjs plan card create --planning-root C:/repo/docs/ai_atomic_framework --series ERR --title "Error registry migration plan" --write --json'],help:{audience:"agent",requiredFlagSets:[{when:"Registering a new family",flags:["series register","--prefix","--family-dir","--plan","--owner-approved","--write"]},{when:"Creating a plan document before registration",flags:["doc create","--family-dir","--title","--write"]},{when:"Creating a task card",flags:["card create","--series","--title","--write"]}],relatedCommands:["node atm.mjs tasks import --from <generated-card.task.md> --dry-run --json","node atm.mjs integration add codex --json"],commonMistakes:["Writing a new docs/ai_atomic_framework/<family>/tasks/*.task.md file by hand instead of using plan card create.","Registering a prefix before the owner-approved plan document exists.","Inferring the next task id from target .atm/history instead of the planning family tasks directory."],playbookNotes:["Skills should call this CLI for planning family and card creation, then report structured CLI errors instead of bypassing the tool.","ErrorCode registry files remain under docs/governance until a governed ERR-family migration updates registry readers, generators, tests, and emitters together."]}})});var j6,$6=y(()=>{"use strict";_();ce();j6=q({name:"map-capsule",summary:"Export, import, or roll back map capsules backed by the map capsule registry.",positional:[{name:"action",summary:"export | import | rollback",required:!0}],options:[z,{flag:"--map",value:"id",summary:"Map id to export."},{flag:"--cid",value:"cid",summary:"Map capsule content id for import or rollback."},{flag:"--payload",value:"base64",summary:"Compressed map capsule payload for import."},{flag:"--no-vendor",summary:"Skip vendoring the imported map bundle into the repository vendor directory."},{flag:"--previous-cid",value:"cid",summary:"Previous map capsule cid to link when exporting a new revision."},{flag:"--exported-by",value:"id",summary:"Actor or tool id recorded for the export event."},{flag:"--name",value:"text",summary:"Human-readable name recorded in the map capsule registry."},G,H,W],examples:["node atm.mjs map-capsule export --map ATM-MAP-0001 --json","node atm.mjs map-capsule import --cid map:cid:abc123 --payload <base64> --json","node atm.mjs map-capsule rollback --cid map:cid:abc123 --json"]})});var L6,N6=y(()=>{"use strict";_();ce();L6=q({name:"police",summary:"Run the ATM police family gate and emit a PoliceFamilyGateReport.",positional:[{name:"action",summary:"Currently supports: run",required:!1}],options:[z,{flag:"--profile",value:"standard|full",summary:"Police family profile to run (default: standard)."},{flag:"--registry",value:"path",summary:"Registry document path for Dedup Police (default: atomic-registry.json)."},{flag:"--out",value:"path",summary:"Optional JSON report output path. Defaults to stdout evidence only."},G,H,W],examples:["node atm.mjs police run --profile standard --json","node atm.mjs police run --profile full --out .atm/history/reports/police-family-gate.json --json"]})});var B6,q6=y(()=>{"use strict";_();ce();B6=q({name:"quickfix",summary:"Manage the lightweight ATM quickfix runtime lock.",options:[z,{flag:"--actor",value:"id",summary:"Actor id used for claim or release actions."},{flag:"--prompt",value:"text",summary:"Prompt text used to infer quickfix scope during claim."},{flag:"--files",value:"csv",summary:"Optional comma-separated path scope for the quickfix lock."},{flag:"--reason",value:"text",summary:"Optional human-readable reason for the quickfix lock."},G,H,W],examples:["node atm.mjs quickfix status --json",'node atm.mjs quickfix claim --actor codex-main --prompt "fix tsconfig.json typo" --json',"node atm.mjs quickfix release --actor codex-main --json"]})});var G6,H6=y(()=>{"use strict";_();ce();G6=q({name:"residue",summary:"Inspect or reconcile ATM-managed worktree residue across tasks.",positional:[{name:"action",summary:"status | reconcile",required:!1}],options:[{flag:"--apply",summary:"For residue reconcile, remove only owner-aware safe disposable residue. Omit for dry-run."},z,G,H,W],examples:["node atm.mjs residue status --json","node atm.mjs residue reconcile --json","node atm.mjs residue reconcile --apply --json"],help:{audience:"operator",requiredFlagSets:[],relatedCommands:["node atm.mjs status --json","node atm.mjs tasks status --task TASK-ABC-0001 --residue --json"],commonMistakes:["Deleting .atm/history or .atm/runtime files directly before checking whether an active owner still holds them."],playbookNotes:["residue status is read-only. It classifies active-owner, auto-clean-safe, block-and-reconcile, and manual-review buckets so a reconciler can act safely.","residue reconcile is dry-run by default. --apply removes only non-staged, non-active-owner, disposable residue such as runtime push attempts or abandoned-task artifacts.","Each entry reports indexState/sharedIndexRisk plus governance-lock or close-commit-window owner metadata so staged residue can be triaged without raw git inspection."]}})});var W6,U6=y(()=>{"use strict";_();ce();W6=q({name:"rescue",summary:"Run rescue-family diagnostics and disaster-recovery operations for corrupted ATM state.",positional:[{name:"action",summary:"police | diagnose | rebuild-registry | reload-atoms | closure-packet | rebuild-maps | replay-lineage | clear-cache | factory-reset",required:!1}],options:[{flag:"--cwd",value:"path",summary:"Run rescue against a specific repository root."},{flag:"--dry-run",summary:"Report planned recovery steps without mutating state."},{flag:"--confirm",summary:"Allow destructive rescue actions to execute instead of staying in dry-run mode."},{flag:"--i-understand-this-deletes-state",summary:"Required acknowledgement for factory-reset execution."},{flag:"--map",value:"id",summary:"Map id required by replay-lineage."},{flag:"--task",value:"id",summary:"Task id required by closure-packet."},{flag:"--amend",summary:"For closure-packet, explicitly request HEAD rewrite after staging the repaired packet. ATM fails safely when no amend-capable governed wrapper is available."},{flag:"--no-amend",summary:"Compatibility alias for the default stage-only closure-packet flow."},G,H,W],examples:["node atm.mjs rescue police --json","node atm.mjs rescue diagnose --json","node atm.mjs rescue closure-packet --task TASK-AAO-0102 --json","node atm.mjs rescue rebuild-registry --dry-run --json","node atm.mjs rescue replay-lineage --map ATM-MAP-0001 --confirm --json"]})});var V6,z6=y(()=>{"use strict";_();ce();V6=q({name:"start",summary:"Start an ATM guidance session for a concrete goal.",options:[z,{flag:"--goal",value:"text",summary:"Goal the agent is trying to accomplish."},{flag:"--actor",value:"name",summary:"Optional actor label for session audit."},{flag:"--target-file",value:"path",summary:"Path (relative to --cwd) to a legacy source file to analyze and build a LegacyRoutePlan from."},{flag:"--release-blocker",value:"symbols",summary:"Comma-separated function names that are release blockers (used with --target-file or --legacy-flow)."},{flag:"--shadow",summary:"Mark the session as shadow mode: dry-run only, no host legacy file writes."},{flag:"--legacy-flow",summary:"Force legacy route flow; build a LegacyRoutePlan from --target-file or the first config hotspot declared in .atm/config.json."},G,H,W],examples:['node atm.mjs start --cwd . --goal "Extract legacy helper" --json','node atm.mjs start --cwd . --goal "Atomize leaf helper" --target-file src/utils.ts --release-blocker "processRequest" --legacy-flow --json']})});var K6,J6=y(()=>{"use strict";_();ce();K6=q({name:"explain",summary:"Explain guidance blocks and the evidence needed to proceed.",options:[z,{flag:"--why",value:"reason",summary:"Currently supports: blocked."},{flag:"--session",value:"id",summary:"Guidance session id; defaults to the active session."},G,H,W],examples:["node atm.mjs explain --why blocked --json","node atm.mjs explain --why blocked --session <session-id> --json"]})});var Y6,Q6=y(()=>{"use strict";_();ce();Y6=q({name:"evidence",summary:"Run validators as governed evidence, add raw/manual evidence for close/commit/PR gates, author diagnostic-loop receipts, author historical-batch envelopes that feed taskflow close, or finalize diagnostic historical-batch slices. Successful fresh evidence updates the per-task bundle manifest at .atm/history/evidence/<taskId>.bundle-manifest.json.",positional:[{name:"action",summary:"add | run | git-head-backfill | verify | diff | validators | missing | diagnose | historical-batch | historical-batch-finalize | wave-exit-observer",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Task id to append or verify evidence."},{flag:"--actor",value:"id",summary:"Actor id for evidence run/add (or set ATM_ACTOR_ID)."},{flag:"--kind",value:"type",summary:"Evidence kind for raw evidence add or evidence run: test|artifact|attestation|review|commit|waiver."},{flag:"--summary",value:"text",summary:"Optional short evidence summary."},{flag:"--artifacts",value:"csv",summary:"Optional artifact path list recorded with the evidence."},{flag:"--freshness",value:"type",summary:"Raw evidence add freshness: fresh|historical-reference|draft (default: fresh)."},{flag:"--validators",value:"csv",summary:"Optional validator override. Omit when the command matches a known gate or a task-card declared validator; evidence run will auto-link it."},{flag:"--command",value:"text",summary:"Command to run/capture. With evidence add this is raw metadata and also requires exit code plus sha256 outputs."},{flag:"--command-runs",value:"json-file",summary:"Raw evidence add only: append commandRuns from a JSON array or {commandRuns:[]} cache file."},{flag:"--symptom",value:"text",summary:"Diagnostic-loop only: exact observed symptom that the reproducer must trigger."},{flag:"--reproducer-command",value:"text",summary:"Diagnostic-loop only: command that reproduces the declared symptom."},{flag:"--symptom-observed",summary:"Diagnostic-loop only: assert the reproducer observed the declared symptom."},{flag:"--reproduction-rate",value:"0..1",summary:"Diagnostic-loop only: observed reproduction rate for the minimized fixture."},{flag:"--minimized-fixture",value:"path-or-id",summary:"Diagnostic-loop only: minimized fixture path or stable fixture id."},{flag:"--hypothesis",value:"id|summary|prediction|command|matched",summary:"Diagnostic-loop only: repeatable falsifiable hypothesis and one-variable experiment result."},{flag:"--winning-hypothesis",value:"id",summary:"Diagnostic-loop only: hypothesis id whose experiment matched."},{flag:"--regression-case-id",value:"id",summary:"Diagnostic-loop only: regression test case id added or selected for the repair."},{flag:"--exit",value:"EXIT-NN",summary:"wave-exit-observer only: sealed EXIT id from the observer policy. The writer selects the command; callers cannot pass a command."},{flag:"--observer-role",value:"role",summary:"wave-exit-observer only: sealed observer role such as wave-exit-observer.gemini or wave-exit-observer.claude."},{flag:"--basis-owners",value:"csv",summary:"wave-exit-observer only: evidence owner task ids used to derive the basis producer actor. Not an actor override."},{flag:"--declared-basis-actor",value:"id",summary:"wave-exit-observer only: optional cross-check against the derived basis actor. Mismatch fails closed."},{flag:"--exit-code",value:"number",summary:"Raw evidence add only: exit code paired with --command evidence. Forbidden for wave-exit-observer."},{flag:"--stdout-sha256",value:"sha256",summary:"Raw evidence add only: stdout digest paired with --command evidence."},{flag:"--stderr-sha256",value:"sha256",summary:"Raw evidence add only: stderr digest paired with --command evidence."},{flag:"--runner-kind",value:"kind",summary:"Runner kind for command proof: dev-source|frozen-runner|external."},{flag:"--source-commit",value:"sha",summary:"Source commit paired with dev-source command proof."},{flag:"--reason",value:"text",summary:"Optional rationale for git-head-backfill."},{flag:"--gate",value:"type",summary:"Evidence gate for verify: close|commit|pr."},{flag:"--list",summary:"List all required validators with tier and current evidence state (used with validators action)."},{flag:"--recent-run",summary:"Use the most recent cached command run if available in the task evidence (used with run action)."},{flag:"--tasks",value:"csv",summary:"Task ids to slice into per-task historical-batch close-readiness evidence."},{flag:"--commits",value:"csv",summary:"Delivery commit refs that historical-batch will inspect and match back to the listed tasks."},{flag:"--delivery-repo",value:"path",summary:"Repository that contains the historical delivery commits matched into the historical-batch envelope."},{flag:"--validator-command",value:"text",summary:"Validator command to run once for a historical batch; repeatable. The resulting passes are shared into task slices for later close-readiness checks."},{flag:"--write",summary:"Write the historical-batch envelope plus per-task slices that tasks close / taskflow close can consume later."},{flag:"--dry-run",summary:"Preview historical-batch matching and close-readiness evidence without writing."},{flag:"--allow-unmatched",summary:"Allow diagnostic historical batches even when some tasks have no scoped commit match."},{flag:"--approved-by",value:"actor",summary:"Required with --allow-unmatched: approver for diagnostic-only historical batch evidence."},{flag:"--approval-reason",value:"text",summary:"Required with --allow-unmatched: justification for recording unmatched historical batch diagnostics."},{flag:"--batch",value:"id-or-path",summary:"Historical-batch-finalize only: batch id or envelope path for the diagnostic slice disposition."},{flag:"--disposition",value:"type",summary:"Historical-batch-finalize only: keep-diagnostic|abandon|remove-evidence for non-close-ready task slices."},G,H,W],examples:['node atm.mjs evidence run --task ATM-GOV-0104 --actor codex-main --command "npm run typecheck" --json','node atm.mjs evidence run --task ATM-GOV-0104 --actor codex-main --command "npm run validate:cli" --validators validate:cli --recent-run --json','node atm.mjs evidence run --task TASK-TEAM-0014 --actor codex-main --command "node atm.mjs team patrol --task TASK-TEAM-0014 --json" --json','node atm.mjs evidence add --task ATM-GOV-0104 --actor codex-main --kind test --summary "raw artifact evidence" --artifacts reports/governance.json --json','node atm.mjs evidence add --task ATM-GOV-0104 --actor codex-main --kind test --freshness fresh --command "npm run typecheck" --exit-code 0 --stdout-sha256 sha256:1111111111111111111111111111111111111111111111111111111111111111 --stderr-sha256 sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 --validators typecheck --json','node atm.mjs evidence git-head-backfill --actor codex-main --reason "Backfill evidence for a pre-ATM HEAD commit" --json',"node atm.mjs evidence verify --task ATM-GOV-0104 --gate close --json","node atm.mjs evidence validators --list --task ATM-GOV-0104 --json","node atm.mjs evidence missing --task ATM-GOV-0104 --actor Augment --json",'node atm.mjs evidence diagnose --task ATM-GOV-0104 --actor codex-main --symptom "claim writes reserve before seal check" --reproducer-command "node atm.mjs next --claim ..." --symptom-observed --reproduction-rate 1 --minimized-fixture tests/fixtures/claim-seal --candidate-digest sha256:1111111111111111111111111111111111111111111111111111111111111111 --environment-digest sha256:2222222222222222222222222222222222222222222222222222222222222222 --hypothesis "h1|seal runs too late|ledger mutates before seal failure|node --strip-types tests/cli/claim-atomicity.test.ts|matched" --winning-hypothesis h1 --regression-case-id test_claim_atomicity --green-command "node --strip-types tests/cli/claim-atomicity.test.ts" --green-exit-code 0 --green-stdout-sha256 sha256:3333333333333333333333333333333333333333333333333333333333333333 --green-stderr-sha256 sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 --write --json','node atm.mjs evidence historical-batch --tasks TASK-A,TASK-B --commits abc123,def456 --actor codex-main --validator-command "npm run validate:cli" --dry-run --json','node atm.mjs evidence historical-batch --tasks TASK-A,TASK-B --commits abc123,def456 --actor codex-main --validators typecheck --validator-command "npm run typecheck" --write --json','node atm.mjs evidence historical-batch --tasks TASK-A,TASK-B --commits abc123 --actor codex-main --validator-command "npm test" --allow-unmatched --approved-by captain --approval-reason "diagnostic backfill" --write --json','node atm.mjs evidence historical-batch-finalize --task TASK-B --batch hist-batch-2026-06-16T01-40-43-634Z --actor codex-main --disposition keep-diagnostic --reason "partial slice kept for audit only" --write --json',"node atm.mjs evidence wave-exit-observer --exit EXIT-02 --actor gemini-wave-exit-observer --observer-role wave-exit-observer.gemini --basis-owners ATM-GOV-0341 --json","node atm.mjs evidence wave-exit-observer --exit EXIT-04 --actor claude-wave-exit-observer --observer-role wave-exit-observer.claude --basis-owners ATM-GOV-0341 --json"],help:{audience:"agent",requiredFlagSets:[{when:"Recording governed evidence for one task",flags:["--task","--actor"]},{when:"Running a command-backed validator",flags:["run","--command"]},{when:"Writing a diagnostic historical batch with unmatched tasks",flags:["--allow-unmatched","--approved-by","--approval-reason"]},{when:"Finalizing a diagnostic historical-batch slice",flags:["historical-batch-finalize","--task","--batch","--actor","--disposition","--reason"]},{when:"Writing a sealed wave-exit observer receipt",flags:["wave-exit-observer","--exit","--actor","--observer-role","--basis-owners"]}],relatedCommands:["node atm.mjs evidence validators --list --task TASK-ABC-0001 --json","node atm.mjs taskflow pre-close --task TASK-ABC-0001 --actor <actor-id> --json","node atm.mjs tasks status --task TASK-ABC-0001 --residue --json"],commonMistakes:["Manually typing validator names when evidence run can auto-link a declared validator from the command.","Using raw evidence add as a substitute for fresh command-backed validation when the task requires validators.","Writing historical-batch evidence without checking whether the matched commits actually cover the task deliverables.","Trying to use historical-batch-finalize on a close-ready slice; close-ready slices must go through taskflow close.","Treating git-head-backfill as a protected-push requirement instead of a repair/diagnostic tool for legacy HEAD evidence.","Hand-writing docs/reports/wave-exit-observer-receipts/<EXIT-id>.json or passing --command/--artifact-path to invent an observer receipt."],playbookNotes:["evidence validators --list is the fastest way to see what a task still needs before closeout.","Use --recent-run when a matching cached command run already exists and you only need to re-link it into the current evidence update.","Use historical-batch-finalize to explicitly keep, abandon, or remove diagnostic-only historical-batch residue without changing task lifecycle state.","git-head-backfill is retained for repair and audit trails; same-commit governed provenance should normally come from node atm.mjs git commit instead of a follow-up backfill.","evidence wave-exit-observer is the only official writer for canonical wave-exit observer receipts. It never writes certificates, completion evidence, or release verdicts."]}})});var X6,Z6=y(()=>{"use strict";_();ce();X6=q({name:"framework-mode",summary:"Inspect, claim, or release ATM framework-development hard gates for critical source changes, including staged residue warnings and same-actor stale temp-claim auto-reconcile.",positional:[{name:"action",summary:"status | claim | release",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path to inspect."},{flag:"--files",value:"csv",summary:"Optional comma-separated declared change scope instead of git diff."},{flag:"--files-from",value:"path",summary:"Newline-separated declared change scope. Each line is one path and is normalized like one --files field, so the list does not pass through a single argv string."},{flag:"--target-repo",value:"path",summary:"Optional cross-repo target repository path."},{flag:"--actor",value:"id",summary:"Actor id for temporary framework-development claim/release."},{flag:"--task",value:"id",summary:"Explicit active governed task to bind to a temporary framework claim; required when the actor has ambiguous active lanes."},{flag:"--reason",value:"text",summary:"Reason for temporary framework-development claim."},G,H,W],examples:["node atm.mjs framework-mode status --json","node atm.mjs framework-mode status --files packages/core/src/index.ts --json","node atm.mjs framework-mode status --target-repo ../AI-Atomic-Framework --json",'node atm.mjs framework-mode claim --actor codex-main --task ATM-GOV-0001 --files packages/cli/src/commands/next.ts --reason "temporary framework maintenance" --json','node atm.mjs framework-mode claim --actor ci --files-from /tmp/changed-files.txt --reason "CI preflight framework-development claim" --json',"node atm.mjs framework-mode release --actor codex-main --json"]})});var e5,t5=y(()=>{"use strict";_();ce();e5=q({name:"guard",summary:"Run governance guards for encoding, mutation scope, git metadata, framework development, and commit ranges.",positional:[{name:"guard-name",summary:"encoding | mutation | git | atom-callsite-readability | framework-development | commit-range",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path for atom-callsite-readability guard."},{flag:"--task",value:"id",summary:"Task id for mutation or git guard checks."},{flag:"--actor",value:"id",summary:"Actor id for mutation or git guard checks."},{flag:"--files",value:"csv",summary:"Comma-separated file paths for the guard or declared framework scope."},{flag:"--files-from",value:"path",summary:"Newline-separated file paths for the guard or declared framework scope. Same per-path normalization as --files."},{flag:"--base",value:"ref",summary:"Base ref for commit-range guard."},{flag:"--head",value:"ref",summary:"Head ref for commit-range guard."},{flag:"--fail-open",summary:"Return ok=true with warnings when violations are detected."},G,H,W],examples:["node atm.mjs guard encoding --files README.md,package.json --json","node atm.mjs guard mutation --task ATM-GOV-0106 --actor codex-main --files packages/cli/src/commands/guard.ts --json","node atm.mjs guard git --task ATM-GOV-0106 --actor codex-main --json","node atm.mjs guard atom-callsite-readability --repo . --json","node atm.mjs guard framework-development --files packages/core/src/index.ts --json","node atm.mjs guard commit-range --base origin/main --head HEAD --json"]})});var r5,o5=y(()=>{"use strict";_();ce();r5=q({name:"git",summary:"Prepare actor git identity, evaluate pre-push git admission, recover from rejected push attempts or a human-confirmed stale index lock, create governed commits with actor-scoped author env vars, create narrow record-only commits for low-risk .atm/history maintenance, verify ATM git-governance trailers, resolve task-scoped commit bundles, query the status of the last governed commit attempt plus live branch queue and stuck stdin pathspec staging diagnostics, and return copyable fallback plus host-git compatibility guidance when the wrapper cannot complete.",positional:[{name:"action",summary:"prepare | admit | push | recover-push-fail | recover-index-lock | reconcile-live-index | check | commit | record-commit | commit-status | attest",required:!0}],options:[z,{flag:"--actor",value:"id",summary:"Actor id used for git identity and trailer checks."},{flag:"--task",value:"id",summary:"Optional task id to enforce owner/claim/trailer consistency."},{flag:"--branch",value:"name",summary:"Branch name for git admit/push; defaults to the current HEAD branch."},{flag:"--remote",value:"name",summary:"Remote name for git admit/push; defaults to origin."},{flag:"--no-fetch",summary:"For git admit/push: do not fetch the remote branch before diffing."},{flag:"--dry-run",summary:"For git push: run admission and write push-attempt evidence without executing host git push."},{flag:"--branch",value:"name",summary:"Branch name for git recover-push-fail; defaults to the current HEAD branch."},{flag:"--remote",value:"name",summary:"Remote name for git recover-push-fail; defaults to origin."},{flag:"--steward-plan",summary:"For git admit composer-routed cases: emit a neutral steward dry-run merge plan without mutating files."},{flag:"--apply-to-working-tree",summary:"For git admit composer-routed cases: explicitly apply the steward merge result to scoped working-tree files without creating a commit."},{flag:"--name",value:"text",summary:"Override git author name for prepare/commit; with --email, also seeds the actor runtime identity profile during prepare."},{flag:"--email",value:"text",summary:"Override git author email for prepare/commit; with --name, also seeds the actor runtime identity profile during prepare."},{flag:"--session",value:"session-id",summary:"Optional ATM work session id for check/commit alignment."},{flag:"--message",value:"text",summary:"Commit summary for git commit; ATM appends governed trailers automatically."},{flag:"--trailer",value:"text",summary:"Repeatable extra trailer line for git commit (e.g. an editor-injected Co-authored-by line); folded into the governed trailer set instead of failing the commit."},{flag:"--auto-stage",summary:"Stage only the current task allowed delivery bundle with explicit git add -- <paths>; never use stdin pathspec staging, and report skipped external dirty files without using git add ."},{flag:"--delivery-slice-manifest",value:"path",summary:"Optional verified publication delivery-slice manifest. Restricts --auto-stage to outputInventory \u2229 current dirty plus receipt-derived required records; same-task certificate/closeout dirt is not absorbed."},{flag:"--delivery-slice-receipt",value:"path",summary:"Derive the publication delivery slice directly from the current task canonical published runner-sync receipt; mutually exclusive with --delivery-slice-manifest."},{flag:"--defer-foreign-staged",summary:"Snapshot and unstage foreign task governance files already in the index before resolving the bundle; never silent."},{flag:"--dry-run",summary:"Resolve the task-scoped commit bundle without staging or committing; for record-commit, validate the staged record-only scope without mutating HEAD."},{flag:"--no-verify",summary:"Emergency-only pass-through to git commit; requires --emergency-approval with backend.gitHookBypass permission and cannot override Team Broker conflicts by itself."},{flag:"--wip",summary:"For git commit: commit staged files with non-delivery ATM-WIP trailers and bypass full repository-wide typecheck."},{flag:"--emergency-approval",value:"leaseId",summary:"Required when --no-verify is used; must authorize backend.gitHookBypass."},{flag:"--write",summary:"For git reconcile-live-index: apply proven parent-blob residue after a dry-run; omitted or combined with --dry-run never mutates the index."},{flag:"--broker-conflict-override",value:"leaseId",summary:"High-authority override for Team Broker cross-task conflicts; must authorize backend.brokerConflictOverride and be paired with --broker-conflict-resolution."},{flag:"--broker-conflict-resolution",value:"path",summary:"Paper-style Team Broker conflict-resolution artifact proving conflict task id, shared paths, resolution order, and validator plan."},{flag:"--reason",value:"text",summary:"Human-readable reason for the governed hook bypass when using --no-verify."},{flag:"--no-trailers",summary:"Skip trailer checks in git check (identity/owner checks still run)."},{flag:"--timeout-ms",value:"ms",summary:"For git commit: override the default 420000ms timeout for the underlying git commit spawn (also settable via ATM_GIT_COMMIT_TIMEOUT_MS); a hung pre-commit hook fails as a retryable timeout instead of hanging forever. Commit also fails fast when a git add --pathspec-from-file=- helper is already waiting on stdin."},{flag:"--commit",value:"sha",summary:"For git attest: immutable historical commit to cover with a forward attestation. For git reconcile-live-index: the already-successful commit whose parent-tree residue may still occupy the live index."},{flag:"--lane",value:"lane-id",summary:"For git attest: lane/session id that reviewed and produced the forward attestation."},{flag:"--provenance-kind",value:"ticket|emergency",summary:"For git attest: provenance class for the forward attestation."},{flag:"--provenance-ref",value:"ref",summary:"For git attest: immutable evidence file or git:<sha> commit message used as provenance."},{flag:"--provenance-digest",value:"sha256:<digest>",summary:"For git attest: digest of the provenance reference."},{flag:"--reason",value:"text",summary:"For git attest emergency writes: human-readable reason for the forward attestation."},{flag:"--emergency-class",value:"class",summary:"For git attest emergency writes: emergency class such as runner-sync-publication or protected-push-recovery."},{flag:"--scope",value:"path",summary:"For git attest emergency writes: repeatable or comma-separated path scope covered by the attestation."},{flag:"--evidence-ref",value:"ref",summary:"For git attest emergency writes: repeatable or comma-separated supporting evidence reference."},{flag:"--status",summary:"For git attest: inspect the append-only attestation ledger without writing."},{flag:"--validate",summary:"For git attest: validate existing attestation ledger records without writing."},G,H,W],examples:["node atm.mjs git prepare --task ATM-GOV-0105 --actor codex-main --json",'node atm.mjs git prepare --actor codex-main --name "Codex Main" --email codex-main@atm.local --json',"node atm.mjs git admit --actor codex-main --branch main --remote origin --json","node atm.mjs git push --actor codex-main --branch main --remote origin --dry-run --json","node atm.mjs git push --actor codex-main --branch main --remote origin --json","node atm.mjs git admit --actor codex-main --branch main --remote origin --steward-plan --json","node atm.mjs git admit --actor codex-main --branch main --remote origin --apply-to-working-tree --json","node atm.mjs git recover-push-fail --actor codex-main --branch main --remote origin --json",'node atm.mjs git recover-index-lock --task ATM-GOV-0105 --actor codex-main --force-index-lock-recovery --emergency-approval <lease-id> --reason "human-confirmed stale lock" --json',"node atm.mjs git reconcile-live-index --commit <sha> --dry-run --json","node atm.mjs git reconcile-live-index --commit <sha> --write --json","node atm.mjs git check --task ATM-GOV-0105 --actor codex-main --json","node atm.mjs git check --actor codex-main --json",'node atm.mjs git commit --actor codex-main --task TASK-AAO-0036 --message "atm: sync TASK-AAO-0036 ledger mirror" --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0063 --message "atm: restore TASK-AAO-0063 historical ledger packet" --json','node atm.mjs git commit --actor codex-main --task ATM-GOV-0105 --message "complete ATM-GOV-0105" --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0141 --message "feat: scoped deliverable" --auto-stage --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0141 --message "build(runner): record sealed runner publication outputs" --auto-stage --delivery-slice-manifest .atm/history/evidence/TASK-AAO-0141.delivery-slice.json --dry-run --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0141 --message "build(runner): record sealed runner publication outputs" --auto-stage --delivery-slice-receipt .atm/history/evidence/TASK-AAO-0141.runner-sync-receipt.json --dry-run --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0141 --message "feat: scoped deliverable" --dry-run --json','node atm.mjs git commit --actor codex-main --task TASK-AAO-0141 --message "feat: scoped deliverable" --auto-stage --timeout-ms 30000 --json','node atm.mjs git record-commit --actor codex-main --message "atm: sync imported task records" --dry-run --json','node atm.mjs git record-commit --actor codex-main --message "atm: sync imported task records" --json',"node atm.mjs git commit-status --actor codex-main --task TASK-AAO-0141 --json","node atm.mjs git attest --status --json","node atm.mjs git attest --validate --json",'node atm.mjs git attest --commit <sha> --task TASK-GIT-0024 --actor codex-main --lane <lane-id> --provenance-kind emergency --provenance-ref git:<sha> --provenance-digest sha256:<digest> --reason "<reason>" --emergency-class protected-push-recovery --scope packages/cli/src --evidence-ref git:<sha> --dry-run --json']})});var a5,n5=y(()=>{"use strict";_();ce();a5=q({name:"git-hooks",summary:"Install or verify ATM-managed Git hooks for framework-development hard gates.",positional:[{name:"action",summary:"install | verify",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path."},{flag:"--framework-required",summary:"Treat missing hooks as an error even outside a detected framework repo."},G,H,W],examples:["node atm.mjs git-hooks install --framework-required --json","node atm.mjs git-hooks verify --framework-required --json"]})});var s5,i5=y(()=>{"use strict";_();ce();s5=q({name:"guide",summary:"Show guided ATM workflows, classify free-text goals, and record host-local intent phrases.",positional:[{name:"intent",summary:"overview | first-layer | create-atom | create-map | bootstrap | glossary | help | learn | install-skill",required:!1},{name:"command",summary:"Command name when intent is help.",required:!1}],options:[z,{flag:"--goal",value:"text",summary:"Classify a natural-language goal and return the required guidance flow."},{flag:"--phrase",value:"text",summary:"Host-local phrase to record when intent is learn."},{flag:"--intent",value:"id",summary:"Intent id for guide learn: legacy-atomization | legacy-candidate-ranking | task-plan-import."},{flag:"--reason",value:"text",summary:"Review reason for adding a learned host-local phrase."},{flag:"--status",value:"status",summary:"Learned phrase status: suggested | active-host | promoted-framework."},{flag:"--target",value:"host|codex",summary:"Skill installation target for guide install-skill."},{flag:"--skills-root",value:"path",summary:"Override Codex skills root when installing with --target codex."},{flag:"--force",summary:"Overwrite an existing installed skill."},G,H,W],examples:['node atm.mjs guide --goal "Atomize a legacy helper" --json','node atm.mjs guide --goal "Rank the messiest Python pipeline scripts" --json','node atm.mjs guide learn --phrase "brown path washing" --intent legacy-atomization --reason "host phrasing for legacy atomization" --status active-host --json',"node atm.mjs guide install-skill --target host --json","node atm.mjs guide first-layer --json","node atm.mjs guide overview --json","node atm.mjs guide glossary --json","node atm.mjs guide help next --json"]})});var c5,l5=y(()=>{"use strict";_();ce();c5=q({name:"handoff",summary:"Write continuation summaries for governed work.",positional:[{name:"action",summary:"Currently supports: summarize",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Work item id to summarize."},G,H,W],examples:["node atm.mjs handoff summarize --task BOOTSTRAP-0001 --json"]})});var d5,m5=y(()=>{"use strict";_();ce();d5=q({name:"hook",summary:"Run ATM-managed repository Git hook gates.",positional:[{name:"action",summary:"pre-commit | pre-push",required:!0}],options:[z,{flag:"--repo",value:"path",summary:"Repository path."},{flag:"--base",value:"ref",summary:"Base ref for pre-push commit-range validation."},{flag:"--head",value:"ref",summary:"Head ref for pre-push commit-range validation."},G,H,W],examples:["node atm.mjs hook pre-commit --json","node atm.mjs hook pre-push --base origin/main --head HEAD --json"]})});var u5,f5=y(()=>{"use strict";_();ce();u5=q({name:"init",summary:"Adopt ATM in a repository.",options:[z,{flag:"--adopt",value:"profile",summary:"Adoption profile (default when flag is present without value: default)."},{flag:"--integration",value:"id",summary:"Install an integration adapter during init."},{flag:"--task",value:"text",summary:"Bootstrap task title override."},{flag:"--dry-run",summary:"Preview init/adopt changes without writing files."},{flag:"--force",summary:"Overwrite existing config and bootstrap files."},G,H,W],examples:["node atm.mjs init --adopt default --json","node atm.mjs init --integration claude-code --json"]})});var p5,h5=y(()=>{"use strict";_();ce();p5=q({name:"internal-release",summary:"Build the ATM framework runner and sync it to explicitly listed internal repositories.",positional:[{name:"action",summary:"sync",required:!0}],options:[z,{flag:"--framework-root",value:"path",summary:"Alias for --cwd when running from outside the framework repository."},{flag:"--repo",value:"path",summary:"Target repository to receive the built ATM runner. Repeatable."},{flag:"--skip",value:"name-or-path",summary:"Skip a target repository by basename or resolved path. Repeatable."},{flag:"--exclude",value:"name-or-path",summary:"Alias for --skip."},{flag:"--source",value:"path",summary:"Runner source path. Defaults to release/atm-onefile/atm.mjs."},{flag:"--no-build",summary:"Do not run npm run build before syncing."},{flag:"--dry-run",summary:"Plan sync targets without copying files."},{flag:"--keep-temp",summary:"Keep known ATM temporary scratch directories for debugging instead of cleaning them."},{flag:"--no-verify",summary:"Do not run target doctor/framework-mode/tasks audit before and after copying."},{flag:"--commit",summary:"Commit only atm.mjs and .atm/runtime/pinned-runner.json in each synced target; other staged work stays staged."},{flag:"--allow-verify-failure",summary:"Report verification regressions without failing the sync command. Checks that already failed with the previous runner never fail the sync."},G,H,W],examples:["node atm.mjs internal-release sync --repo ../host-a --repo ../host-b --json","node atm.mjs internal-release sync --repo ../host-a --repo ../host-b --skip host-b --json","node atm.mjs internal-release sync --repo ../host-a --no-build --dry-run --json"]})});var g5,k5=y(()=>{"use strict";_();ce();g5=q({name:"integration",summary:"List, install, verify, remove, or run ATM agent integration adapters and hooks.",positional:[{name:"action",summary:"list | add | verify | parity | remove | hook | hooks",required:!1},{name:"adapter-id",summary:"Adapter id for add/verify/remove or hook event/action.",required:!1},{name:"hook-adapter-id",summary:"Adapter id for hooks install/verify/uninstall, including git-pre-push.",required:!1}],options:[z,{flag:"--repo",value:"path",summary:"Repository path for hook invocations."},{flag:"--actor",value:"name",summary:"Actor label recorded in install manifests."},{flag:"--at",value:"timestamp",summary:"Install timestamp override."},{flag:"--editor",value:"id",summary:"Editor id for integration hook pre-agent/pre-tool."},{flag:"--prompt",value:"text",summary:"Prompt text for pre-agent hook evaluation."},{flag:"--tool-name",value:"name",summary:"Tool name for pre-tool hook evaluation."},{flag:"--command",value:"command",summary:"Shell command for pre-tool hook evaluation."},{flag:"--files",value:"csv",summary:"Comma-separated paths for pre-tool hook evaluation."},{flag:"--dry-run",summary:"Preview integration install without writing files."},{flag:"--force",summary:"Overwrite existing manifests and target files."},{flag:"--merge",summary:"Safely reconcile digest-verified ATM content while preserving user-owned files; conflicts fail closed."},G,H,W],examples:["node atm.mjs integration list --json","node atm.mjs integration add claude-code --json","node atm.mjs integration add codex --json","node atm.mjs integration add antigravity --json","node atm.mjs integration verify claude-code --json","node atm.mjs integration parity --json","node atm.mjs integration remove claude-code --json","node atm.mjs integration hook pre-agent --editor copilot --json","node atm.mjs integration hook pre-tool --editor claude-code --files packages/core/src/index.ts --json","node atm.mjs integration hooks install copilot --json","node atm.mjs integration hooks verify claude-code --json","node atm.mjs integration hooks install git-pre-push --json","node atm.mjs integration hooks verify git-pre-push --json","node atm.mjs integration hooks uninstall git-pre-push --json"]})});var y5,I5=y(()=>{"use strict";_();ce();y5=q({name:"lane",summary:"Inspect, lazily mint, heartbeat, sweep, or explicitly adopt an ATM lane session and echo the lane envelope for tool callers.",positional:[{name:"action",summary:"status | adopt <lane-id> | heartbeat [lane-id] | sweep",required:!1}],options:[z,{flag:"--lane-session-id",value:"id",summary:"Lane session id to resolve before falling back to ATM_LANE_SESSION_ID."},{flag:"--lane-session",value:"id",summary:"Alias for --lane-session-id."},{flag:"--actor",value:"id",summary:"Actor id used when a missing or stale lane must be lazily minted, or when adopting a lane."},{flag:"--reason",value:"text",summary:"Optional reason recorded when adopting a lane."},{flag:"--confirm",summary:"Confirm adoption of a still-live lane owned by the same actor."},{flag:"--handoff-token",value:"token",summary:"Authorize adoption of a still-live lane with its handoff token."},{flag:"--grace-ms",value:"ms",summary:"Grace period used by lane sweep before a TTL-expired lane becomes sweepable."},{flag:"--write",summary:"For lane sweep, expire sweepable lanes and write sweep events. Without --write, sweep is report-only."},G,H,W],examples:["node atm.mjs lane status --json","node atm.mjs lane status --actor codex-main --json","node atm.mjs lane status --lane-session-id lane-20260716000000-codex-main-abc123 --json","node atm.mjs lane heartbeat lane-20260716000000-codex-main-abc123 --actor codex-main --json","node atm.mjs lane sweep --json","node atm.mjs lane sweep --grace-ms 60000 --write --json","node atm.mjs lane adopt lane-20260716000000-codex-main-abc123 --actor codex-main --confirm --json"]})});var v5,w5=y(()=>{"use strict";_();ce();v5=q({name:"lock",summary:"Check, acquire, or release a governed scope lock.",positional:[{name:"action",summary:"check | acquire | release",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Task id for lock operation."},{flag:"--owner",value:"name",summary:"Lock owner identity."},{flag:"--files",value:"csv",summary:"Comma-separated locked files for acquire."},G,H,W],examples:["node atm.mjs lock acquire --task BOOTSTRAP-0001 --owner atm-agent --json"]})});var S5,A5=y(()=>{"use strict";_();ce();S5=q({name:"migrate",summary:"Plan, apply, or verify ATM schema migration codemods for breaking framework version changes.",positional:[{name:"action",summary:"plan | apply | verify",required:!1}],options:[z,{flag:"--from",value:"version",summary:"Source ATM chart version to migrate from (e.g. 0.0.1)."},{flag:"--to",value:"version",summary:"Target ATM chart version to migrate to (e.g. 0.1.0)."},{flag:"--fixture",value:"path",summary:"Fixture directory path for verify action (must contain before/ and after/)."},G,H,W],examples:["node atm.mjs migrate plan --from 0.0.1 --to 0.1.0 --json","node atm.mjs migrate apply --from 0.0.1 --to 0.1.0 --json","node atm.mjs migrate verify --fixture fixtures/migrations/atm-chart-0.0.1-to-0.1.0 --json"]})});var b5,T5=y(()=>{"use strict";_();ce();b5=q({name:"next",summary:"Route the current prompt into the official ATM fast, normal, or batch work channel. When the selected task id is already known (via --task or an unambiguous --prompt resolution), the recommended claim command prefers the explicit --task TASK-XXX form over re-passing the natural-language prompt.",options:[z,{flag:"--claim",summary:"Start the selected fast/normal/batch route and create the required runtime state."},{flag:"--actor",value:"id",summary:"Actor id used for next --claim (or set ATM_ACTOR_ID)."},{flag:"--allow-stale-runner",summary:"Allow a human-approved runner-recovery lease to perform only the claim lifecycle while frozen runner publication is unavailable. This does not imply WIP adoption."},{flag:"--adopt-unowned-wip",summary:"With --claim and one explicit --task only, adopt unowned dirty WIP within the declared task scope. No --files, --tasks, --prompt or --intent override; foreign owners remain protected."},{flag:"--emergency-approval",value:"leaseId",summary:"Emergency lease required with --allow-stale-runner for a recovery claim."},{flag:"--atoms",value:"symbols",summary:"For next --claim: comma-separated symbols in the task scope files to reserve as derived atoms (an intent ceiling, not an exclusive guarantee). Tasks that reserve disjoint atoms of one file are admitted in parallel; the governed commit confirms the atoms the staged diff actually touched. Symbols that do not exist yet are confirmed at commit time."},{flag:"--auto-intent",summary:"For next --claim task routes, auto-resolve write vs closeout-only from in-scope dirty files and whether deliverables already landed in HEAD."},{flag:"--claim-intent",value:"mode",summary:"Override claim mode for next --claim: write or closeout-only/no-more-mutation."},{flag:"--closeout-only",summary:"Alias for --claim-intent closeout-only on next --claim."},{flag:"--no-more-mutation",summary:"Alias for --claim-intent closeout-only on next --claim."},{flag:"--files",value:"csv",summary:"Optional comma-separated scope files for next --claim; ATM still includes the task ledger record in the underlying claim."},{flag:"--prompt",value:"text",summary:"Scope next-action routing to the current user prompt before falling back to global state."},{flag:"--planning-root",value:"path",summary:"Use one explicit planning authority root and bypass ambiguous sibling discovery for this route."},{flag:"--task",value:"id",summary:"Route directly to one task id without writing a shared task-intent file."},{flag:"--tasks",value:"csv",summary:"Freeze an explicit comma-separated task id range for a batch claim."},{flag:"--intent",value:"path",summary:"Read an atm.taskIntent.v1 JSON file produced by a trusted skill or integration hook."},{flag:"--output",value:"path",summary:"Write JSON output to a file. When passed without a path, defaults to .atm-temp/next-<timestamp>.json."},{flag:"--verbose",summary:"Skip default output compaction and return the full untrimmed envelope (large frameworkStatus file lists, duplicated top-level aliases, full playbook echoed inside messages)."},G,H,W],examples:["node atm.mjs next --json","node atm.mjs next --json --output",'node atm.mjs next --prompt "implement TASK-ABC-0001" --json','node atm.mjs next --prompt "implement TASK-ABC-0001" --planning-root C:/planning/docs/ai_atomic_framework --json',"node atm.mjs next --task TASK-ABC-0001 --json",'node atm.mjs next --prompt "quick fix tsconfig.json typo" --json','node atm.mjs next --prompt "complete all task cards in PlanAlpha" --json','node atm.mjs next --claim --actor codex-main --prompt "complete selected cards" --tasks TASK-1,TASK-2 --json',"node atm.mjs next --intent .atm/runtime/task-intent.json --json","node atm.mjs next --cwd <host-repo> --json","node atm.mjs next --claim --actor codex-main --task TASK-ABC-0001 --auto-intent --json","node atm.mjs next --claim --actor codex-main --task TASK-ABC-0001 --adopt-unowned-wip --auto-intent --json","node atm.mjs next --claim --actor codex-main --task TASK-ABC-0001 --files packages/core/src/index.ts --claim-intent write --json",'node atm.mjs next --claim --actor codex-main --prompt "implement TASK-ABC-0001" --auto-intent --json',"node atm.mjs next --claim --actor codex-main --task TASK-ABC-0001 --claim-intent closeout-only --json"],help:{audience:"agent",requiredFlagSets:[{when:"Claiming a governed route",flags:["--claim","--actor"]},{when:"Routing one exact task without fuzzy prompt matching",flags:["--task"]}],relatedCommands:['node atm.mjs guide --goal "<goal>" --json',"node atm.mjs task-view --task TASK-ABC-0001 --json","node atm.mjs batch checkpoint --actor <actor-id> --json"],commonMistakes:["Passing one broad prompt that names many task ids; prefer --task, --tasks, or an intent file when the scope is already known.","Running low-level tasks claim loops after next selected a batch lane.","Treating next as task closure; next chooses the governed route, but evidence and closeout still happen in the selected playbook."],playbookNotes:["Read evidence.nextAction.playbook before editing, committing, or closing a task.","When the prompt already resolves to one exact task, prefer next --claim --task TASK-XXX over re-passing natural language.","If governanceReadiness is present, resolve doctor/framework claim/pre-push blockers before implementation.","Default output is compacted (large frameworkStatus file lists truncated, duplicated top-level aliases removed, playbook echoed once via evidence.nextAction.playbook); pass --verbose for the full untrimmed envelope."]}})});var C5,R5=y(()=>{"use strict";_();ce();C5=q({name:"self-host-alpha",summary:"Verify deterministic self-hosting alpha criteria.",options:[z,{flag:"--verify",summary:"Run the deterministic self-hosting alpha checklist."},{flag:"--agent",value:"profile",summary:"Optional advisory confidence profile."},G,H,W],examples:["node atm.mjs self-host-alpha --verify --json","node atm.mjs self-host-alpha --verify --agent claude-code --json"]})});var x5,E5=y(()=>{"use strict";_();ce();x5=q({name:"spec",summary:"Validate an atomic spec or supported report against schema contracts.",options:[z,{flag:"--validate",value:"path",summary:"Spec file path to validate."},G,H,W],examples:["node atm.mjs spec --validate tests/schema-fixtures/positive/hello-world.atom.json --json","node atm.mjs spec --validate tests/schema-fixtures/map-equivalence-report/positive.json --json"]})});var _5,P5=y(()=>{"use strict";_();ce();_5=q({name:"status",summary:"Inspect ATM status in framework or adopted repositories, including active worker claims for one-glance coordination.",options:[z,G,H,W],examples:["node atm.mjs status --json","node atm.mjs status --pretty"]})});var M5={};pi(M5,{default:()=>QD});var QD,XD=y(()=>{"use strict";_();ce();QD=q({name:"tasks",summary:"Backend and generator surfaces for task plans, runtime ledger, queues, and claim lifecycle. taskflow open/close is the official operator lane and the normal entry for governed work; the tasks subcommands below are backend/generator surfaces that should be invoked through taskflow when possible. taskflow close --write owns the exclusive close-window staged-index lock during governed staging; do not stage competing governance bundles while that lock is active. tasks new is the low-level template generator (no governed lifecycle, no runtime import). tasks import is the runtime synchronization surface that loads a planning markdown into the target ledger (taskflow open --write calls this internally). tasks close, tasks reconcile, tasks repair-closure, tasks repair-claim, tasks import --write --force, tasks reset, and tasks lock cleanup are protected backend surfaces and emergency mutations when used directly; prefer taskflow close for normal closeback. tasks repair-claim is diagnose-first: default mode reports stale, dangling, expired, or conflicting claim drift without mutation; pass --write --reason only when no valid active lease or session blocks repair. When historical delivery needs to be reconstructed across multiple commits, evidence historical-batch authors the close-ready task slice and tasks close consumes that slice as a backend surface. tasks import preserves task-card machine fields with high fidelity: scopePaths, deliverables, validators, target_repo, planning_repo, closure_authority, planningMirrorPaths, planningReadOnlyPaths, outOfScope, nonGoals, nested evidence.required, rollback.strategy, rollback.notes, atomizationImpact, compact dispatchPattern / conditionReview / mailboxAssignee dispatch metadata, and emits importDiagnostics for legacy aliases (allowed_files, blocked_by, upstream_repo).",positional:[{name:"action",summary:"create | import | mirror | verify | scope | audit | queue | parallel | lock | migrate-legacy-ledger | reset | claim | renew | release | handoff | takeover | block | abandon | close | reconcile | repair-closure | repair-claim | show | status | finalize | roster | new | realign-plan-source | seal-plan-source",required:!0}],options:[z,{flag:"--from",value:"path",summary:"Markdown plan path for tasks import.",subcommands:["import"]},{flag:"--dry-run",summary:"Parse the plan and emit a manifest without writing task files. Planning-source maintenance reports its narrow seal proposal without mutating ledger files or HEAD."},{flag:"--write",summary:"Write canonical task JSON files to .atm/history/tasks/ and persist import evidence. tasks seal-plan-source updates only a missing planning commit identity and appends a transition event."},{flag:"--map",value:"path",summary:"JSON path map for tasks realign-plan-source (object of from->to paths, or { mappings: [{ from, to }] }).",subcommands:["realign-plan-source"]},{flag:"--planning-repo",value:"path",summary:"Optional planning repository root for tasks realign-plan-source path resolution (defaults to ATM_PLANNING_REPO_ROOT or cwd)."},{flag:"--force",summary:"Overwrite existing task files even when the source hash differs. Active claims are still preserved unless --force-overwrite-claims is set."},{flag:"--force-overwrite-claims",summary:"Allow tasks import --write to overwrite tasks with active or handoff claims and emit claim-displaced-by-import transition events.",subcommands:["import"]},{flag:"--metadata-only",summary:"For tasks import: update only validator metadata and planning-source seal; requires --preserve-active-claim and --write.",subcommands:["import"]},{flag:"--preserve-active-claim",summary:"For tasks import: require the current active claim owner and preserve lifecycle/scope fields during metadata-only repair.",subcommands:["import"]},{flag:"--waive-planning-root",summary:"For framework-repo AAO/TEAM imports from .atm/task-plans: explicitly waive the canonical planning-root authorship preflight; requires --reason.",subcommands:["import"]},{flag:"--reason",value:"text",summary:"Required rationale when --waive-planning-root is set."},{flag:"--reset-open",summary:"Rebuild matching imported tasks as open during tasks import --write.",subcommands:["import"]},{flag:"--apply",summary:"Apply tasks migrate-legacy-ledger changes instead of reporting a dry-run.",subcommands:["migrate-legacy-ledger"]},{flag:"--all-stale",summary:"Clean every stale runtime task lock candidate for tasks lock cleanup.",subcommands:["lock"]},{flag:"--reserved-ok",summary:"Allow tasks release to return a reserved task with no active claim back to open.",subcommands:["release"]},{flag:"--wip-commit",summary:"For tasks release: commit dirty in-scope WIP files as a non-delivery preservation commit before releasing.",subcommands:["release"]},{flag:"--discard-wip",summary:"For tasks release: discard dirty in-scope WIP files with an auditable discard receipt before releasing.",subcommands:["release"]},{flag:"--staged",summary:"Run tasks audit in staged/pre-commit mode."},{flag:"--summary",summary:"For tasks audit: emit the read-only atm.taskReadProjection.v1 row set with the default field set instead of findings."},{flag:"--fields",value:"names",summary:"For tasks audit: comma-separated projection fields (taskId, status, claimState, owner, lastTransitionAt, residueBucket, nextActionCode, planningStatus, partialClose). Unknown fields fail closed."},{flag:"--tasks",value:"ids",summary:"For tasks audit projection: comma-separated task ids to project. Mutually exclusive with --series and --all."},{flag:"--series",value:"prefix",summary:"For tasks audit projection: project every ledger task under a task-id prefix such as GIT or TASK-GIT."},{flag:"--all",summary:"For tasks audit projection: project every task in the ledger. Explicit opt-in; no implicit default."},{flag:"--queue",value:"id",summary:"Task queue id for tasks queue abandon."},{flag:"--task",value:"id",summary:"Task id for claim/renew/release/handoff/takeover/close/reconcile/repair-closure/repair-claim/status/finalize diagnose/scope add/scope remove/scope repair."},{flag:"--residue",summary:"For tasks status, return residue-focused diagnosis evidence only (including source-done-governance-incomplete vs ambiguous-manual-review)."},{flag:"--allow-stale-runner",summary:"Allow write actions while the frozen runner is older than framework source (disaster recovery only)."},{flag:"--emergency-approval",value:"leaseId",summary:"Required for protected direct backend emergency surfaces; obtain via emergency approve after human approval."},{flag:"--with",value:"id",summary:"Second task id for tasks parallel pair analysis."},{flag:"--actor",value:"id",summary:"Actor id for reservation/claim/close/reconcile lifecycle actions (or set ATM_ACTOR_ID)."},{flag:"--auto-intent",summary:"For tasks claim, auto-resolve write vs closeout-only from in-scope dirty files and whether declared deliverables already landed in HEAD."},{flag:"--claim-intent",value:"mode",summary:"Claim mode for tasks claim: write (default) or closeout-only/no-more-mutation."},{flag:"--closeout-only",summary:"Alias for --claim-intent closeout-only when claiming for non-mutating closeback work."},{flag:"--no-more-mutation",summary:"Alias for --claim-intent closeout-only; keep for closeback-only intent surface."},{flag:"--title",value:"text",summary:"Optional title for tasks create when creating a manual task entry."},{flag:"--provider",value:"id",summary:"External provider id for tasks mirror."},{flag:"--origin-task",value:"id",summary:"External task id for tasks mirror."},{flag:"--origin-url",value:"url",summary:"External task URL for tasks mirror."},{flag:"--sync-status",value:"state",summary:"Mirror sync status for tasks mirror."},{flag:"--files",value:"csv",summary:"Comma-separated scope files for claim/takeover lock acquisition."},{flag:"--adopt-unowned-wip",summary:"Claim backend flag forwarded by exact-task next --claim adoption. It never permits taking foreign-owned WIP; use the normal next route.",subcommands:["claim"]},{flag:"--add",value:"csv",summary:"Comma-separated paths to add to the active task direction lock allowedFiles. Used with tasks scope add/repair."},{flag:"--remove",value:"csv",summary:"Comma-separated non-deliverable paths to remove from an active task runtime scope. Used with tasks scope remove; requires the active claim owner and never needs emergency approval."},{flag:"--claim-first",summary:"For tasks scope add, auto-claim the task with --auto-intent before scope amendment when no active claim exists."},{flag:"--ttl-seconds",value:"number",summary:"Lease ttl in seconds for claim/renew/takeover."},{flag:"--to",value:"id",summary:"Target actor id for handoff."},{flag:"--status",value:"state",summary:"Target status for tasks close: done|review|blocked|abandoned. done requires real non-.atm deliverables plus evidence."},{flag:"--reason",value:"text",summary:"Reason for release, handoff, takeover, close, or scope repair."},{flag:"--historical-delivery",value:"commit",summary:"Allow tasks close done or tasks reconcile to verify an earlier delivery commit."},{flag:"--historical-batch",value:"batchId-or-path",summary:"For tasks close done: consume an evidence historical-batch task slice and derive the matched delivery commits plus close-readiness verdict."},{flag:"--historical-delivery-repo",value:"path",summary:"For planning-repo authority closeback, verify --historical-delivery against this repo root instead of the target repo."},{flag:"--waiver-out-of-scope-delivery",summary:"Allow historical delivery when the commit also contains unrelated source files; requires --reason."},{flag:"--waive-out-of-scope",summary:"Alias for --waiver-out-of-scope-delivery."},{flag:"--scope",value:"taskId",summary:"For tasks repair-closure, limit dirty-tree blocking to files overlapping the scoped task claim/direction lock/deliverables; unrelated dirty files become warnings."},{flag:"--amend",summary:"For tasks repair-closure, explicitly request HEAD rewrite after staging the repaired packet. ATM fails safely when no amend-capable governed wrapper is available."},{flag:"--no-amend",summary:"Compatibility alias for the default stage-only tasks repair-closure flow."},{flag:"--template",value:"name",summary:"Template key for tasks new."},{flag:"--task-id",value:"id",summary:"Task id for tasks new."},{flag:"--output",value:"path",summary:"Output markdown path for tasks new."},{flag:"--atom-id",value:"id",summary:"Atom id placeholder for tasks new."},{flag:"--scope-path",value:"path",summary:"Scope path placeholder for tasks new."},{flag:"--test-path",value:"path",summary:"Test path placeholder for tasks new."},{flag:"--depends-on",value:"id",summary:"Depends on placeholder for tasks new."},{flag:"--capability",value:"text",summary:"Capability description placeholder for tasks new."},{flag:"--goal",value:"text",summary:"Goal description placeholder for tasks new."},{flag:"--index",value:"path",summary:"Roster README path for tasks roster update."},{flag:"--from",value:"path",summary:"Task markdown path for tasks roster update."},G,H,W],examples:["node atm.mjs tasks import --from docs/plan.md --dry-run --json","node atm.mjs tasks import --from docs/plan.md --write --json","node atm.mjs tasks realign-plan-source --map .atm/runtime/plan-path-realign-map.json --dry-run --json","node atm.mjs tasks realign-plan-source --map .atm/runtime/plan-path-realign-map.json --write --actor codex-main --json","node atm.mjs tasks seal-plan-source --task ATM-GOV-0324 --dry-run --json","node atm.mjs tasks seal-plan-source --task ATM-GOV-0324 --write --actor codex-main --json",'node atm.mjs tasks create --task ATM-GOV-0100 --actor codex-main --title "Governance task" --json',"node atm.mjs tasks mirror --provider github --origin-task 123 --origin-url https://github.com/org/repo/issues/123 --actor codex-main --json","node atm.mjs tasks verify --json","node atm.mjs tasks audit --json","node atm.mjs tasks audit --tasks TASK-GIT-0024,TASK-GIT-0025 --summary --json","node atm.mjs tasks audit --series GIT --summary --fields taskId,status,claimState,owner,lastTransitionAt,residueBucket,nextActionCode --json","node atm.mjs tasks audit --staged --json","node atm.mjs tasks scope add --task ATM-GOV-0101 --actor codex-main --add packages/cli/src/commands/new-feature.ts --json","node atm.mjs tasks scope add --task ATM-GOV-0101 --actor codex-main --claim-first --add docs/linked-surface.md --json","node atm.mjs tasks scope add --task ATM-GOV-0101 --actor codex-main --add packages/cli/src/commands/foo.ts,packages/cli/src/commands/bar.ts --json",'node atm.mjs tasks scope remove --task ATM-GOV-0101 --actor codex-main --remove packages/cli/src/commands/obsolete-glob.ts --reason "narrow to delivered files" --json','node atm.mjs tasks scope repair --task ATM-GOV-0101 --actor codex-main --add packages/cli/src/commands/foo.ts --reason "Add emergency in-scope docs" --emergency-approval EMG-... --json',"node atm.mjs tasks queue status --json","node atm.mjs tasks queue abandon --queue queue-abc123 --actor codex-main --json","node atm.mjs tasks parallel --task TASK-AAO-0130 --with TASK-AAO-0131 --json","node atm.mjs tasks parallel --task TASK-AAO-0130 --queue --json","node atm.mjs tasks parallel --queue --report --json","node atm.mjs tasks lock cleanup --all-stale --actor codex-main --json","node atm.mjs tasks migrate-legacy-ledger --actor codex-main --dry-run --json","node atm.mjs tasks migrate-legacy-ledger --actor codex-main --apply --json","node atm.mjs next --claim --actor codex-main --task ATM-GOV-0101 --auto-intent --json",'node atm.mjs tasks reset --task ATM-GOV-0101 --actor codex-main --to open --reason "rollback cleanup" --json',"node atm.mjs tasks claim --task ATM-GOV-0101 --actor codex-main --files packages/core/src/index.ts --json","node atm.mjs tasks claim --task ATM-GOV-0101 --actor codex-main --files packages/core/src/index.ts --auto-intent --json","node atm.mjs tasks claim --task ATM-GOV-0101 --actor codex-main --files packages/core/src/index.ts --claim-intent closeout-only --json","node atm.mjs tasks claim --task ATM-GOV-0101 --actor codex-main --files packages/core/src/index.ts --no-more-mutation --json","node atm.mjs tasks renew --task ATM-GOV-0101 --actor codex-main --ttl-seconds 3600 --json",'node atm.mjs tasks release --task ATM-GOV-0101 --actor codex-main --reason "handoff complete" --json','node atm.mjs tasks release --task ATM-GOV-0101 --actor codex-main --reserved-ok --reason "rollback cleanup" --json',"node atm.mjs tasks close --task ATM-GOV-0104 --actor codex-main --status done --json","node atm.mjs tasks close --task ATM-GOV-0104 --actor codex-main --status done --historical-delivery abc123 --emergency-approval EMG-... --json","node atm.mjs tasks close --task ATM-GOV-0104 --actor codex-main --status done --historical-batch hist-batch-2026-06-15T17-28-20-007Z --json","node atm.mjs tasks close --task ATM-GOV-0104 --actor codex-main --status done --historical-delivery abc123 --historical-delivery-repo ../planning --emergency-approval EMG-... --json","node atm.mjs tasks repair-closure --task TASK-AAO-0102 --json","node atm.mjs tasks repair-claim --task TASK-MAO-0043 --actor codex-main --json",'node atm.mjs tasks repair-claim --task TASK-MAO-0043 --actor codex-main --write --reason "release expired claim drift" --json','node atm.mjs tasks block --task ATM-GOV-0104 --actor codex-main --reason "waiting on target evidence" --json',"node atm.mjs tasks reconcile --task TASK-AAO-0055 --actor codex-main --delivery-commit abc1234 --emergency-approval EMG-... --json","node atm.mjs tasks status --task TASK-AAO-0137 --json","node atm.mjs tasks status --task TASK-AAO-0137 --residue --json","node atm.mjs tasks finalize diagnose --task TASK-AAO-0137 --json","node atm.mjs tasks roster update --index docs/tasks/README.md --from docs/tasks/TASK-ADOPTER-0001.task.md --dry-run --json","node atm.mjs tasks roster update --index docs/tasks/README.md --from docs/tasks/TASK-ADOPTER-0001.task.md --json"],help:{audience:"mixed",requiredFlagSets:[{when:"Checking one task status or residue",flags:["--task"]},{when:"Protected backend close or reconcile",flags:["--task","--actor"]},{when:"Emergency scope repair or protected backend mutation",flags:["--task","--actor","--emergency-approval"]}],relatedCommands:["node atm.mjs next --claim --task TASK-ABC-0001 --actor <actor-id> --auto-intent --json","node atm.mjs taskflow close --task TASK-ABC-0001 --actor <actor-id> --dry-run --json","node atm.mjs evidence validators --list --task TASK-ABC-0001 --json"],commonMistakes:["Treating tasks close or tasks reconcile as the first operator lane instead of taskflow close.","Writing force/import/reset style backend mutations before checking whether the task already has an active claim or a cleaner prompt-scoped route."],playbookNotes:["Use tasks status, show, audit, queue, and scope as read-only or repair surfaces around the main next/taskflow workflow.","tasks repair-claim is diagnose-first; add --write only after the diagnosis proves no valid active lease still owns the task."],maintainerNotes:["Protected backend surfaces remain available for maintainers and emergency reconcile work, but they must preserve evidence and lifecycle metadata.","tasks new is only the low-level template generator; it does not import or claim governed work by itself."],deprecatedGuidance:["Legacy reserve/promote lifecycle surfaces were removed; next --claim is the only claim entry."]}})});var O5,D5=y(()=>{"use strict";_();ce();O5=q({name:"upgrade",summary:"Propose upgrade evolution from report evidence inputs or plan safe ATM onboarding upgrades.",positional:[{name:"action",summary:"base-sync | plan | apply | rollback | experimental-api (or legacy --propose / --scan)",required:!1}],options:[z,{flag:"--actor",value:"id",summary:"Required actor for governed framework base-sync."},{flag:"--out",value:"path",summary:"Write a safe upgrade plan JSON file."},{flag:"--allow-unknown-chart",summary:"Allow upgrade plan generation when the local ATMChart version is unknown."},{flag:"--from-plan",value:"path",summary:"Apply a previously reviewed safe upgrade plan."},{flag:"--canary",value:"percent",summary:"Apply only a deterministic canary subset of a safe upgrade plan and record canary state."},{flag:"--backup",value:"path",summary:"Rollback from a backup directory created by upgrade apply."},{flag:"--api",value:"id",summary:"Experimental API id for upgrade experimental-api."},{flag:"--allow-experimental",summary:"Explicitly allow @experimental SDK API invocation."},{flag:"--propose",summary:"Generate an upgrade proposal."},{flag:"--scan",summary:"Run the evidence-driven draft bridge from detector reports."},{flag:"--dry-run",summary:"Generate proposal without mutating persisted artifacts."},{flag:"--atom",value:"id",summary:"Target atom id."},{flag:"--from",value:"version",summary:"Source version; expected full HEAD SHA for base-sync."},{flag:"--to",value:"version",summary:"Target version; descendant full commit SHA for base-sync."},{flag:"--target",value:"kind",summary:"Target kind: atom | map."},{flag:"--map",value:"id",summary:"Target map id when target kind is map."},{flag:"--replacement-mode",value:"mode",summary:"Requested replacement rollout mode for map proposals: draft | shadow | canary | active | legacy-retired."},{flag:"--equivalence-report",value:"path",summary:"Map equivalence report path for map proposals."},{flag:"--polymorph-impact-report",value:"path",summary:"Polymorph impact report path for active map proposals with template-bound members."},{flag:"--propagation-report",value:"path",summary:"Propagation report path for active map proposals."},{flag:"--review-advisory",value:"path",summary:"Review advisory report path for active map proposals."},{flag:"--human-review",value:"path",summary:"Human review decision path for active map proposals."},{flag:"--rollback-proof",value:"path",summary:"Rollback proof path for map proposals."},{flag:"--retirement-proof",value:"path",summary:"Retirement proof path for legacy-retired map proposals."},{flag:"--behavior",value:"id",summary:"Behavior id to route proposal generation."},{flag:"--decomposition-decision",value:"decision",summary:"Explicit decomposition decision override."},{flag:"--legacy-target",value:"path#symbol",summary:"LegacyRoutePlan-selected target for guided atomize/infect/split dry-run proposals."},{flag:"--guidance-session",value:"id",summary:"Guidance session id that authorized a guided legacy dry-run proposal."},{flag:"--fork-source",value:"id",summary:"Fork source atom id."},{flag:"--new-atom-id",value:"id",summary:"Fork destination atom id."},{flag:"--input",value:"path",summary:"Input report path (repeatable)."},{flag:"--proposal-id",value:"id",summary:"Override proposal id."},{flag:"--proposed-by",value:"name",summary:"Proposal author label."},{flag:"--proposed-at",value:"timestamp",summary:"Proposal timestamp override."},G,H,W],examples:["node atm.mjs upgrade base-sync --cwd ../ATM-source --actor grok-bot --from <full-current-SHA> --to <full-target-SHA> --json","node atm.mjs upgrade plan --cwd . --out .atm/history/reports/upgrade-plan.json --json","node atm.mjs upgrade plan --cwd . --allow-unknown-chart --json","node atm.mjs upgrade apply --from-plan .atm/history/reports/upgrade-plan.json --json","node atm.mjs upgrade apply --from-plan .atm/history/reports/upgrade-plan.json --canary 25 --json","node atm.mjs upgrade rollback --backup .atm/backups/<backup-id> --json","node atm.mjs upgrade experimental-api --api agent-pack-preview --allow-experimental --json","node atm.mjs upgrade --propose --atom ATM-CORE-0001 --to 1.1.0 --input fixtures/upgrade/hash-diff-report.json --json","node atm.mjs upgrade --propose --atom ATM-CORE-0001 --to 1.1.0 --target map --map ATM-MAP-0001 --replacement-mode active --equivalence-report atomic_workbench/maps/ATM-MAP-0001/map.equivalence.report.json --input fixtures/upgrade/hash-diff-report.json --json","node atm.mjs upgrade --propose --atom ATM-CORE-0001 --to 1.1.0 --target map --map ATM-MAP-0001 --replacement-mode active --polymorph-impact-report atomic_workbench/maps/ATM-MAP-0001/polymorph-impact-report.json --propagation-report .atm/history/reports/propagation-report.json --review-advisory .atm/history/reports/review-advisory.json --human-review .atm/history/reports/human-review-approve.json --input fixtures/upgrade/hash-diff-report.json --json","node atm.mjs upgrade --propose --atom ATM-CORE-0001 --to 1.1.0 --target map --map ATM-MAP-0001 --replacement-mode legacy-retired --retirement-proof .atm/history/reports/retirement-proof.json --input fixtures/upgrade/hash-diff-report.json --json",'node atm.mjs upgrade --propose --behavior behavior.infect --legacy-target "src/legacy.js#normalizeInput" --guidance-session <session-id> --dry-run --json',"node atm.mjs upgrade --scan --input fixtures/evolution/evidence-patterns/recurring-failure-candidate.json --json"]})});var F5,j5=y(()=>{"use strict";_();ce();F5=q({name:"test",summary:"Run atom smoke, spec, plugin-backed test runner, map integration, map equivalence, or propagation tests.",options:[z,{flag:"--atom",value:"name",summary:"Run canned atom smoke (currently: hello-world)."},{flag:"--spec",value:"path",summary:"Run spec-based test runner flow. If <spec>.test-runner.json exists beside the spec, ATM auto-loads plugin plans and default gate fixtures from it."},{flag:"--profile",value:"quick|standard|full",summary:"Select the catalog-aligned integration-test profile for plugin-backed spec tests."},{flag:"--suite",value:"key-or-family",summary:"Narrow plugin-backed spec tests to a declared suite, family, or command key."},{flag:"--map",value:"id",summary:"Run map integration test for a map id."},{flag:"--equivalence-fixtures",value:"path",summary:"Run map equivalence using a fixture set. Must be paired with --map."},{flag:"--propagate",value:"id",summary:"Run downstream propagation checks for an atom id."},G,H,W],examples:["node atm.mjs test --atom hello-world --json","node atm.mjs test --spec tests/test-runner-fixtures/plugin.atom.json --profile quick --json","node atm.mjs test --map ATM-MAP-0001 --json","node atm.mjs test --map ATM-MAP-0001 --equivalence-fixtures fixtures/equivalence/checkout-mini.json --json"],help:{audience:"general",requiredFlagSets:[{when:"Running equivalence fixtures",flags:["--map","--equivalence-fixtures"]}],relatedCommands:['node atm.mjs evidence run --task TASK-ABC-0001 --actor <actor-id> --command "node atm.mjs test --map ATM-MAP-0001 --json" --json',"node atm.mjs validate --json"],commonMistakes:["Passing --equivalence-fixtures without also selecting a map id.","Treating test output as durable close evidence without recording it through evidence run when governance requires it."]}})});var $5,L5=y(()=>{"use strict";_();ce();$5=q({name:"telemetry",summary:"Manage opt-in ATM CLI telemetry and local governance gate telemetry for the current repository.",positional:[],options:[z,{flag:"--on",summary:"Opt in to telemetry for this repository."},{flag:"--off",summary:"Opt out of telemetry for this repository."},{flag:"--status",summary:"Show telemetry status (default action)."},{flag:"--endpoint",value:"url",summary:"Optional telemetry endpoint recorded with opt-in."},{flag:"--gate-registry",summary:"Show the canonical local governance gate check registry."},{flag:"--coverage-report",summary:"Show required governance node coverage and M2 preflight readiness."},{flag:"--shared-write-coverage",summary:"Show canonical shared-write gate producer coverage with unavailable receipts."},{flag:"--m2-preflight",summary:"Alias for --coverage-report, intended for analyzer preflight."},{flag:"--task-summary",summary:"Show digest-only per-task gate telemetry summary from sealed history."},{flag:"--emit-fixture",summary:"Write one local governance gate telemetry fixture event to gitignored runtime scratch."},{flag:"--seal",summary:"Seal local governance gate telemetry runtime events to immutable history."},{flag:"--report",summary:"Report local governance gate telemetry from sealed history."},{flag:"--include-runtime",summary:"Include runtime scratch in a diagnostic gate telemetry report."},{flag:"--task",value:"id",summary:"Task id for local gate telemetry fixture or seal."},{flag:"--role",value:"baseline|treatment|m2-preflight|unknown",summary:"Task summary baseline/treatment role."},{flag:"--window",value:"id",summary:"Window id for local gate telemetry seal."},{flag:"--watermark",value:"iso-time",summary:"Watermark for local gate telemetry seal."},{flag:"--gate",value:"name",summary:"Gate name for local fixture emission."},{flag:"--check-id",value:"id",summary:"Canonical check id for local fixture emission."},{flag:"--result",value:"pass|block|warn|skip|error",summary:"Result for local fixture emission."},{flag:"--reason",value:"class",summary:"Reason class for local fixture emission."},{flag:"--duration-ms",value:"number",summary:"Duration for local fixture emission."},{flag:"--actor",value:"id",summary:"Actor id for local fixture emission."},{flag:"--run-id",value:"id",summary:"Run id correlation key for local fixture emission."},{flag:"--lane-session-id",value:"id",summary:"Lane session correlation key for local fixture emission."},{flag:"--batch-id",value:"id",summary:"Batch id correlation key for local fixture emission."},{flag:"--wave-id",value:"id",summary:"Wave id correlation key for local fixture emission."},{flag:"--correlation-id",value:"id",summary:"Correlation id for local fixture emission."},{flag:"--evidence-read-ref",value:"ref",summary:"Compact evidence readback reference consumed by this telemetry event."},G,H,W],examples:["node atm.mjs telemetry --status --json","node atm.mjs telemetry --on --json","node atm.mjs telemetry --off --json","node atm.mjs telemetry --gate-registry --json","node atm.mjs telemetry --coverage-report --json","node atm.mjs telemetry --shared-write-coverage --json","node atm.mjs telemetry --m2-preflight --json","node atm.mjs telemetry --task-summary --task ATM-GOV-0195 --role m2-preflight --json","node atm.mjs telemetry --emit-fixture --task ATM-GOV-0193 --json","node atm.mjs telemetry --seal --task ATM-GOV-0193 --json","node atm.mjs telemetry --report --json"]})});var QPe,XPe,ZPe,eMe,tMe,rMe,oMe,aMe,nMe,sMe,iMe,cMe,lMe,dMe,N5,B5=y(()=>{"use strict";_();ce();QPe={name:"team",summary:"Plan, start, or validate scoped ATM team agents for a task. Validates permissions, leases, task claim dependency gates, parallel CID advisor preflight, and broker lane routing for steward/composer paths.",positional:[{name:"action",summary:"Team action. Supports: plan, start, status, validate, patrol, lease, release, complete, abandon, handoff show|context|stats, wave, knowledge. Plan and start evaluate broker lanes plus task claim dependency gates, and fail closed before a run starts."}],options:[z,{flag:"--task",value:"id",summary:"Task id to plan, validate, or start a team for."},{flag:"--recipe",value:"id",summary:"Optional team recipe id. Defaults to a language-aware built-in recipe."},{flag:"--actor",value:"id",summary:"Actor id for team start."},{flag:"--batch",value:"id",summary:"For team wave plan/dispatch: consume the selected batch run as the wave manifest source."},{flag:"--runtime-mode",value:"mode",summary:"Team runtime mode: real-agent, editor-subagent, or broker-only. Defaults to broker-only."},{flag:"--runtime-language",value:"name",summary:"Runtime language contract for this team run. Defaults to node."},{flag:"--runtime-adapter",value:"id",summary:"Vendor-neutral runtime adapter id recorded on the team run."},{flag:"--provider",value:"id",summary:"Optional provider metadata recorded on the runtime contract."},{flag:"--sdk",value:"id",summary:"Optional SDK metadata recorded on the runtime contract."},{flag:"--model",value:"id",summary:"Optional model metadata recorded on the runtime contract."},{flag:"--role-provider",value:"role=provider:model[:sdk][:mode]",repeatable:!0,summary:"Override provider/model selection for one Team role. Repeatable."},{flag:"--team-size",value:"level",summary:"Manual team size/level override: small/L1 core, medium/L2 reader+evidence, large/L3 scope, L4 lieutenant, L5 review+knowledge."},{flag:"--disable-editor-bridge",summary:"Disable the editor-subagent bridge contract for this run while preserving Team governance semantics."},{flag:"--execute",summary:"Execute governed provider orchestration for selected Team roles after runtime state is written. Defaults off."},{flag:"--executor",value:"mode",summary:"For team wave plan/dispatch: executor mode auto, local-lanes, editor-subagents, team-agents, or manual."},{flag:"--team",value:"id",summary:"Team run id for status or patrol."},{flag:"--broker-proposal-file",value:"path",summary:"Validated broker proposal consumed by team plan (readiness preview) and a matching hot Team start. Proposal-first rejections emit a machine-actionable recovery contract (schema atm.patchProposal.v1); mismatched, stale, or out-of-scope proposals fail closed on both surfaces."},{flag:"--read-only",summary:"team plan only: read-only projection mode. Skips broker-registry cleanup persistence and downgrades proposal-first-required to a warning so diagnostics such as indexLane still return. Does not change team start fail-closed semantics."},{flag:"--permission",value:"id",summary:"Permission id for team lease or release."},{flag:"--paths",value:"csv",summary:"Comma-separated lease paths for team lease."},{flag:"--reason",value:"text",summary:"Reason recorded for team lease, release, complete, or abandon."},{flag:"--mode",value:"name",summary:"Team patrol mode: claim-preflight, close-preflight, big-script, or daily-noon."},{flag:"--compact",summary:"Return a compact status payload."},{flag:"--scope",value:"name",summary:"Knowledge build scope for team knowledge build."},{flag:"--dry-run",summary:"Run team knowledge build without writing generated runtime cache files."},{flag:"--write",summary:"Write team knowledge generated cache files under .atm/runtime/knowledge."},{flag:"--query",value:"text",summary:"Literal advisory query text for team knowledge query."},{flag:"--top",value:"n",summary:"Maximum advisory team knowledge hits to return."},{flag:"--repo",value:"name",summary:"Team knowledge metadata filter."},{flag:"--channel",value:"name",summary:"Team knowledge metadata filter."},{flag:"--domain",value:"name",summary:"Team knowledge metadata filter."},{flag:"--path",value:"glob",summary:"Team knowledge metadata path filter."},{flag:"--atom",value:"id",summary:"Team knowledge metadata atom filter."},{flag:"--validator",value:"command",summary:"Team knowledge metadata validator filter."},{flag:"--wave",value:"id",summary:"For team wave plan/dispatch: deterministic wave id from the batch selector."},{flag:"--worker-report",value:"path",repeatable:!0,summary:"For team wave dispatch: worker report JSON to reconcile into the executor-neutral runtime result."},G,H,W]},XPe={summary:"Plan examples for minimal crew briefing contract output (TASK-TEAM-0002 owns team.plan-crew-briefing-contract).",examples:["node atm.mjs team plan --task TASK-TEAM-0002 --json"]},ZPe={summary:"Plan examples for atomization planner advisory output (TASK-TEAM-0003 owns team.plan-atomization-planner).",examples:["node atm.mjs team plan --task TASK-TEAM-0003 --json"]},eMe={summary:"Plan examples for the TASK-TEAM-0009 dry-run resolver output, including the team implementer selector and atm.teamPlan.v1 evidence surface.",examples:["node atm.mjs team plan --task TASK-TEAM-0009 --json"]},tMe={summary:"Plan examples for deterministic role and implementer selection output with language, role, fallback, and confidence signals (TASK-TEAM-0010 owns the selector surface).",examples:["node atm.mjs team plan --task TASK-TEAM-0010 --json"]},rMe={summary:"Validate recipe permissions and scoped file.write leases before team start (TASK-TEAM-0012 owns structured permission lease findings; TASK-TEAM-0013 owns file.write scope checks).",examples:["node atm.mjs team validate --task TASK-TEAM-0013 --json","node atm.mjs team validate --task TASK-TEAM-0012 --json","node atm.mjs team validate --task TASK-AAO-0005 --recipe atm.default.normal.typescript --json"]},oMe={summary:"Team lease fencing and deadlock contract diagnostics cover duplicate exclusive owners, stale lease epochs, wait-for cycles, released tombstones, and allowedFiles write boundaries across real-agent, editor-subagent, and broker-only runs.",examples:["node --strip-types scripts/validate-team-agents.ts --case fencing-deadlock","node --strip-types scripts/validate-team-agents.ts --case active-resource-index-readonly"]},aMe={summary:"Plan/start claim-gate parity: team start fails closed when the normal task claim dependency gate would reject the task (TASK-TEAM-0029).",examples:["node atm.mjs team plan --task TASK-TEAM-0029 --json","node atm.mjs team start --task TASK-TEAM-0029 --actor codex-main --json"]},nMe={summary:"Plan examples for captain decision dry-run output that includes team sizing, confidence, and stop conditions (TASK-TEAM-0007 owns the decision surface).",examples:["node atm.mjs team plan --task TASK-TEAM-0007 --json"]},sMe={summary:"Plan examples for lieutenant escalation dry-run output that includes escalationRequired, escalationReason, needLieutenant, nextTeamShape, and the broker-over-coordinator authority chain (TASK-TEAM-0008 owns the escalation surface).",examples:["node atm.mjs team plan --task TASK-TEAM-0008 --json"]},iMe={summary:"Start and inspect a team runtime record with neutral runtime mode, adapter metadata, serialized commit lane, and broker subagent status fields (TASK-TEAM-0011 owns status; TASK-TEAM-0031 owns runtime contract fields).",examples:["node atm.mjs team start --task TASK-TEAM-0011 --actor codex-main --json","node atm.mjs team start --task TASK-TEAM-0031 --actor codex-main --runtime-mode broker-only --runtime-adapter atm.node.broker --json","node atm.mjs team start --task TASK-TEAM-0032 --actor codex-main --runtime-mode editor-subagent --runtime-adapter codex.desktop.subagent --json","node atm.mjs team start --task TASK-TEAM-0041 --actor codex-main --provider openai --sdk responses --model gpt-5-mini --json","node atm.mjs team status --compact --json"]},cMe={summary:"Read-only Team patrol report for runtime mode, broker-governance drift, rework readiness, missing artifacts, retry-budget risk, and close/claim preflight guidance (TASK-TEAM-0014).",examples:["node atm.mjs team patrol --task TASK-TEAM-0014 --json","node atm.mjs team patrol --task TASK-TEAM-0014 --mode close-preflight --json","node atm.mjs team patrol --task TASK-TEAM-0014 --team <teamRunId> --json"]},lMe={summary:"Advisory next/playbook teamRecommendation surface with plan/start/status/reason command hints without auto-running team commands (TASK-TEAM-0015).",examples:["node atm.mjs next --task TASK-TEAM-0015 --json","node atm.mjs team plan --task TASK-TEAM-0015 --json"]},dMe={summary:"Advisory Team knowledge build/query surface. Build discovers canonical .atm/knowledge shards; query and team plan expose compact Captain-facing hits from generated runtime cache without becoming a task gate.",examples:["node atm.mjs team knowledge build --scope project --dry-run --json","node atm.mjs team knowledge query --task TASK-AAO-0005 --top 5 --json","node atm.mjs team plan --task TASK-AAO-0005 --json"]},N5=q({...QPe,examples:[...XPe.examples,...ZPe.examples,...eMe.examples,...tMe.examples,...nMe.examples,...sMe.examples,...rMe.examples,...oMe.examples,...aMe.examples,...iMe.examples,...cMe.examples,...lMe.examples,...dMe.examples]})});var q5,G5=y(()=>{"use strict";_();ce();q5=q({name:"validate",summary:"Run repository, framework-development, taxonomy, or atomic spec validation checks.",positional:[{name:"validation-name",summary:"Optional named validation such as atom-callsite-readability, framework-development, or taxonomy.",required:!1}],options:[z,{flag:"--repo",value:"path",summary:"Repository path for named validation checks."},{flag:"--files",value:"csv",summary:"Optional declared file scope for framework-development validation."},{flag:"--target-repo",value:"path",summary:"Optional cross-repo target repository path for framework-development validation."},{flag:"--spec",value:"path",summary:"Validate a specific atomic spec path."},{flag:"--task",value:"id",summary:"Optional task id to query validator scope taxonomy for touched files."},G,H,W],examples:["node atm.mjs validate --json","node atm.mjs validate --spec tests/schema-fixtures/positive/hello-world.atom.json --json","node atm.mjs validate atom-callsite-readability --repo . --json","node atm.mjs validate framework-development --repo . --json","node atm.mjs validate framework-development --repo . --target-repo ../AI-Atomic-Framework --json","node atm.mjs validate taxonomy --task TASK-MAO-0042 --json"]})});var H5,W5=y(()=>{"use strict";_();ce();H5=q({name:"welcome",summary:"Summarize ATMChart, integration health, and the next ATM action for first-touch onboarding.",positional:[],options:[z,{flag:"--dry-run",summary:"Preview welcome output without writing welcome lineage."},G,H,W],examples:["node atm.mjs welcome --cwd . --json","node atm.mjs welcome --cwd . --dry-run --json"]})});var U5,V5=y(()=>{"use strict";_();ce();U5=q({name:"verify",summary:"Run verification checks for self hashes, neutrality, or AGENTS.md.",options:[z,{flag:"--self",summary:"Verify seed self-verification hashes."},{flag:"--neutrality",summary:"Verify protected-surface neutrality."},{flag:"--agents-md",summary:"Verify AGENTS bootstrap guidance contracts."},G,H,W],examples:["node atm.mjs verify --self --json","node atm.mjs verify --neutrality --json","node atm.mjs verify --agents-md --json"]})});var z5,K5=y(()=>{"use strict";_();ce();z5=q({name:"registry",summary:"Backfill adopter-owned registry lineage from verified evidence.",positional:[{name:"area",summary:"Registry area. Currently: lineage.",required:!0},{name:"action",summary:"Lineage action. Currently: backfill.",required:!0}],options:[z,{flag:"--atom",value:"atom-id",summary:"Adopter-owned atom member to backfill."},{flag:"--from",value:"version",summary:"Source version for registry-diff validation."},{flag:"--to",value:"version",summary:"Target version for registry-diff validation."},{flag:"--map",value:"map-id",summary:"Owning atomic map id."},{flag:"--registry",value:"path",summary:"Registry document path. Defaults to atomic-registry.json."},{flag:"--lineage-log",value:"path",summary:"Map lineage log carrying the member versionLineage evidence."},{flag:"--equivalence",value:"path",summary:"Passing map equivalence report evidence."},{flag:"--propagation",value:"path",summary:"Passing propagation report evidence."},{flag:"--review",value:"path",summary:"Review advisory report evidence."},{flag:"--review-advisory",value:"path",summary:"Alias for --review."},{flag:"--human-review",value:"path",summary:"Approved human review decision evidence."},{flag:"--actor",value:"id",summary:"Actor recorded in closeout evidence."},{flag:"--at",value:"iso-date",summary:"Deterministic timestamp for patch and closeout evidence."},{flag:"--dry-run",summary:"Emit the deterministic patch without mutating host files."},{flag:"--apply",summary:"Apply the lineage backfill after all required evidence validates."},G,H,W],examples:["node atm.mjs registry lineage backfill --atom ATM-NPCBRAIN-0002 --from 0.1.0 --to 0.1.1 --map ATM-MAP-0001 --lineage-log atomic_workbench/maps/ATM-MAP-0001/lineage-log.json --dry-run --json","node atm.mjs registry lineage backfill --atom ATM-NPCBRAIN-0002 --from 0.1.0 --to 0.1.1 --map ATM-MAP-0001 --lineage-log atomic_workbench/maps/ATM-MAP-0001/lineage-log.json --equivalence atomic_workbench/maps/ATM-MAP-0001/map.equivalence.report.json --propagation atomic_workbench/maps/ATM-MAP-0001/propagation.report.json --review atomic_workbench/maps/ATM-MAP-0001/review-advisory.report.json --human-review atomic_workbench/maps/ATM-MAP-0001/human-review.decision.json --apply --json"]})});var J5,Y5=y(()=>{"use strict";_();ce();J5=q({name:"registry-diff",summary:"Generate version hash diff report for a registry atom.",positional:[{name:"atom-id",summary:"Atom id to compare.",required:!0}],options:[{flag:"--from",value:"version",summary:"Source version."},{flag:"--to",value:"version",summary:"Target version."},{flag:"--registry",value:"path",summary:"Optional registry document path."},{flag:"--reason",value:"text",summary:"Optional drift reason annotation."},G,H,W],examples:["node atm.mjs registry-diff ATM-CORE-0001 --from 1.0.0 --to 1.1.0 --json"]})});var Q5,X5=y(()=>{"use strict";_();ce();Q5=q({name:"replacement-lane",summary:"Advance a map through the explicit replacement rollout lane.",positional:[{name:"action",summary:"transition",required:!1}],options:[z,{flag:"--map",value:"id",summary:"Target map id."},{flag:"--to",value:"mode",summary:"Next replacement mode: shadow | canary | active | legacy-retired."},{flag:"--evidence",value:"path",summary:"Evidence path or reference for the transition.",repeatable:!0},{flag:"--reason",value:"text",summary:"Optional reason recorded in the lineage transition log."},{flag:"--actor",value:"name",summary:"Optional actor label for the transition log."},{flag:"--at",value:"timestamp",summary:"Optional timestamp override for the transition log."},G,H,W],examples:["node atm.mjs replacement-lane transition --map ATM-MAP-0001 --to shadow --evidence atomic_workbench/maps/ATM-MAP-0001/map.test.report.json --json","node atm.mjs replacement-lane transition --map ATM-MAP-0001 --to active --evidence atomic_workbench/maps/ATM-MAP-0001/map.equivalence.report.json --evidence .atm/history/reports/review-advisory.json --json"]})});var Z5,e8=y(()=>{"use strict";_();ce();Z5=q({name:"rollback",summary:"Plan or apply rollback for atom/map registry targets.",options:[z,{flag:"--plan",summary:"Prepare rollback proof preview without applying."},{flag:"--apply",summary:"Apply rollback and persist proof artifacts."},{flag:"--target",value:"kind",summary:"Target kind: atom | map."},{flag:"--atom",value:"id",summary:"Target atom id."},{flag:"--map",value:"id",summary:"Target map id."},{flag:"--map-owner",value:"id",summary:"Map owner atom id override."},{flag:"--to",value:"version",summary:"Rollback destination version."},{flag:"--behavior",value:"id",summary:"Behavior id for rollback evidence."},{flag:"--registry",value:"path",summary:"Registry file path."},{flag:"--proof",value:"path",summary:"Success proof output path."},{flag:"--failure-proof",value:"path",summary:"Failure proof output path."},{flag:"--by",value:"name",summary:"Decision author label."},{flag:"--at",value:"timestamp",summary:"Verification timestamp."},G,H,W],examples:["node atm.mjs rollback --plan --atom ATM-CORE-0001 --to 1.0.0 --json","node atm.mjs rollback --apply --atom ATM-CORE-0001 --to 1.0.0 --json"]})});var t8,r8=y(()=>{"use strict";_();ce();t8=q({name:"review",summary:"List, inspect, approve, reject, or materialize apply-ready / rollout-ready packets for upgrade proposals.",positional:[{name:"action",summary:"list | show | approve | reject | apply-ready | rollout-ready",required:!1},{name:"proposal-id",summary:"Proposal id for show/approve/reject/apply-ready/rollout-ready.",required:!1}],options:[z,{flag:"--queue",value:"path",summary:"Human review queue JSON path."},{flag:"--projection",value:"path",summary:"Rendered markdown projection path."},{flag:"--decision-log",value:"path",summary:"Decision log JSON path."},{flag:"--reason",value:"text",summary:"Decision reason for approve/reject."},{flag:"--by",value:"name",summary:"Decision actor label."},{flag:"--at",value:"timestamp",summary:"Decision timestamp override."},G,H,W],examples:["node atm.mjs review list --json",'node atm.mjs review approve <proposal-id> --reason "approved" --json',"node atm.mjs review apply-ready <proposal-id> --json","node atm.mjs review rollout-ready <proposal-id> --json"]})});var o8,a8=y(()=>{"use strict";_();ce();o8=q({name:"agent-pack",summary:"Install, uninstall, diff, or list ATM agent packs.",positional:[{name:"action",summary:"install | uninstall | diff | list",required:!1}],options:[z,{flag:"--pack",value:"pack-id",summary:"Agent pack id for install/uninstall/diff."},{flag:"--dry-run",summary:"Preview install without writing files."},G,H,W],examples:["node atm.mjs agent-pack list --json","node atm.mjs agent-pack install --pack claude-code --dry-run --json","node atm.mjs agent-pack install --pack claude-code --json","node atm.mjs agent-pack diff --pack claude-code --json","node atm.mjs agent-pack uninstall --pack claude-code --json"]})});var n8,s8=y(()=>{"use strict";_();ce();n8=q({name:"review-advisory",summary:"Generate non-blocking semantic advisory findings.",options:[z,{flag:"--mode",value:"mode",summary:"stub | agent-bridge | external-cli"},{flag:"--stub-profile",value:"profile",summary:"pass | warn | unavailable"},{flag:"--out",value:"path",summary:"Advisory report output path."},{flag:"--report-id",value:"id",summary:"Advisory report id override."},{flag:"--target-kind",value:"kind",summary:"atom | map | proposal | diff | scope"},{flag:"--target-id",value:"id",summary:"Target identifier for advisory context."},{flag:"--source-path",value:"path",summary:"Source path to annotate (repeatable)."},{flag:"--provider-response",value:"path",summary:"JSON provider response for agent-bridge mode."},{flag:"--provider-cmd",value:"command",summary:"External provider command for external-cli mode."},{flag:"--machine-findings",value:"path",summary:"Optional machine findings JSON file."},{flag:"--queue",value:"path",summary:"Optional queue path for supplemental context."},{flag:"--proposal-id",value:"id",summary:"Optional proposal id for supplemental context."},G,H,W],examples:["node atm.mjs review-advisory --mode stub --stub-profile pass --json"]})});var i8,c8=y(()=>{"use strict";_();ce();i8=q({name:"taskflow",summary:"Official operator lane for governed task open and close. taskflow open is the normal opener lane; its dry-run returns a writeReadinessHint that names exactly what is missing when --write would fail closed, names the planning card, target repository, and next dry-run/import commands, and warns with ATM_TASK_ID_FAMILY_DRIFT when a new task family duplicates an existing semantic family. taskflow pre-close is the read-only first checkpoint before historical close --write; it reports scopeTrackedDirtyFiles, unexpectedStagedTasks, mixedDeliveryCommit, staleEvidence, autoEvidencePlan, and missingApprovalLease without mutating the worktree. taskflow close expands directory-style deliverables into explicit file manifests before metadata validation and stages optional evidence bundle manifests when present; it enforces validator scope taxonomy for close gates. taskflow close --write acquires an exclusive close-window staged-index lock before staging, blocks competing stage operations, and releases the lock on commit, rollback, or abort while surfacing closeWriteTransaction phase pending, committed, or rolled_back in JSON. taskflow close --auto-evidence runs missing declared validators through evidence run before backend close; explicit evidence --validators remains an override. Use task-view for a single-task read-only dashboard (status, evidence blockers, close completion checklist, next safe command) without replacing next routing. tasks new is a low-level template generator surface (no governed lifecycle). tasks import is the runtime synchronization surface (backend). Direct tasks close, tasks reconcile, tasks repair-closure are protected backend / emergency surfaces and must not be used as normal operator paths.",positional:[{name:"action",summary:"open | close | pre-close | abandon | status",required:!0}],options:[z,{flag:"--dry-run",summary:"Return the orchestration plan without writing. Default when --write is omitted."},{flag:"--write",summary:"Run the governed orchestration entry when prerequisites are satisfied; otherwise fail closed."},{flag:"--detach",summary:"For close --write: return one CLOSE_STARTED line after a durable child acknowledgement. Started is not committed."},{flag:"--status",summary:"For close: read a specific --attempt and print one result line."},{flag:"--wait",summary:"For close: wait for a specific --attempt and print one result line."},{flag:"--attempt",value:"id",summary:"Close attempt ID returned by --detach; required for --status/--wait."},{flag:"--timeout-ms",value:"ms",summary:"Maximum --wait duration in milliseconds (default 30000); a timeout never implies commit."},{flag:"--no-commit",summary:"For taskflow close --write: exact-stage the target and planning repo bundle, but do not commit. Auto-commit is on by default."},{flag:"--profile",value:"path",summary:"Path to the taskflow profile JSON file."},{flag:"--task",value:"id",summary:"Task id for taskflow close orchestration."},{flag:"--actor",value:"id",summary:"Actor id required for taskflow close --write."},{flag:"--task-id",value:"id",summary:"Explicit task id forwarded to the tasks new generation surface during governed open write."},{flag:"--output",value:"path",summary:"Explicit markdown output path forwarded to the tasks new generation surface during governed open write."},{flag:"--template",value:"name",summary:"Template key forwarded to tasks new (default: aao-l2-split)."},{flag:"--goal",value:"text",summary:"One-paragraph goal written into a built-in opener task card."},{flag:"--scope-path",value:"csv",summary:"Files the task may change (built-in opener; required for --write)."},{flag:"--validator",value:"csv",summary:"Commands that prove the task (built-in opener; required for --write)."},{flag:"--title",value:"text",summary:"Optional title forwarded to tasks new."},{flag:"--roster-index",value:"path",summary:"Optional roster README path override for roster sync policy."},{flag:"--historical-delivery",value:"commit",summary:"For taskflow close: verify an earlier delivery commit through tasks close or reconcile.",repeatable:!0},{flag:"--delivery-commit",value:"commit",summary:"Alias for --historical-delivery on taskflow close."},{flag:"--historical-batch",value:"batchId-or-path",summary:"For taskflow close: consume a task slice produced by evidence historical-batch, reuse its matched delivery commits, and treat the slice as the operator close-readiness source."},{flag:"--waiver-out-of-scope-delivery",summary:"For taskflow close with historical delivery or historical batch: allow a multi-task delivery commit when this task slice has matched deliverables; requires --reason."},{flag:"--waive-out-of-scope",summary:"Alias for --waiver-out-of-scope-delivery."},{flag:"--defer-foreign-staged",summary:"For taskflow close --write: snapshot and unstage foreign task governance files in the index before acquiring the close-window staged-index lock."},{flag:"--defer-governance-dirty",summary:"For taskflow close --write: snapshot, temporarily restore, and then reapply deferrable governance dirty files such as git-head evidence."},{flag:"--defer-foreign-state",summary:"Alias for --defer-foreign-staged plus --defer-governance-dirty."},{flag:"--auto-evidence",summary:"For taskflow close --write: auto-run missing task-card declared validators through evidence run before backend close. Dry-run and pre-close always expose autoEvidencePlan when --actor is supplied; --validators on evidence run remains an override for extra evidence."},{flag:"--emergency-approval",value:"leaseId",summary:"For taskflow close: forward a human-approved protected backend lease when the orchestrator must perform stale-runner recovery."},{flag:"--reason",value:"text",summary:"Required explanation for --waiver-out-of-scope-delivery; recorded in the recovery receipt for --recover/--abort."},{flag:"--recover",summary:"For taskflow close: recover an interrupted close whose holder is gone. Marks a landed close completed, or rolls a consistent staged close forward through the governed commit, then releases the close-window lock. Dry-run unless --write."},{flag:"--abort",summary:"For taskflow close: abort an interrupted close whose holder is gone. Unstages and archives the close artifacts, restores the ledger and planning card, and releases the close-window lock with a recovery receipt. Refused once the close landed. Dry-run unless --write."},{flag:"--stale-after-ms",value:"ms",summary:"For taskflow close --recover/--abort: how old a close-window lock without a live holder lease must be before it is treated as stale (default 120000)."},G,H,W],examples:['node atm.mjs taskflow abandon --task TASK-ADOPTER-0002 --actor codex-main --reason "User dropped the request" --write --json',"node atm.mjs taskflow open --dry-run --json","node atm.mjs taskflow open --dry-run --profile planning/taskflow.profile.json --json","node atm.mjs taskflow open --write --profile planning/taskflow.profile.json --task-id TASK-ADOPTER-0002 --output tasks/TASK-ADOPTER-0002.task.md --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --dry-run --json","node atm.mjs taskflow pre-close --task TASK-ADOPTER-0001 --actor codex-main --historical-delivery abc123 --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --historical-delivery abc123 --write --json",'node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --historical-batch hist-batch-2026-06-16T10-00-00-000Z --waiver-out-of-scope-delivery --reason "multi-task historical delivery" --write --json',"node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --historical-batch hist-batch-2026-06-16T10-00-00-000Z --dry-run --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --historical-batch hist-batch-2026-06-16T10-00-00-000Z --write --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --defer-foreign-staged --write --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --defer-foreign-state --write --json","node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --recover --json",'node atm.mjs taskflow close --task TASK-ADOPTER-0001 --actor codex-main --abort --reason "close process died mid-transaction" --write --json',"node atm.mjs taskflow status --task TASK-ADOPTER-0001 --json"],help:{audience:"agent",requiredFlagSets:[{when:"Pre-close or close one task",flags:["--task"]},{when:"taskflow close --write",flags:["--task","--actor","--write"]},{when:"Waiving mixed historical delivery",flags:["--waiver-out-of-scope-delivery","--reason"]}],relatedCommands:["node atm.mjs task-view --task TASK-ABC-0001 --json",'node atm.mjs evidence run --task TASK-ABC-0001 --actor <actor-id> --command "<validator>" --json',"node atm.mjs next --claim --task TASK-ABC-0001 --actor <actor-id> --auto-intent --json"],commonMistakes:["Jumping straight to --write without reading pre-close or dry-run readiness first.","Minting a new task id family before scanning existing task-card families; taskflow open reports ATM_TASK_ID_FAMILY_DRIFT when the semantic family already exists.","Staging competing governance files while taskflow close --write owns the close-window staged-index lock.","Using direct tasks close/reconcile as a shortcut for the normal operator lane."],playbookNotes:["Use taskflow pre-close as the first read-only checkpoint before historical close --write.","When validators are missing, taskflow close --auto-evidence can run the declared validators through evidence run before backend close.","Use task-view when you need a single-task close checklist without mutating runtime state."],maintainerNotes:["Directory-style deliverables expand into explicit file manifests during closeback validation, so scope drift is visible before commit."]}})});var ZD,eF=y(()=>{"use strict";_();ce();ZD=q({name:"task-view",summary:"Read-only task dashboard that unifies status triangulation, evidence blockers, close completion checklist, and the next safe operator command. task-view does not claim, repair, close, or route work; use next for deterministic routing and taskflow for governed open/close.",options:[z,{flag:"--task",value:"id",summary:"Task id to inspect."},{flag:"--actor",value:"id",summary:"Optional actor id for evidence freshness checks and pre-close command hints."},G,H,W],examples:["node atm.mjs task-view --task TASK-MAO-0044 --json","node atm.mjs task-view --task TASK-MAO-0044 --actor cursor-gpt-5.2 --pretty"]})});var l8,d8=y(()=>{"use strict";_();ce();l8=q({name:"broker",summary:"Manage write intents, proposal capsules, compose merge plans, runtime activation, steward apply, parallel admission policy, and inspect the local write-broker registry.",positional:[{name:"action",summary:"register | decision | status | release | cleanup | proposal | compose | steward | runtime | runner-sync | projection | plan-batch | schedule | batch | parallel-admission | replay | heat-status | heat-reset | post-compose-semantic-validation | claim",required:!0},{name:"proposal-action",summary:"create | list | show | validate",required:!1},{name:"steward-action",summary:"plan | apply | apply-live",required:!1},{name:"runtime-action",summary:"activate",required:!1},{name:"parallel-admission-action",summary:"status | set | trip | reset",required:!1},{name:"replay-action",summary:"status | run | dogfood",required:!1},{name:"claim-action",summary:"init | release | status (omit to claim --files)",required:!1},{name:"proposal-id",summary:"Proposal id for show / validate.",required:!1}],options:[z,{flag:"--task",value:"id",summary:"Task ID to register or release."},{flag:"--actor",value:"id",summary:"Actor id for register payload parity checks or runtime activate."},{flag:"--intent-file",value:"path",summary:"Path to WriteIntent JSON payload."},{flag:"--queue-ticket",value:"id",summary:"Explicitly revalidate an eligible native serial ticket using the unchanged scope and current repository HEAD."},{flag:"--ttl-seconds",value:"number",summary:"TTL lease duration in seconds for registering write intent (broker claim defaults to 900)."},{flag:"--files",value:"a,b",summary:"Comma-separated files for broker claim / broker claim release. Repeatable."},{flag:"--sealed-source-sha",value:"sha",summary:"Sealed source SHA for broker runner-sync enqueue."},{flag:"--surface",value:"path",summary:"Release surface path for broker runner-sync enqueue, or file path for broker heat-reset. Repeatable."},{flag:"--steward-work-id",value:"id",summary:"Runner-sync steward work id to release after one coalesced build."},{flag:"--receipt-ref",value:"path",summary:"Runner-sync build/publication receipt path used when releasing a steward entry or reconciling one verified stale receipt."},{flag:"--receipt-digest",value:"sha256",summary:"Runner-sync build/publication receipt digest used when releasing a steward entry."},{flag:"--projection-key",value:"key",summary:"Generated projection key for broker projection enqueue."},{flag:"--wave",value:"id",summary:"Wave id for broker schedule enqueue or plan."},{flag:"--surface-kind",value:"kind",summary:"Broker schedule surface kind: commit, build, runner-sync, projection, or checkpoint."},{flag:"--surface-family",value:"family",summary:"Broker schedule compatible surface family."},{flag:"--payload-digest",value:"digest",summary:"Broker schedule payload digest used in idempotency keys, or source digest for build/projection batch execution."},{flag:"--manifest-digest",value:"digest",summary:"Wave manifest digest for broker batch write receipts."},{flag:"--current-head",value:"sha",summary:"Current HEAD SHA observed by broker batch execute."},{flag:"--expected-head",value:"sha",summary:"Expected HEAD SHA for stale-head rejection in broker batch execute."},{flag:"--expected-task",value:"id",summary:"Expected task id for broker schedule plan. Repeatable."},{flag:"--claimed-task",value:"id",summary:"Task id with claim evidence for broker batch execute. Repeatable."},{flag:"--validator-task",value:"id",summary:"Task id with validator evidence for broker batch execute. Repeatable."},{flag:"--file-slice",value:"task:path",summary:"Task-owned file slice for shared delivery commit receipts. Repeatable."},{flag:"--command-manifest",value:"path",summary:"atm.commandManifest.v1 JSON used for shellless generated build/projection execution."},{flag:"--collection-timeout-ms",value:"ms",summary:"Broker schedule collection timeout before reseal or serial fallback."},{flag:"--source-item",value:"path",summary:"Source item shard for broker projection enqueue. Repeatable."},{flag:"--candidate-file",value:"path",summary:"Exact composed candidate JSON for post-compose semantic validation."},{flag:"--proposal-file",value:"path",summary:"Path to PatchProposal JSON payload. Repeatable for compose / steward."},{flag:"--proposal-id",value:"id",summary:"Proposal id for compose / steward or proposal show / validate."},{flag:"--persist-merge-plan",summary:"Persist a broker-computed compose plan to its canonical runtime path; compose is read-only unless this flag is present."},{flag:"--merge-plan-file",value:"path",summary:"Path to MergePlan JSON payload for steward plan / apply."},{flag:"--scope-file",value:"path",summary:"Scoped file-write target allowed for steward apply or runtime activate. Repeatable."},{flag:"--ack-overlap",value:"proposalId",summary:"steward apply-live: explicitly override another session's committed lines named by a cross-session-overlap rejection. Repeatable or comma-separated."},{flag:"--steward-id",value:"id",summary:"Neutral write steward identifier."},{flag:"--evidence-out",value:"path",summary:"Output path for steward apply or runtime activation evidence JSON."},{flag:"--run-evidence-dir",value:"path",summary:"Directory to write broker batch run records (default: .atm/runtime/broker-collision-evidence/runs, resolved against --cwd)."},{flag:"--mode",value:"mode",summary:"Parallel admission policy mode: enforce or observe."},{flag:"--fallback-mode",value:"mode",summary:"Parallel admission fallback mode: queue-only or fail-closed."},{flag:"--circuit-breaker",value:"boolean",summary:"Enable or disable the parallel admission circuit breaker."},{flag:"--reason",value:"text",summary:"Reason for broker parallel-admission trip."},{flag:"--store",value:"path",summary:"Path to broker proposal store JSON."},G,H,W],examples:["node atm.mjs broker register --task TASK-GOV-0100 --actor worker-1 --intent-file intent.json --json","node atm.mjs broker decision --intent-file intent.json --json","node atm.mjs broker status --json","node atm.mjs broker release --task TASK-GOV-0100 --json","node atm.mjs broker cleanup --json","node atm.mjs broker runner-sync enqueue --task TASK-GOV-0100 --actor worker-1 --sealed-source-sha <sha> --surface release/atm-onefile/atm.mjs --json","node atm.mjs broker runner-sync supersede --task TASK-GOV-0100 --actor worker-1 --sealed-source-sha <sha> --surface release/atm-onefile/atm.mjs --json","node atm.mjs broker runner-sync release --task TASK-GOV-0100 --steward-work-id runner-sync-1234abcd --receipt-ref .atm/history/evidence/TASK-GOV-0100.runner-sync-receipt.json --json","node atm.mjs broker runner-sync reconcile-receipt --task TASK-GOV-0100 --actor worker-1 --receipt-ref .atm/history/evidence/TASK-GOV-0099.runner-sync-receipt.json --json","node atm.mjs broker runner-sync takeover-publication --task TASK-GOV-0100 --actor worker-1 --sealed-source-sha <sha> --surface full --json","node atm.mjs broker projection enqueue --task TASK-GOV-0100 --actor worker-1 --projection-key atm.generated-projection.governance-backlog --source-item docs/governance/atm-bug-and-optimization-backlog.items/ATM-BUG-YYYY-MM-DD-NNN.json --json","node atm.mjs broker schedule enqueue --task TASK-GOV-0100 --wave wave-123 --surface-kind commit --surface-family cli --payload-digest sha256:abc --json","node atm.mjs broker schedule plan --wave wave-123 --surface-kind commit --surface-family cli --expected-task TASK-GOV-0100 --expected-task TASK-GOV-0101 --json","node atm.mjs broker batch execute --surface commit --wave wave-123 --surface-family cli --manifest-digest sha256:abc --sealed-source-sha <sha> --claimed-task TASK-GOV-0100 --validator-task TASK-GOV-0100 --scope-file src/a.ts --evidence-out .atm/history/evidence/wave-123.shared-write.json --json","node atm.mjs broker batch execute --surface build --wave wave-123 --surface-family cli --manifest-digest sha256:abc --sealed-source-sha <sha> --payload-digest sha256:source --command-manifest command-manifest.json --output-file dist/out.json --evidence-out .atm/history/evidence/wave-123.build.json --json","node atm.mjs broker proposal create --proposal-file proposal.json --json","node atm.mjs broker proposal list --json","node atm.mjs broker proposal show proposal-123 --json","node atm.mjs broker proposal validate proposal-123 --json","node atm.mjs broker compose --proposal-file proposal-a.json --proposal-file proposal-b.json --json","node atm.mjs broker compose --store .atm/runtime/broker-proposals.json --proposal-id proposal-a --proposal-id proposal-b --json","node atm.mjs broker compose --store .atm/runtime/broker-proposals.json --proposal-id proposal-a --proposal-id proposal-b --persist-merge-plan --json","node atm.mjs broker runtime activate --task TASK-GOV-0100 --actor team-planner --scope-file src/target.ts --json","node atm.mjs broker runtime activate --task TASK-GOV-0100 --actor team-planner --merge-plan-file merge-plan.json --proposal-file proposal.json --scope-file src/target.ts --evidence-out runtime-evidence.json --json","node atm.mjs broker steward plan --merge-plan-file merge-plan.json --proposal-file proposal.json --scope-file src/target.ts --json","node atm.mjs broker steward apply --merge-plan-file merge-plan.json --proposal-file proposal.json --scope-file src/target.ts --evidence-out steward-evidence.json --json","node atm.mjs broker steward apply-live --proposal-file proposal.json --scope-file src/target.ts --json","node atm.mjs broker plan-batch --request-file tmp/request-a.json --request-file tmp/request-b.json --apply --run-evidence-dir .atm/runtime/broker-collision-evidence/runs --json","node atm.mjs broker parallel-admission status --json","node atm.mjs broker parallel-admission set --mode enforce --fallback-mode queue-only --json",'node atm.mjs broker parallel-admission trip --actor worker-1 --reason "shared-write gate failed" --json',"node atm.mjs broker parallel-admission reset --actor worker-1 --receipt-digest sha256:<digest> --json","node atm.mjs broker replay status --json","node atm.mjs broker replay run --json","node atm.mjs broker replay dogfood --surface docs/governance/atm-3-replay-evidence.md --json","node atm.mjs broker claim init --json","node atm.mjs broker claim --files src/a.ts,src/b.ts --actor worker-1 --json","node atm.mjs broker claim status --json","node atm.mjs broker claim release --actor worker-1 --json","node atm.mjs broker heat-status --json","node atm.mjs broker heat-reset --actor worker-1 --surface packages/core/src/broker/team-lane.ts --json"]})});var m8,u8=y(()=>{"use strict";_();ce();m8=q({name:"route",summary:"Manage MAO route lifecycle records and legacy steward takeover. route pause exercises the broker freeze protocol and records a metadata-only patch envelope handoff sidecar; route handoff validates or compares envelopes without worktree apply. Worktree patch apply remains out of scope.",positional:[{name:"action",summary:"open | status | list | pause | resume | abandon | handoff | takeover",required:!0}],options:[z,{flag:"--route",value:"id",summary:"Route context id for status, pause, resume, abandon, or handoff."},{flag:"--route-id",value:"id",summary:"Explicit route context id when opening a route."},{flag:"--task",value:"id",summary:"Task id for route open."},{flag:"--actor",value:"id",summary:"Actor id for route open or lifecycle transition."},{flag:"--claim-intent",value:"intent",summary:"Route claim intent: read, write, review, steward, or release-sync."},{flag:"--read-set",value:"csv",summary:"Comma-separated declared read files."},{flag:"--write-set",value:"csv",summary:"Comma-separated declared write files."},{flag:"--atom-cids",value:"csv",summary:"Comma-separated target atom CIDs."},{flag:"--virtual-atom-cids",value:"csv",summary:"Comma-separated target virtual atom CIDs."},{flag:"--patch-envelope-ref",value:"ref",summary:"Optional patch envelope file for route handoff compare."},{flag:"--reason",value:"text",summary:"Reason for pause, resume, abandon, or handoff."},{flag:"--admission-rechecked",summary:"For route resume: confirm broker admission was re-checked before continuing after a freeze."},{flag:"--ttl-seconds",value:"seconds",summary:"Route lease TTL in seconds."},{flag:"--max-seconds",value:"seconds",summary:"Route lease maximum lifetime in seconds."},{flag:"--merge-plan-file",value:"path",summary:"Path to merge plan file."},{flag:"--proposal-file",value:"path",summary:"Path to patch proposal file."},{flag:"--steward-id",value:"name",summary:"Steward identity name."},{flag:"--evidence-out-path",value:"path",summary:"Path to save apply evidence."},{flag:"--scope-files",value:"csv",summary:"Comma-separated scoped files."},G,H,W],examples:["node atm.mjs route open --task TASK-MAO-0003 --actor captain --write-set packages/cli/src/commands/route.ts","node atm.mjs route status --route route-TASK-MAO-0003-captain","node atm.mjs route pause --route route-TASK-MAO-0003-captain --actor captain --reason review","node atm.mjs route handoff --route route-TASK-MAO-0003-captain --actor captain --patch-envelope-ref .atm/runtime/routes/route-TASK-MAO-0003-captain.patch-envelope.json","node atm.mjs route resume --route route-TASK-MAO-0003-captain --actor captain --admission-rechecked","node atm.mjs route abandon --route route-TASK-MAO-0003-captain --actor captain --reason superseded","node atm.mjs route takeover --merge-plan-file plan.json --proposal-file prop.json"]})});var f8,p8=y(()=>{"use strict";_();ce();f8=q({name:"write-ticket",summary:"Acquire and check task-scoped write tickets before editor writes, record post-write touched paths, and classify scope amendment, unattached WIP, stale ticket, missing ticket, and true violation outcomes.",positional:[{name:"action",summary:"acquire | check | record-touch | status",required:!0}],options:[z,{flag:"--task",value:"id",summary:"Task id that owns the requested write authority."},{flag:"--actor",value:"id",summary:"Actor id requesting or checking the write ticket."},{flag:"--files",value:"csv",summary:"Comma-separated files being acquired, checked, or recorded as touched."},{flag:"--file",value:"path",summary:"Single file alias for --files."},{flag:"--intent",value:"text",summary:"Ticket intent such as write, stage, commit, close, or push."},{flag:"--operation",value:"kind",summary:"Operation boundary: write | stage | commit | close | push."},{flag:"--observed",value:"phase",summary:"Observation phase: pre-write | post-write | commit | close | push."},{flag:"--ticket",value:"path",summary:"Path to an existing write-ticket JSON document for check/status."},{flag:"--ticket-file",value:"path",summary:"Alias for --ticket."},{flag:"--lane-session",value:"id",summary:"Lane session id to compare against ticket and claim authority."},{flag:"--lane-session-id",value:"id",summary:"Alias for --lane-session."},{flag:"--ttl-seconds",value:"seconds",summary:"Ticket TTL for acquire; defaults to 3600 seconds."},{flag:"--recovery-bypassed",summary:"Escalate unresolved out-of-scope evidence to true violation at delivery boundary."},G,H,W],examples:["node atm.mjs write-ticket acquire --task TASK-0001 --actor codex --files src/a.ts --intent write --json","node atm.mjs write-ticket check --task TASK-0001 --actor codex --ticket .atm/runtime/write-ticket.json --files src/a.ts --json","node atm.mjs write-ticket record-touch --task TASK-0001 --actor codex --ticket .atm/runtime/write-ticket.json --files src/b.ts --observed post-write --json","node atm.mjs write-ticket status --task TASK-0001 --actor codex --ticket .atm/runtime/write-ticket.json --files src/a.ts --json"]})});function jk(e,t="public"){return Object.freeze({...e,visibility:t})}function Nt(e){return e in tF?tF[e]:null}function rF(e={}){return Object.values(tF).filter(t=>e.includeInternal||t.visibility!=="internal")}var tF,aa=y(()=>{"use strict";UJ();zJ();JJ();QJ();ZJ();t6();o6();n6();i6();l6();m6();f6();h6();k6();I6();w6();A6();T6();R6();E6();P6();O6();F6();$6();N6();q6();H6();U6();z6();J6();Q6();Z6();t5();o5();n5();i5();l5();m5();f5();h5();k5();I5();w5();A5();T5();R5();E5();P5();XD();D5();j5();L5();B5();G5();W5();V5();K5();Y5();X5();e8();r8();a8();s8();c8();eF();d8();u8();p8();tF=Object.freeze({setup:a6,actor:WJ,"agent-pack":o8,"atom-capsule":jk(KJ,"internal"),"atom-ref":VJ,atomize:YJ,"atm-chart":g6,baseline:XJ,batch:e6,bootstrap:r6,budget:s6,cache:c6,cleanup:d6,candidates:u6,create:p6,"create-map":y6,daemon:jk(v6,"internal"),doctor:S6,emergency:b6,experience:C6,explain:K6,evidence:Y6,"framework-mode":X6,git:r5,"git-hooks":a5,guide:s5,guard:e5,handoff:c5,"health-report":jk(x6,"internal"),hook:d5,identity:_6,init:u5,"internal-release":p5,integration:g5,lane:y5,lock:v5,"map-capsule":jk(j6,"internal"),migrate:S5,next:b5,orient:M6,plan:D6,police:L6,quickfix:B6,residue:G6,rescue:jk(W6,"internal"),registry:z5,"registry-diff":J5,"replacement-lane":Q5,review:t8,"review-advisory":n8,rollback:Z5,"self-host-alpha":C5,spec:x5,start:V6,status:_5,tasks:QD,test:F5,telemetry:$5,team:N5,upgrade:O5,validate:q5,welcome:H5,verify:U5,taskflow:i8,"task-view":ZD,broker:l8,route:m8,"write-ticket":f8})});import{createHash as fMe}from"node:crypto";import{readFileSync as pMe}from"node:fs";import oF from"node:path";function Wr(e){return`sha256:${fMe("sha256").update(e).digest("hex")}`}function jd(e){return Wr(pMe(e))}function $k(e){return`${JSON.stringify(e,null,2)}
10
10
  `}function zt(e){let t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+/g,"/");if(!t||t.startsWith("/")||t.includes(":")||t===".."||t.startsWith("../")||t.includes("/../"))throw new Error(`unsafe manifest path: ${e}`);return t}function yi(e,t){let r=oF.resolve(e),o=oF.resolve(r,zt(t)),a=r.toLowerCase(),n=o.toLowerCase();if(n!==a&&!n.startsWith(`${a}${oF.sep}`))throw new Error(`manifest path escapes repository root: ${t}`);return o}var Ii=y(()=>{"use strict"});import{existsSync as g8,lstatSync as hMe,readFileSync as k8}from"node:fs";import Ab from"node:path";function $d(e){let t=Ab.resolve(e),r=Ab.parse(t).root,o=r;for(let a of t.slice(r.length).split(Ab.sep).filter(Boolean)){o=Ab.join(o,a);try{if(hMe(o).isSymbolicLink())throw new Error(`ATM_SETUP_UNSAFE_PATH: symbolic link: ${o}`)}catch(n){if(n.code!=="ENOENT")throw n}}}function Yr(e,t){let r=yi(e,zt(t));return $d(r),r}function wf(e){let t=e.metadata?.managedBlocks;if(t===void 0)return{};if(typeof t!="string")throw new Error("ATM_INTEGRATION_INVALID_OWNERSHIP: invalid managedBlocks");let r=JSON.parse(t);if(!r||typeof r!="object"||Array.isArray(r))throw new Error("ATM_INTEGRATION_INVALID_OWNERSHIP: invalid managedBlocks");for(let[o,a]of Object.entries(r)){if(zt(o)!==o||!e.files.some(n=>n.path===o))throw new Error("ATM_INTEGRATION_INVALID_OWNERSHIP: unknown or noncanonical managed file");if(a!==e.adapterId)throw new Error("ATM_INTEGRATION_INVALID_OWNERSHIP: adapter mismatch")}return r}function uo(e){let t=e.toString("utf8");if(!Buffer.from(t).equals(e))throw new Error("ATM_INTEGRATION_ENCODING_CONFLICT: preserving non-UTF-8 user bytes");return t}function Lk(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("ATM_INTEGRATION_INVALID_OWNERSHIP: invalid manifest");let t=e;if(t.schemaId!=="atm.integrationInstallManifest"||!/^[a-z0-9-]+$/.test(t.adapterId??"")||!Array.isArray(t.files))throw new Error("ATM_INTEGRATION_INVALID_OWNERSHIP: invalid manifest header");let r=new Set;for(let o of t.files){if(!o||typeof o.path!="string"||zt(o.path)!==o.path||r.has(o.path)||!/^sha256:[a-f0-9]{64}$/.test(o.sha256??"")||!Number.isSafeInteger(o.sizeBytes)||o.sizeBytes<0)throw new Error("ATM_INTEGRATION_INVALID_OWNERSHIP: invalid file record");r.add(o.path)}wf(t)}function y8(e){if(!/^[a-z0-9-]+$/.test(e))throw new Error("ATM_INTEGRATION_INVALID_OWNERSHIP: invalid adapter id");return{start:`
11
11
  <!-- ATM:${e}:BEGIN -->
12
12
  `,end:`<!-- ATM:${e}:END -->
@@ -53,7 +53,7 @@ ${o}`).digest("hex").slice(0,10);return`session-${a}-${iQ(t)}-${iQ(r)}-${n}`}fun
53
53
  `,r=`${e.createdAt}
54
54
  ${e.taskId}
55
55
  ${e.action}
56
- ${t}`;return`${e.createdAt.replace(/[:.]/g,"-")}-${e.action}-${o3("sha256").update(r).digest("hex").slice(0,12)}`}function CT(e,t,r){let o=Zd.resolve(e),a=Ct(o);return a3(Zd.join(o,a.eventRoot,i3(t),`${r}.json`))}function Oj(e,t){return`${e.trim().toLowerCase()}::${t.trim().toLowerCase()}`}function s3(e,t){let r=e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"-").replace(/^-|-$/g,"")||"EXT",o=t.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"-").replace(/^-|-$/g,"")||"TASK";return`MIRROR-${r}-${o}`}function uje(e){let t=String(e??"auto").trim().toLowerCase().replace(/_/g,"-");return t==="adopter-governed"||t==="framework-development"||t==="external-provider"?t:"auto"}function fje(e){return Array.isArray(e)?e.flatMap(t=>{if(!Mj(t))return[];let r=qf(t.provider),o=qf(t.taskId??t.originTaskId);return!r||!o?[]:[{provider:r,taskId:o,url:qf(t.url??t.originUrl)}]}):[]}function pje(e){if(!a3(e))return null;try{return JSON.parse(dje(e,"utf8"))}catch{return null}}function Mj(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function qf(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}function i3(e){return e.trim().replace(/[^A-Za-z0-9._-]+/g,"-")}function hje(e){return`sha256:${o3("sha256").update(e).digest("hex")}`}var Ay,ca=y(()=>{"use strict";_();Ay={enabled:!0,configuredMode:"auto",provider:"atm-local",mirrorExternalTasks:!0,requireCliTransitions:!0}});function Ije(e){return typeof e!="string"?typeof e:e.length<=32?e:`${e.slice(0,16)}...${e.slice(-8)} (len=${e.length})`}function Dj(e,t,r){if(typeof r!="string"||r.trim().length===0){e.missing.push(t);return}(!gje.test(r)||!kje.test(r))&&e.invalidFormat.push({path:t,kind:"invalidFormat",formatExpected:yje,actualValue:Ije(r)})}var gje,kje,yje,c3=y(()=>{"use strict";gje=/^sha256:([a-fA-F0-9]{64})$/,kje=/^sha256:[a-f0-9]{64}$/,yje="^sha256:[a-f0-9]{64}$"});import{createHash as vje}from"node:crypto";import{spawnSync as _i}from"node:child_process";import{appendFileSync as wje,existsSync as wt,mkdirSync as Cy,mkdtempSync as y3,readFileSync as la,readdirSync as Hf,rmSync as I3,statSync as Lj,unlinkSync as Ty,writeFileSync as Ts}from"node:fs";import v3 from"node:os";import Q from"node:path";function Cs(e,t){let r=be(e),o=t.trim();return!r||!o?!1:r===hr||r===`.atm/history/tasks/${o}.json`||r===`.atm/history/evidence/${o}.json`||r===`.atm/history/evidence/${o}.closure-packet.json`||r.startsWith(`.atm/history/task-events/${o}/`)||r===`.atm/runtime/locks/${o}.lock.json`}function Nj(e,t,r){let o=e?.trim().toUpperCase()??null,a=qt(t.map(be).filter(Boolean)).map(n=>Sje(o,n,r??null)).filter(n=>n!==null);return{autoCleanSafe:a.filter(n=>n.verdict==="auto-clean-safe"),blockAndExplain:a.filter(n=>n.verdict==="block-and-explain"),manualReview:a.filter(n=>n.verdict==="manual-review")}}function Sje(e,t,r){let o=be(t),a=o.toLowerCase(),n=e?.trim().toUpperCase()??null,s=xF(r,o);if(s)return{path:o,verdict:"block-and-explain",reason:"Verified bootstrap history must be preserved outside unrelated task commits.",ownerTaskId:s,cleanupAction:null};if(a.startsWith(".atm/history/reports/task-import/")&&a.endsWith(".json"))return{path:o,verdict:"auto-clean-safe",reason:"task-import report is an ATM-generated transient report and may be removed automatically after the import/claim lane completes.",ownerTaskId:n,cleanupAction:"remove"};if(a.startsWith(".atm/history/protected-override-audit/")&&a.endsWith(".json"))return null;let i=bje(o);if(i)return n&&i.ownerTaskId===n?null:Aje(r,i.ownerTaskId)==="abandoned"?i.artifactKind==="bundle-manifest"?{path:o,verdict:"auto-clean-safe",reason:`Abandoned task ${i.ownerTaskId} left disposable generated residue (${i.artifactKind}); remove it so later taskflow/commit lanes stay admissible without erasing the abandon audit trail.`,ownerTaskId:i.ownerTaskId,cleanupAction:"remove"}:null:{path:o,verdict:"block-and-explain",reason:n?`${i.artifactKind} belongs to another task (${i.ownerTaskId}) and must be reconciled explicitly instead of silently skipped.`:`${i.artifactKind} is an ATM-managed governance artifact (${i.ownerTaskId}) but no active task ownership is available to prove it is safe residue.`,ownerTaskId:i.ownerTaskId,cleanupAction:null};if(a===Ae.legacyJson||a===Ae.jsonl)return{path:o,verdict:"auto-clean-safe",reason:"hook-generated git-head evidence residue is reproducible and may be restored automatically.",ownerTaskId:e,cleanupAction:"restore"};let c=a.match(/^\.atm\/runtime\/snapshots\/(?:(close-window-)?foreign-staged)-([a-z0-9-]+)-\d+\.json$/);if(c){let m=c[2]?.toUpperCase()??null;return{path:o,verdict:"auto-clean-safe",reason:m==="GIT-HEAD"||n&&m===n?"current-operation foreign-staged snapshot is an ATM byproduct and may be removed automatically after the lane completes.":`foreign-staged snapshot belongs to another task/run (${m}) but is a disposable ATM byproduct and may be removed automatically before commit.`,ownerTaskId:m,cleanupAction:"remove"}}let l=a.match(/^\.atm\/runtime\/snapshots\/close-window-governance-dirty-[^.]+-\.atm__history__evidence__([a-z0-9-]+)(?:\.[^.]+)?\.json\.json$/);if(l){let m=l[1]?.toUpperCase()??null;return{path:o,verdict:"auto-clean-safe",reason:m==="GIT-HEAD"||n&&m===n?"close-window governance-dirty snapshot belongs to the current operation and may be removed automatically after the lane completes.":`close-window governance-dirty snapshot belongs to another task/run (${m}) but is a disposable ATM byproduct and may be removed automatically before commit.`,ownerTaskId:m,cleanupAction:"remove"}}if(a.match(/^\.atm\/runtime\/snapshots\/close-window-governance-dirty-[^.]+-\.atm__history__evidence__git-head\.jsonl\.json$/))return{path:o,verdict:"auto-clean-safe",reason:"close-window governance-dirty snapshot for git-head evidence is hook-generated and may be removed automatically after the lane completes.",ownerTaskId:"GIT-HEAD",cleanupAction:"remove"};let d=a.match(/^\.atm\/history\/reports\/lock-cleanup\/[^/]+-([a-z0-9-]+)\.json$/);if(d){let m=d[1]?.toUpperCase()??null;return{path:o,verdict:"auto-clean-safe",reason:m===n?"lock-cleanup report belongs to the current task checkpoint and may be removed automatically after commit.":`lock-cleanup report belongs to another task/run (${m}) but is a disposable ATM byproduct and may be removed automatically before commit.`,ownerTaskId:m,cleanupAction:"remove"}}return a.startsWith(".atm/runtime/snapshots/")&&a.endsWith(".json")?{path:o,verdict:"manual-review",reason:"snapshot looks generated but ATM cannot prove it belongs to the current operation.",ownerTaskId:null,cleanupAction:null}:{path:o,verdict:"manual-review",reason:"path is not recognized as a known ATM auto-generated residue shape.",ownerTaskId:null,cleanupAction:null}}function Aje(e,t){if(!e||!t)return null;let r=Q.join(e,".atm","history","tasks",`${t}.json`);if(!wt(r))return null;try{let o=JSON.parse(la(r,"utf8"));return typeof o.status=="string"?o.status.trim().toLowerCase():null}catch{return null}}function bje(e){let t=be(e),r=t.match(/^\.atm\/history\/evidence\/([^/.]+)\.bundle-manifest\.json$/i);if(r)return{ownerTaskId:r[1].toUpperCase(),artifactKind:"bundle-manifest"};let o=t.match(/^\.atm\/history\/evidence\/([^/.]+)\.closure-packet\.json$/i);if(o)return{ownerTaskId:o[1].toUpperCase(),artifactKind:"closure-packet"};let a=t.match(/^\.atm\/history\/task-events\/([^/]+)\/.+(?:close|reconcile|repair-closure).+\.json$/i);return a?{ownerTaskId:a[1].toUpperCase(),artifactKind:"close-task-event"}:null}function Tje(e){let t=e.trim(),r=w3.exec(t);return r?`sha256:${r[1].toLowerCase()}`:t}function rm(e){if(Array.isArray(e))return e.map(t=>rm(t));if(e&&typeof e=="object"){let t={};for(let[r,o]of Object.entries(e))t[r]=rm(o);return t}return typeof e=="string"&&w3.test(e.trim())?Tje(e):e}function Wf(e=[],t=null,r=null,o=null){let a=qt(e.map(be).filter(Boolean)),n=a.length>0?a.join(","):"<files>",s=t?.trim()||"temporary framework maintenance",i=r?.trim()||"<id>",c=ie(o),l=c?` --lane-session ${em(c)}`:"";return`node atm.mjs framework-mode claim --actor ${i==="<id>"?i:em(i)}${l} --files ${em(n)} --reason ${em(s)} --json`}function Bj(e,t,r={}){let o=Q.resolve(e),a=y0e(r.laneSessionId),n=k0e(t,a),s=Q.join(o,".atm","runtime","locks",`${n}.lock.json`),i=eo(s);if(!i||i.released===!0)return null;let c=ie(i.lockedAt??null),l=ie(i.linkedTaskId??null),d=(()=>{try{return s0e(o,t,r.currentTaskId??null,a)}catch(I){if(I instanceof h&&I.code==="ATM_FRAMEWORK_TEMP_CLAIM_TASK_BINDING_AMBIGUOUS"&&!ie(r.currentTaskId))return null;throw I}})(),m=d0e(t,a),u=ie(i.actorId??i.lockedBy),f=ie(i.workItemId??null);if(!l&&!d&&u===t&&f===n&&Fj(s))return null;let p=l??i0e(o,t,c),g=ie(i.laneSessionId??null)??a,k={lockTaskId:n,lockPath:D(o,s),actorId:t,laneSessionId:g,lockedAt:c,linkedTaskId:p,currentTaskId:d};if(p&&d&&p===d)return null;if(p){let I=c0e(o,p);if(I!==null&&l0e(I))return{kind:"stale-completed",...k,requiredCommand:m,releaseCommand:m,detail:`Framework-mode lock for actor ${t}${g?` lane ${g}`:""} was not released after task ${p} reached status "${I}". Release the stale lock, then claim fresh for ${d??"the current task"}.`};if(I!==null)return{kind:"still-active",...k,requiredCommand:`node atm.mjs tasks handoff --task ${p} --actor ${em(t)} --to <new-actor> --reason "transferring framework lock" --json`,releaseCommand:null,detail:`Framework-mode lock for actor ${t}${g?` lane ${g}`:""} is linked to non-terminal task ${p} (${I}). Use handoff or takeover before releasing.`}}return Fj(s)?u===t&&f===n&&!p&&!d?null:{kind:"possibly-stale",...k,requiredCommand:"node atm.mjs framework-mode status --json",releaseCommand:null,detail:`Framework-mode lock for actor ${t}${g?` lane ${g}`:""} is active but ATM cannot verify the original task context. Review the prior session before releasing.`}:{kind:"stale-ttl-expired",...k,requiredCommand:m,releaseCommand:m,detail:`Framework-mode lock for actor ${t}${g?` lane ${g}`:""} exceeded its TTL without heartbeat renewal. Release the stale lock, then claim fresh.`}}function PT(e){let t=Q.resolve(e),r=Q.join(t,".atm","runtime","locks");return wt(r)?Hf(r).filter(o=>o.startsWith("ATM-FRAMEWORK-TEMP-")&&o.endsWith(".lock.json")).flatMap(o=>{let a=Q.join(r,o),n=eo(a),s=ie(n?.actorId??n?.lockedBy)??o.replace(/^ATM-FRAMEWORK-TEMP-/,"").replace(/\.lock\.json$/,""),i=Bj(t,s,{laneSessionId:ie(n?.laneSessionId??null)});return i?[i]:[]}):[]}function Nr(e){let t=Q.resolve(e.cwd),r=new Date().toISOString(),o=ht(t),a=Mf(t),n=(e.files??[]).map(C=>be(C)).filter(Boolean),s=n.length>0?qt(n):Vje(t),i=!o.isFrameworkRepo&&A3(s),c=e.targetRepo||i?null:Eje(t),l=e.targetRepo?L3(t,e.targetRepo):c?.targetRepo??null,d=l?ht(l):null,m=Ct(t),u=o.isFrameworkRepo?s.filter(Hd):[],f=o.isFrameworkRepo?s.filter(C=>!Hd(C)):[],p=zje(t,e.taskId??null),g=n0e(t,{taskId:e.taskId??null,actorId:e.actorId??null}),k=Kje(t),I=Jje(u),v="inactive",w="none",T=[],A=[];i?(v="inactive",w="none",A.push("adopter-infrastructure-sync")):d?.isFrameworkRepo&&!N3(t,l)?(v="cross-repo-target-required",w="target_repo",T.push("closure-authority-belongs-to-target-repo")):o.isFrameworkRepo&&u.length>0?(v="required",w="local"):o.isFrameworkRepo&&s.length>0&&(v="suspected",w="local"),(v==="required"||v==="cross-repo-target-required")&&k.status!=="available"&&T.push("pinned-runner-missing"),a.ok||T.push("git-worktree-readiness-failed");let R=g.filter(C=>C.kind!=="possibly-stale"||C.currentTaskId!==null);v==="required"&&R.length>0&&T.push("framework-stale-lock-cleanup-required"),v==="required"&&R.length===0&&!g0e(p)&&T.push("active-framework-claim-required"),v==="required"&&(aT(t,Yc(t,Ea)).ok||A.push("git-head-evidence-missing"));let O=n3({policy:m,frameworkMode:v,repoRole:o.isFrameworkRepo?"framework":"host",closureAuthority:w});return{schemaId:"atm.frameworkDevelopmentStatus",specVersion:_T,generatedAt:r,repoRole:o.isFrameworkRepo?"framework":"host",repoIdentity:o,targetRepo:l,targetRepoIdentity:d,mode:v,closureAuthority:w,taskLedgerMode:O,taskLedger:m,changedFiles:s,criticalChangedFiles:u,docsOnlyChangedFiles:f,requiredGates:I,activeLocks:p,staleLocks:g,pinnedRunner:k,gitWorktreeReadiness:a,blockers:T,warnings:A}}function ht(e){return Wc(e)}function Eje(e){let t=Q.resolve(e);if(ht(t).isFrameworkRepo)return null;for(let o of D3(t)){if(!v0e(o.status))continue;let a=I0e(o.document);if(!a)continue;let n=L3(t,a.value),s=ht(n);if(!(!s.isFrameworkRepo||N3(t,n)))return{taskId:o.taskId,taskPath:o.relativePath,field:a.field,rawTargetRepo:a.value,targetRepo:n,targetRepoIdentity:s}}return null}function A3(e){return e.length===0?!1:e.every(t=>_je(t))}function _je(e){let t=be(e);return t==="atm.mjs"||t===".atm/runtime/pinned-runner.json"||t===".atm/integrations/copilot.manifest.json"||t===".atm/integrations/codex.manifest.json"||t===".atm/integrations/claude-code.manifest.json"||t===".github/hooks/atm-framework-development.json"||t.startsWith(".github/instructions/atm-")||t.startsWith(".github/prompts/atm-")||t.startsWith("integrations/codex-skills/atm-")||t.startsWith(".claude/skills/atm-")||t.startsWith(".cursor/rules/skills/atm-")||t.startsWith(".gemini/commands/atm-")}function qj(e){let t=Q.resolve(e),r=new Date().toISOString(),o=ht(t),a=Ct(t),n=T0e(t),s=[],i=D3(t),c=Xje(t),l=new Set;for(let g of i){if(g.parseError){s.push({level:"error",code:"ATM_TASK_AUDIT_TASK_JSON_MALFORMED",path:g.relativePath,taskId:g.taskId,detail:`Task ${g.taskId} ledger JSON is malformed and could not be parsed: ${g.parseError}`});continue}let k=a0e(t,g.document),I=m0e(g.document);I&&g.taskId!==Ea&&s.push({level:"error",code:"ATM_TASK_AUDIT_AI_MANUAL_TASK_IN_LEDGER",path:g.relativePath,taskId:g.taskId,detail:`AI-issued manual task ${g.taskId} by ${I} must not live in .atm/history/tasks; use an ephemeral runtime lock or a human-authored/imported task card.`});let v=ie(g.document.originProvider??g.document.origin_provider),w=ie(g.document.originTaskId??g.document.origin_task_id),T=ie(g.document.syncStatus??g.document.sync_status);v&&w?(l.add(Oj(v,w)),T||s.push({level:"error",code:"ATM_TASK_AUDIT_MIRROR_SYNC_STATUS_MISSING",path:g.relativePath,taskId:g.taskId,detail:`Mirror task ${g.taskId} must declare syncStatus.`})):(v||w)&&s.push({level:"error",code:"ATM_TASK_AUDIT_MIRROR_ORIGIN_INCOMPLETE",path:g.relativePath,taskId:g.taskId,detail:`Mirror task ${g.taskId} must declare both originProvider and originTaskId.`});let A=ie(g.document.lastTransitionId??g.document.last_transition_id),R=!!(A&&CT(t,g.taskId,A)),O=ie(g.document.target_repo??g.document.targetRepo??g.document.upstream_repo??g.document.upstreamRepo),C=!!(O&&!ET(t,O));a.enabled&&a.provider==="atm-local"&&a.requireCliTransitions&&!k&&!C&&(g.status==="done"||!!(v||w))&&!A?s.push({level:"error",code:"ATM_TASK_AUDIT_TRANSITION_EVIDENCE_MISSING",path:g.relativePath,taskId:g.taskId,detail:`Task ${g.taskId} is missing lastTransitionId; status transitions must use ATM CLI.`}):A&&!R&&s.push({level:"error",code:"ATM_TASK_AUDIT_TRANSITION_EVENT_MISSING",path:g.relativePath,taskId:g.taskId,detail:`Task ${g.taskId} references missing transition event ${A}.`});let E=ie(g.status)?.toLowerCase().replace(/-/g,"_")??"";if(E==="running"||E==="review"){let B=at(g.document.claim),F=B?B.state!=="active"?`claim state is "${B.state}"`:Oa(B,r)?`claim lease ${B.leaseId} for actor ${B.actorId} expired (ttl ${B.ttlSeconds}s, last heartbeat ${B.heartbeatAt})`:null:"no parseable claim record exists";F&&s.push({level:"warning",code:"ATM_TASK_AUDIT_STALE_CLAIM",path:g.relativePath,taskId:g.taskId,detail:`Task ${g.taskId} is ${E} but ${F}; the backlog entry is stalled. Run "node atm.mjs tasks repair-claim --task ${g.taskId} --actor <id> --json" to diagnose and clear it.`})}if(g.status!=="done")continue;let P=$3(g.document.closure_authority??g.document.closureAuthority),M=ie(g.document.closure_packet??g.document.closurePacket),L=!!(g.document.closedByActor||g.document.closedByCommand==="atm tasks close"),U=ie(g.document.ledgerBaselineKind??g.document.ledger_baseline_kind)==="legacy-transition-backfill"&&R;if(k){s.push({level:"warning",code:"ATM_TASK_AUDIT_PLANNING_ONLY_DONE",path:g.relativePath,taskId:g.taskId,detail:`[planning-only] Task ${g.taskId} is marked done under planning authority and is not enforced as target-repo closure evidence in this repository. Run "node atm.mjs tasks import" if you need to synchronize it as target-repo work.`});continue}if(P==="target_repo"&&O&&!ET(t,O)){M||s.push({level:"warning",code:"ATM_TASK_AUDIT_CROSS_REPO_DONE_WITHOUT_PACKET",path:g.relativePath,taskId:g.taskId,detail:`[external-planning] Task ${g.taskId} is done in a non-target repo without a target closure packet. Run "node atm.mjs tasks import" if you need to synchronize it as target-repo work.`});continue}!L&&!M&&!U?s.push({level:"error",code:"ATM_TASK_AUDIT_MANUAL_DONE",path:g.relativePath,taskId:g.taskId,detail:`[target-authority] Task ${g.taskId} is marked done without ATM CLI closure metadata.`}):U&&!L&&!M&&s.push({level:"warning",code:"ATM_TASK_AUDIT_LEGACY_BASELINE_DONE",path:g.relativePath,taskId:g.taskId,detail:`[target-authority] Task ${g.taskId} is done via a legacy baseline transition; it is traceable but not equivalent to a fresh ATM CLI close.`})}if(a.enabled&&a.mirrorExternalTasks)for(let g of a.externalTasks)l.has(Oj(g.provider,g.taskId))||s.push({level:"error",code:"ATM_TASK_AUDIT_EXTERNAL_TASK_NOT_MIRRORED",path:".atm/config.json",detail:`External task ${g.provider}:${g.taskId} must have a visible ATM mirror task.`});for(let g of PT(t))g.kind!=="still-active"&&s.push({level:"warning",code:"ATM_TASK_AUDIT_STALE_FRAMEWORK_LOCK",path:g.lockPath,detail:`Framework-mode lock for actor ${g.actorId} is ${g.kind}${g.lockedAt?` (locked at ${g.lockedAt})`:""}; run "${g.requiredCommand}" to clear the stalled lock.`});let d=Zje(t);d.changedDoneTaskFiles.length>1&&!r0e(t)&&s.push({level:"error",code:"ATM_TASK_AUDIT_BULK_CLOSE_WITHOUT_MANIFEST",path:d.commitSha??"HEAD",detail:`Latest commit closes ${d.changedDoneTaskFiles.length} task files without a bulk closure manifest.`});for(let g of o0e(t))s.push({level:"error",code:"ATM_TASK_AUDIT_COMPLETION_REPORT_UNVERIFIED",path:g,detail:"Completion report claims all work is complete; tasks audit requires matching task states, command evidence, and closure packets."});for(let g of c)F3(g.document)||s.push({level:"warning",code:"ATM_TASK_AUDIT_DRAFT_STATIC_EVIDENCE",path:g.relativePath,detail:"Static evidence has no commandRuns/exitCode/stdout hash and is treated as draft evidence only."});let m=s.filter(g=>g.level==="error").length,u=s.map(g=>g.level!=="warning"||!n.acknowledgedFindings.has(q3(g))?g:{...g,acknowledged:!0}),f=u.filter(g=>g.acknowledged).length,p=u.filter(g=>!g.acknowledged).length;return{schemaId:"atm.taskAuditReport",specVersion:_T,generatedAt:r,repoIdentity:o,inspectedTaskCount:i.length,inspectedEvidenceCount:c.length,findings:u,acknowledgedFindingCount:f,activeFindingCount:p,ok:m===0}}function cl(e){let t=e,r=[],o=[];if(!t||typeof t!="object"||Array.isArray(t))return{ok:!1,missing:["object"],invalidFormat:o};if(t.schemaId!=="atm.closurePacket.v1"&&r.push("schemaId"),t.closedByCommand!=="atm tasks close"&&r.push("closedByCommand"),ie(t.taskId)||r.push("taskId"),ie(t.closedByActor)||r.push("closedByActor"),ie(t.evidencePath)||r.push("evidencePath"),t.targetRepoIdentity?.isFrameworkRepo||r.push("targetRepoIdentity"),!t.targetCommitDelta||typeof t.targetCommitDelta!="object"||Array.isArray(t.targetCommitDelta)?r.push("targetCommitDelta"):(Array.isArray(t.targetCommitDelta.parentCommitShas)||r.push("targetCommitDelta/parentCommitShas"),Array.isArray(t.targetCommitDelta.changedFiles)||r.push("targetCommitDelta/changedFiles")),!Array.isArray(t.commandRuns)||t.commandRuns.length===0)r.push("commandRuns");else for(let[a,n]of t.commandRuns.entries())(typeof n.command!="string"||n.command.trim().length===0)&&r.push(`commandRuns/${a}/command`),typeof n.exitCode!="number"&&r.push(`commandRuns/${a}/exitCode`),Dj({missing:r,invalidFormat:o},`commandRuns/${a}/stdoutSha256`,n.stdoutSha256),Dj({missing:r,invalidFormat:o},`commandRuns/${a}/stderrSha256`,n.stderrSha256);if(!Array.isArray(t.validationPasses)||t.validationPasses.length===0)r.push("validationPasses");else{let a=new Set(t.validationPasses.filter(n=>typeof n=="string"&&n.trim().length>0).map(n=>n.trim()));for(let n of Gj(t.requiredGates??[],t.targetCommitDelta?.changedFiles??[]))a.has(n)||r.push(`validationPasses/${n}`)}if(!t.requiredGatesSnapshot||typeof t.requiredGatesSnapshot!="object"||Array.isArray(t.requiredGatesSnapshot))r.push("requiredGatesSnapshot");else{let a=t.requiredGatesSnapshot;a.schemaId!=="atm.requiredGatesSnapshot.v1"&&r.push("requiredGatesSnapshot/schemaId"),a.source!=="frameworkStatus.requiredGates"&&r.push("requiredGatesSnapshot/source"),ie(a.ruleVersion)||r.push("requiredGatesSnapshot/ruleVersion"),a.frameworkMode!=="required"&&a.frameworkMode!=="cross-repo-target-required"&&a.frameworkMode!=="suspected"&&a.frameworkMode!=="inactive"&&r.push("requiredGatesSnapshot/frameworkMode"),a.repoRole!=="framework"&&a.repoRole!=="host"&&r.push("requiredGatesSnapshot/repoRole"),Array.isArray(a.requiredGates)?P0e(a.requiredGates,t.requiredGates??[])||r.push("requiredGatesSnapshot/requiredGates-mismatch"):r.push("requiredGatesSnapshot/requiredGates")}if(t.attestation!==void 0&&t.attestation!==null){let a=t.attestation;typeof a!="object"||Array.isArray(a)?r.push("attestation"):(a.schemaId!=="atm.reconcileAttestation.v1"&&r.push("attestation/schemaId"),(typeof a.deliveryCommit!="string"||a.deliveryCommit.trim().length===0)&&r.push("attestation/deliveryCommit"),(typeof a.reconciledAt!="string"||a.reconciledAt.trim().length===0)&&r.push("attestation/reconciledAt"),(typeof a.reconciledByActor!="string"||a.reconciledByActor.trim().length===0)&&r.push("attestation/reconciledByActor"),typeof a.reason!="string"&&r.push("attestation/reason"))}if(t.teamSummary!==void 0&&t.teamSummary!==null){let a=t.teamSummary;if(typeof a!="object"||Array.isArray(a))r.push("teamSummary");else{if(a.schemaId!=="atm.closurePacketTeamSummary.v1"&&r.push("teamSummary/schemaId"),ie(a.capturedAt)||r.push("teamSummary/capturedAt"),ie(a.teamRunId)||r.push("teamSummary/teamRunId"),!a.source||typeof a.source!="object"||Array.isArray(a.source))r.push("teamSummary/source");else{let n=a.source;n.kind!=="team-run"&&r.push("teamSummary/source/kind"),ie(n.teamRunPath)||r.push("teamSummary/source/teamRunPath")}Object.prototype.hasOwnProperty.call(a,"captainDecision")||r.push("teamSummary/captainDecision"),Array.isArray(a.agentReports)||r.push("teamSummary/agentReports"),Array.isArray(a.patrolFindings)||r.push("teamSummary/patrolFindings"),Object.prototype.hasOwnProperty.call(a,"evidenceCuratorSummary")||r.push("teamSummary/evidenceCuratorSummary"),Object.prototype.hasOwnProperty.call(a,"teamSummary")||r.push("teamSummary/teamSummary"),Object.prototype.hasOwnProperty.call(a,"validationPasses")&&o.push({path:"teamSummary/validationPasses",kind:"invalidFormat",formatExpected:"teamSummary must not declare validationPasses; only command-backed closure packet evidence can pass validators.",actualValue:"present"})}}return t.evidenceFreshness!=="fresh"&&r.push("evidenceFreshness"),{ok:r.length===0&&o.length===0,missing:r,invalidFormat:o}}function Pje(e,t,r){let o=Q.join(e,".atm","history","evidence",`${t}.json`),a=D(e,o);if(!wt(o))return{evidencePath:a,changed:!1};let n=eo(o);if(!n)return{evidencePath:a,changed:!1};let s=rm(n),i=`${JSON.stringify(n,null,2)}
56
+ ${t}`;return`${e.createdAt.replace(/[:.]/g,"-")}-${e.action}-${o3("sha256").update(r).digest("hex").slice(0,12)}`}function CT(e,t,r){let o=Zd.resolve(e),a=Ct(o);return a3(Zd.join(o,a.eventRoot,i3(t),`${r}.json`))}function Oj(e,t){return`${e.trim().toLowerCase()}::${t.trim().toLowerCase()}`}function s3(e,t){let r=e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"-").replace(/^-|-$/g,"")||"EXT",o=t.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"-").replace(/^-|-$/g,"")||"TASK";return`MIRROR-${r}-${o}`}function uje(e){let t=String(e??"auto").trim().toLowerCase().replace(/_/g,"-");return t==="adopter-governed"||t==="framework-development"||t==="external-provider"?t:"auto"}function fje(e){return Array.isArray(e)?e.flatMap(t=>{if(!Mj(t))return[];let r=qf(t.provider),o=qf(t.taskId??t.originTaskId);return!r||!o?[]:[{provider:r,taskId:o,url:qf(t.url??t.originUrl)}]}):[]}function pje(e){if(!a3(e))return null;try{return JSON.parse(dje(e,"utf8"))}catch{return null}}function Mj(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function qf(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}function i3(e){return e.trim().replace(/[^A-Za-z0-9._-]+/g,"-")}function hje(e){return`sha256:${o3("sha256").update(e).digest("hex")}`}var Ay,ca=y(()=>{"use strict";_();Ay={enabled:!0,configuredMode:"auto",provider:"atm-local",mirrorExternalTasks:!0,requireCliTransitions:!0}});function Ije(e){return typeof e!="string"?typeof e:e.length<=32?e:`${e.slice(0,16)}...${e.slice(-8)} (len=${e.length})`}function Dj(e,t,r){if(typeof r!="string"||r.trim().length===0){e.missing.push(t);return}(!gje.test(r)||!kje.test(r))&&e.invalidFormat.push({path:t,kind:"invalidFormat",formatExpected:yje,actualValue:Ije(r)})}var gje,kje,yje,c3=y(()=>{"use strict";gje=/^sha256:([a-fA-F0-9]{64})$/,kje=/^sha256:[a-f0-9]{64}$/,yje="^sha256:[a-f0-9]{64}$"});import{createHash as vje}from"node:crypto";import{spawnSync as _i}from"node:child_process";import{appendFileSync as wje,existsSync as wt,mkdirSync as Cy,mkdtempSync as y3,readFileSync as la,readdirSync as Hf,rmSync as I3,statSync as Lj,unlinkSync as Ty,writeFileSync as Ts}from"node:fs";import v3 from"node:os";import Q from"node:path";function Cs(e,t){let r=be(e),o=t.trim();return!r||!o?!1:r===hr||r===`.atm/history/tasks/${o}.json`||r===`.atm/history/evidence/${o}.json`||r===`.atm/history/evidence/${o}.closure-packet.json`||r.startsWith(`.atm/history/task-events/${o}/`)||r===`.atm/runtime/locks/${o}.lock.json`}function Nj(e,t,r){let o=e?.trim().toUpperCase()??null,a=qt(t.map(be).filter(Boolean)).map(n=>Sje(o,n,r??null)).filter(n=>n!==null);return{autoCleanSafe:a.filter(n=>n.verdict==="auto-clean-safe"),blockAndExplain:a.filter(n=>n.verdict==="block-and-explain"),manualReview:a.filter(n=>n.verdict==="manual-review")}}function Sje(e,t,r){let o=be(t),a=o.toLowerCase(),n=e?.trim().toUpperCase()??null,s=xF(r,o);if(s)return{path:o,verdict:"block-and-explain",reason:"Verified bootstrap history must be preserved outside unrelated task commits.",ownerTaskId:s,cleanupAction:null};if(a.startsWith(".atm/history/reports/task-import/")&&a.endsWith(".json"))return{path:o,verdict:"auto-clean-safe",reason:"task-import report is an ATM-generated transient report and may be removed automatically after the import/claim lane completes.",ownerTaskId:n,cleanupAction:"remove"};if(a.startsWith(".atm/history/protected-override-audit/")&&a.endsWith(".json"))return null;let i=bje(o);if(i)return n&&i.ownerTaskId===n?null:Aje(r,i.ownerTaskId)==="abandoned"?i.artifactKind==="bundle-manifest"?{path:o,verdict:"auto-clean-safe",reason:`Abandoned task ${i.ownerTaskId} left disposable generated residue (${i.artifactKind}); remove it so later taskflow/commit lanes stay admissible without erasing the abandon audit trail.`,ownerTaskId:i.ownerTaskId,cleanupAction:"remove"}:null:{path:o,verdict:"block-and-explain",reason:n?`${i.artifactKind} belongs to another task (${i.ownerTaskId}) and must be reconciled explicitly instead of silently skipped.`:`${i.artifactKind} is an ATM-managed governance artifact (${i.ownerTaskId}) but no active task ownership is available to prove it is safe residue.`,ownerTaskId:i.ownerTaskId,cleanupAction:null};if(a===Ae.legacyJson||a===Ae.jsonl)return{path:o,verdict:"auto-clean-safe",reason:"hook-generated git-head evidence residue is reproducible and may be restored automatically.",ownerTaskId:e,cleanupAction:"restore"};let c=a.match(/^\.atm\/runtime\/snapshots\/(?:(close-window-)?foreign-staged)-([a-z0-9-]+)-\d+\.json$/);if(c){let m=c[2]?.toUpperCase()??null;return{path:o,verdict:"auto-clean-safe",reason:m==="GIT-HEAD"||n&&m===n?"current-operation foreign-staged snapshot is an ATM byproduct and may be removed automatically after the lane completes.":`foreign-staged snapshot belongs to another task/run (${m}) but is a disposable ATM byproduct and may be removed automatically before commit.`,ownerTaskId:m,cleanupAction:"remove"}}let l=a.match(/^\.atm\/runtime\/snapshots\/close-window-governance-dirty-[^.]+-\.atm__history__evidence__([a-z0-9-]+)(?:\.[^.]+)?\.json\.json$/);if(l){let m=l[1]?.toUpperCase()??null;return{path:o,verdict:"auto-clean-safe",reason:m==="GIT-HEAD"||n&&m===n?"close-window governance-dirty snapshot belongs to the current operation and may be removed automatically after the lane completes.":`close-window governance-dirty snapshot belongs to another task/run (${m}) but is a disposable ATM byproduct and may be removed automatically before commit.`,ownerTaskId:m,cleanupAction:"remove"}}if(a.match(/^\.atm\/runtime\/snapshots\/close-window-governance-dirty-[^.]+-\.atm__history__evidence__git-head\.jsonl\.json$/))return{path:o,verdict:"auto-clean-safe",reason:"close-window governance-dirty snapshot for git-head evidence is hook-generated and may be removed automatically after the lane completes.",ownerTaskId:"GIT-HEAD",cleanupAction:"remove"};let d=a.match(/^\.atm\/history\/reports\/lock-cleanup\/[^/]+-([a-z0-9-]+)\.json$/);if(d){let m=d[1]?.toUpperCase()??null;return{path:o,verdict:"auto-clean-safe",reason:m===n?"lock-cleanup report belongs to the current task checkpoint and may be removed automatically after commit.":`lock-cleanup report belongs to another task/run (${m}) but is a disposable ATM byproduct and may be removed automatically before commit.`,ownerTaskId:m,cleanupAction:"remove"}}return a.startsWith(".atm/runtime/snapshots/")&&a.endsWith(".json")?{path:o,verdict:"manual-review",reason:"snapshot looks generated but ATM cannot prove it belongs to the current operation.",ownerTaskId:null,cleanupAction:null}:{path:o,verdict:"manual-review",reason:"path is not recognized as a known ATM auto-generated residue shape.",ownerTaskId:null,cleanupAction:null}}function Aje(e,t){if(!e||!t)return null;let r=Q.join(e,".atm","history","tasks",`${t}.json`);if(!wt(r))return null;try{let o=JSON.parse(la(r,"utf8"));return typeof o.status=="string"?o.status.trim().toLowerCase():null}catch{return null}}function bje(e){let t=be(e),r=t.match(/^\.atm\/history\/evidence\/([^/.]+)\.bundle-manifest\.json$/i);if(r)return{ownerTaskId:r[1].toUpperCase(),artifactKind:"bundle-manifest"};let o=t.match(/^\.atm\/history\/evidence\/([^/.]+)\.closure-packet\.json$/i);if(o)return{ownerTaskId:o[1].toUpperCase(),artifactKind:"closure-packet"};let a=t.match(/^\.atm\/history\/task-events\/([^/]+)\/.+(?:close|reconcile|repair-closure).+\.json$/i);return a?{ownerTaskId:a[1].toUpperCase(),artifactKind:"close-task-event"}:null}function Tje(e){let t=e.trim(),r=w3.exec(t);return r?`sha256:${r[1].toLowerCase()}`:t}function rm(e){if(Array.isArray(e))return e.map(t=>rm(t));if(e&&typeof e=="object"){let t={};for(let[r,o]of Object.entries(e))t[r]=rm(o);return t}return typeof e=="string"&&w3.test(e.trim())?Tje(e):e}function Wf(e=[],t=null,r=null,o=null){let a=qt(e.map(be).filter(Boolean)),n=a.length>0?a.join(","):"<files>",s=t?.trim()||"temporary framework maintenance",i=r?.trim()||"<id>",c=ie(o),l=c?` --lane-session ${em(c)}`:"";return`node atm.mjs framework-mode claim --actor ${i==="<id>"?i:em(i)}${l} --files ${em(n)} --reason ${em(s)} --json`}function Bj(e,t,r={}){let o=Q.resolve(e),a=y0e(r.laneSessionId),n=k0e(t,a),s=Q.join(o,".atm","runtime","locks",`${n}.lock.json`),i=eo(s);if(!i||i.released===!0)return null;let c=ie(i.lockedAt??null),l=ie(i.linkedTaskId??null),d=(()=>{try{return s0e(o,t,r.currentTaskId??null,a)}catch(I){if(I instanceof h&&I.code==="ATM_FRAMEWORK_TEMP_CLAIM_TASK_BINDING_AMBIGUOUS"&&!ie(r.currentTaskId))return null;throw I}})(),m=d0e(t,a),u=ie(i.actorId??i.lockedBy),f=ie(i.workItemId??null);if(!l&&!d&&u===t&&f===n&&Fj(s))return null;let p=l??i0e(o,t,c),g=ie(i.laneSessionId??null)??a,k={lockTaskId:n,lockPath:D(o,s),actorId:t,laneSessionId:g,lockedAt:c,linkedTaskId:p,currentTaskId:d};if(p&&d&&p===d)return null;if(p){let I=c0e(o,p);if(I!==null&&l0e(I))return{kind:"stale-completed",...k,requiredCommand:m,releaseCommand:m,detail:`Framework-mode lock for actor ${t}${g?` lane ${g}`:""} was not released after task ${p} reached status "${I}". Release the stale lock, then claim fresh for ${d??"the current task"}.`};if(I!==null)return{kind:"still-active",...k,requiredCommand:`node atm.mjs tasks handoff --task ${p} --actor ${em(t)} --to <new-actor> --reason "transferring framework lock" --json`,releaseCommand:null,detail:`Framework-mode lock for actor ${t}${g?` lane ${g}`:""} is linked to non-terminal task ${p} (${I}). Use handoff or takeover before releasing.`}}return Fj(s)?u===t&&f===n&&!p&&!d?null:{kind:"possibly-stale",...k,requiredCommand:"node atm.mjs framework-mode status --json",releaseCommand:null,detail:`Framework-mode lock for actor ${t}${g?` lane ${g}`:""} is active but ATM cannot verify the original task context. Review the prior session before releasing.`}:{kind:"stale-ttl-expired",...k,requiredCommand:m,releaseCommand:m,detail:`Framework-mode lock for actor ${t}${g?` lane ${g}`:""} exceeded its TTL without heartbeat renewal. Release the stale lock, then claim fresh.`}}function PT(e){let t=Q.resolve(e),r=Q.join(t,".atm","runtime","locks");return wt(r)?Hf(r).filter(o=>o.startsWith("ATM-FRAMEWORK-TEMP-")&&o.endsWith(".lock.json")).flatMap(o=>{let a=Q.join(r,o),n=eo(a),s=ie(n?.actorId??n?.lockedBy)??o.replace(/^ATM-FRAMEWORK-TEMP-/,"").replace(/\.lock\.json$/,""),i=Bj(t,s,{laneSessionId:ie(n?.laneSessionId??null)});return i?[i]:[]}):[]}function Nr(e){let t=Q.resolve(e.cwd),r=new Date().toISOString(),o=ht(t),a=Mf(t),n=(e.files??[]).map(C=>be(C)).filter(Boolean),s=n.length>0?qt(n):Vje(t),i=!o.isFrameworkRepo&&A3(s),c=e.targetRepo||i?null:Eje(t),l=e.targetRepo?L3(t,e.targetRepo):c?.targetRepo??null,d=l?ht(l):null,m=Ct(t),u=o.isFrameworkRepo?s.filter(Hd):[],f=o.isFrameworkRepo?s.filter(C=>!Hd(C)):[],p=zje(t,e.taskId??null),g=n0e(t,{taskId:e.taskId??null,actorId:e.actorId??null}),k=Kje(t),I=Jje(u),v="inactive",w="none",T=[],A=[];i?(v="inactive",w="none",A.push("adopter-infrastructure-sync")):d?.isFrameworkRepo&&!N3(t,l)?(v="cross-repo-target-required",w="target_repo",T.push("closure-authority-belongs-to-target-repo")):o.isFrameworkRepo&&u.length>0?(v="required",w="local"):o.isFrameworkRepo&&s.length>0&&(v="suspected",w="local"),(v==="required"||v==="cross-repo-target-required")&&k.status!=="available"&&T.push("pinned-runner-missing"),a.ok||T.push("git-worktree-readiness-failed");let R=g.filter(C=>C.kind!=="possibly-stale"||C.currentTaskId!==null);v==="required"&&R.length>0&&T.push("framework-stale-lock-cleanup-required"),v==="required"&&R.length===0&&!g0e(p)&&T.push("active-framework-claim-required"),v==="required"&&(aT(t,Yc(t,Ea)).ok||A.push("git-head-evidence-missing"));let O=n3({policy:m,frameworkMode:v,repoRole:o.isFrameworkRepo?"framework":"host",closureAuthority:w});return{schemaId:"atm.frameworkDevelopmentStatus",specVersion:_T,generatedAt:r,repoRole:o.isFrameworkRepo?"framework":"host",repoIdentity:o,targetRepo:l,targetRepoIdentity:d,mode:v,closureAuthority:w,taskLedgerMode:O,taskLedger:m,changedFiles:s,criticalChangedFiles:u,docsOnlyChangedFiles:f,requiredGates:I,activeLocks:p,staleLocks:g,pinnedRunner:k,gitWorktreeReadiness:a,blockers:T,warnings:A}}function ht(e){return Wc(e)}function Eje(e){let t=Q.resolve(e);if(ht(t).isFrameworkRepo)return null;for(let o of D3(t)){if(!v0e(o.status))continue;let a=I0e(o.document);if(!a)continue;let n=L3(t,a.value),s=ht(n);if(!(!s.isFrameworkRepo||N3(t,n)))return{taskId:o.taskId,taskPath:o.relativePath,field:a.field,rawTargetRepo:a.value,targetRepo:n,targetRepoIdentity:s}}return null}function A3(e){return e.length===0?!1:e.every(t=>_je(t))}function _je(e){let t=be(e);return t==="atm.mjs"||t===".atm/runtime/pinned-runner.json"||t===".atm/integrations/copilot.manifest.json"||t===".atm/integrations/codex.manifest.json"||t===".atm/integrations/claude-code.manifest.json"||t===".github/hooks/atm-framework-development.json"||t.startsWith(".github/instructions/atm-")||t.startsWith(".github/prompts/atm-")||t.startsWith("integrations/codex-skills/atm-")||t.startsWith(".claude/skills/atm-")||t.startsWith(".cursor/rules/skills/atm-")||t.startsWith(".gemini/commands/atm-")}function qj(e){let t=Q.resolve(e),r=new Date().toISOString(),o=ht(t),a=Ct(t),n=T0e(t),s=[],i=D3(t),c=Xje(t),l=new Set;for(let g of i){if(g.parseError){s.push({level:"error",code:"ATM_TASK_AUDIT_TASK_JSON_MALFORMED",path:g.relativePath,taskId:g.taskId,detail:`Task ${g.taskId} ledger JSON is malformed and could not be parsed: ${g.parseError}`});continue}let k=a0e(t,g.document),I=m0e(g.document);I&&g.taskId!==Ea&&s.push({level:"error",code:"ATM_TASK_AUDIT_AI_MANUAL_TASK_IN_LEDGER",path:g.relativePath,taskId:g.taskId,detail:`AI-issued manual task ${g.taskId} by ${I} must not live in .atm/history/tasks; use an ephemeral runtime lock or a human-authored/imported task card.`});let v=ie(g.document.originProvider??g.document.origin_provider),w=ie(g.document.originTaskId??g.document.origin_task_id),T=ie(g.document.syncStatus??g.document.sync_status);v&&w?(l.add(Oj(v,w)),T||s.push({level:"error",code:"ATM_TASK_AUDIT_MIRROR_SYNC_STATUS_MISSING",path:g.relativePath,taskId:g.taskId,detail:`Mirror task ${g.taskId} must declare syncStatus.`})):(v||w)&&s.push({level:"error",code:"ATM_TASK_AUDIT_MIRROR_ORIGIN_INCOMPLETE",path:g.relativePath,taskId:g.taskId,detail:`Mirror task ${g.taskId} must declare both originProvider and originTaskId.`});let A=ie(g.document.lastTransitionId??g.document.last_transition_id),R=!!(A&&CT(t,g.taskId,A)),O=ie(g.document.target_repo??g.document.targetRepo??g.document.upstream_repo??g.document.upstreamRepo),C=!!(O&&!ET(t,O));a.enabled&&a.provider==="atm-local"&&a.requireCliTransitions&&!k&&!C&&(g.status==="done"||!!(v||w))&&!A?s.push({level:"error",code:"ATM_TASK_AUDIT_TRANSITION_EVIDENCE_MISSING",path:g.relativePath,taskId:g.taskId,detail:`Task ${g.taskId} is missing lastTransitionId; status transitions must use ATM CLI.`}):A&&!R&&!k&&!C&&s.push({level:"error",code:"ATM_TASK_AUDIT_TRANSITION_EVENT_MISSING",path:g.relativePath,taskId:g.taskId,detail:`Task ${g.taskId} references missing transition event ${A}.`});let E=ie(g.status)?.toLowerCase().replace(/-/g,"_")??"";if(E==="running"||E==="review"){let B=at(g.document.claim),F=B?B.state!=="active"?`claim state is "${B.state}"`:Oa(B,r)?`claim lease ${B.leaseId} for actor ${B.actorId} expired (ttl ${B.ttlSeconds}s, last heartbeat ${B.heartbeatAt})`:null:"no parseable claim record exists";F&&s.push({level:"warning",code:"ATM_TASK_AUDIT_STALE_CLAIM",path:g.relativePath,taskId:g.taskId,detail:`Task ${g.taskId} is ${E} but ${F}; the backlog entry is stalled. Run "node atm.mjs tasks repair-claim --task ${g.taskId} --actor <id> --json" to diagnose and clear it.`})}if(g.status!=="done")continue;let P=$3(g.document.closure_authority??g.document.closureAuthority),M=ie(g.document.closure_packet??g.document.closurePacket),L=!!(g.document.closedByActor||g.document.closedByCommand==="atm tasks close"),U=ie(g.document.ledgerBaselineKind??g.document.ledger_baseline_kind)==="legacy-transition-backfill"&&R;if(k){s.push({level:"warning",code:"ATM_TASK_AUDIT_PLANNING_ONLY_DONE",path:g.relativePath,taskId:g.taskId,detail:`[planning-only] Task ${g.taskId} is marked done under planning authority and is not enforced as target-repo closure evidence in this repository. Run "node atm.mjs tasks import" if you need to synchronize it as target-repo work.`});continue}if(P==="target_repo"&&O&&!ET(t,O)){M||s.push({level:"warning",code:"ATM_TASK_AUDIT_CROSS_REPO_DONE_WITHOUT_PACKET",path:g.relativePath,taskId:g.taskId,detail:`[external-planning] Task ${g.taskId} is done in a non-target repo without a target closure packet. Run "node atm.mjs tasks import" if you need to synchronize it as target-repo work.`});continue}!L&&!M&&!U?s.push({level:"error",code:"ATM_TASK_AUDIT_MANUAL_DONE",path:g.relativePath,taskId:g.taskId,detail:`[target-authority] Task ${g.taskId} is marked done without ATM CLI closure metadata.`}):U&&!L&&!M&&s.push({level:"warning",code:"ATM_TASK_AUDIT_LEGACY_BASELINE_DONE",path:g.relativePath,taskId:g.taskId,detail:`[target-authority] Task ${g.taskId} is done via a legacy baseline transition; it is traceable but not equivalent to a fresh ATM CLI close.`})}if(a.enabled&&a.mirrorExternalTasks)for(let g of a.externalTasks)l.has(Oj(g.provider,g.taskId))||s.push({level:"error",code:"ATM_TASK_AUDIT_EXTERNAL_TASK_NOT_MIRRORED",path:".atm/config.json",detail:`External task ${g.provider}:${g.taskId} must have a visible ATM mirror task.`});for(let g of PT(t))g.kind!=="still-active"&&s.push({level:"warning",code:"ATM_TASK_AUDIT_STALE_FRAMEWORK_LOCK",path:g.lockPath,detail:`Framework-mode lock for actor ${g.actorId} is ${g.kind}${g.lockedAt?` (locked at ${g.lockedAt})`:""}; run "${g.requiredCommand}" to clear the stalled lock.`});let d=Zje(t);d.changedDoneTaskFiles.length>1&&!r0e(t)&&s.push({level:"error",code:"ATM_TASK_AUDIT_BULK_CLOSE_WITHOUT_MANIFEST",path:d.commitSha??"HEAD",detail:`Latest commit closes ${d.changedDoneTaskFiles.length} task files without a bulk closure manifest.`});for(let g of o0e(t))s.push({level:"error",code:"ATM_TASK_AUDIT_COMPLETION_REPORT_UNVERIFIED",path:g,detail:"Completion report claims all work is complete; tasks audit requires matching task states, command evidence, and closure packets."});for(let g of c)F3(g.document)||s.push({level:"warning",code:"ATM_TASK_AUDIT_DRAFT_STATIC_EVIDENCE",path:g.relativePath,detail:"Static evidence has no commandRuns/exitCode/stdout hash and is treated as draft evidence only."});let m=s.filter(g=>g.level==="error").length,u=s.map(g=>g.level!=="warning"||!n.acknowledgedFindings.has(q3(g))?g:{...g,acknowledged:!0}),f=u.filter(g=>g.acknowledged).length,p=u.filter(g=>!g.acknowledged).length;return{schemaId:"atm.taskAuditReport",specVersion:_T,generatedAt:r,repoIdentity:o,inspectedTaskCount:i.length,inspectedEvidenceCount:c.length,findings:u,acknowledgedFindingCount:f,activeFindingCount:p,ok:m===0}}function cl(e){let t=e,r=[],o=[];if(!t||typeof t!="object"||Array.isArray(t))return{ok:!1,missing:["object"],invalidFormat:o};if(t.schemaId!=="atm.closurePacket.v1"&&r.push("schemaId"),t.closedByCommand!=="atm tasks close"&&r.push("closedByCommand"),ie(t.taskId)||r.push("taskId"),ie(t.closedByActor)||r.push("closedByActor"),ie(t.evidencePath)||r.push("evidencePath"),t.targetRepoIdentity?.isFrameworkRepo||r.push("targetRepoIdentity"),!t.targetCommitDelta||typeof t.targetCommitDelta!="object"||Array.isArray(t.targetCommitDelta)?r.push("targetCommitDelta"):(Array.isArray(t.targetCommitDelta.parentCommitShas)||r.push("targetCommitDelta/parentCommitShas"),Array.isArray(t.targetCommitDelta.changedFiles)||r.push("targetCommitDelta/changedFiles")),!Array.isArray(t.commandRuns)||t.commandRuns.length===0)r.push("commandRuns");else for(let[a,n]of t.commandRuns.entries())(typeof n.command!="string"||n.command.trim().length===0)&&r.push(`commandRuns/${a}/command`),typeof n.exitCode!="number"&&r.push(`commandRuns/${a}/exitCode`),Dj({missing:r,invalidFormat:o},`commandRuns/${a}/stdoutSha256`,n.stdoutSha256),Dj({missing:r,invalidFormat:o},`commandRuns/${a}/stderrSha256`,n.stderrSha256);if(!Array.isArray(t.validationPasses)||t.validationPasses.length===0)r.push("validationPasses");else{let a=new Set(t.validationPasses.filter(n=>typeof n=="string"&&n.trim().length>0).map(n=>n.trim()));for(let n of Gj(t.requiredGates??[],t.targetCommitDelta?.changedFiles??[]))a.has(n)||r.push(`validationPasses/${n}`)}if(!t.requiredGatesSnapshot||typeof t.requiredGatesSnapshot!="object"||Array.isArray(t.requiredGatesSnapshot))r.push("requiredGatesSnapshot");else{let a=t.requiredGatesSnapshot;a.schemaId!=="atm.requiredGatesSnapshot.v1"&&r.push("requiredGatesSnapshot/schemaId"),a.source!=="frameworkStatus.requiredGates"&&r.push("requiredGatesSnapshot/source"),ie(a.ruleVersion)||r.push("requiredGatesSnapshot/ruleVersion"),a.frameworkMode!=="required"&&a.frameworkMode!=="cross-repo-target-required"&&a.frameworkMode!=="suspected"&&a.frameworkMode!=="inactive"&&r.push("requiredGatesSnapshot/frameworkMode"),a.repoRole!=="framework"&&a.repoRole!=="host"&&r.push("requiredGatesSnapshot/repoRole"),Array.isArray(a.requiredGates)?P0e(a.requiredGates,t.requiredGates??[])||r.push("requiredGatesSnapshot/requiredGates-mismatch"):r.push("requiredGatesSnapshot/requiredGates")}if(t.attestation!==void 0&&t.attestation!==null){let a=t.attestation;typeof a!="object"||Array.isArray(a)?r.push("attestation"):(a.schemaId!=="atm.reconcileAttestation.v1"&&r.push("attestation/schemaId"),(typeof a.deliveryCommit!="string"||a.deliveryCommit.trim().length===0)&&r.push("attestation/deliveryCommit"),(typeof a.reconciledAt!="string"||a.reconciledAt.trim().length===0)&&r.push("attestation/reconciledAt"),(typeof a.reconciledByActor!="string"||a.reconciledByActor.trim().length===0)&&r.push("attestation/reconciledByActor"),typeof a.reason!="string"&&r.push("attestation/reason"))}if(t.teamSummary!==void 0&&t.teamSummary!==null){let a=t.teamSummary;if(typeof a!="object"||Array.isArray(a))r.push("teamSummary");else{if(a.schemaId!=="atm.closurePacketTeamSummary.v1"&&r.push("teamSummary/schemaId"),ie(a.capturedAt)||r.push("teamSummary/capturedAt"),ie(a.teamRunId)||r.push("teamSummary/teamRunId"),!a.source||typeof a.source!="object"||Array.isArray(a.source))r.push("teamSummary/source");else{let n=a.source;n.kind!=="team-run"&&r.push("teamSummary/source/kind"),ie(n.teamRunPath)||r.push("teamSummary/source/teamRunPath")}Object.prototype.hasOwnProperty.call(a,"captainDecision")||r.push("teamSummary/captainDecision"),Array.isArray(a.agentReports)||r.push("teamSummary/agentReports"),Array.isArray(a.patrolFindings)||r.push("teamSummary/patrolFindings"),Object.prototype.hasOwnProperty.call(a,"evidenceCuratorSummary")||r.push("teamSummary/evidenceCuratorSummary"),Object.prototype.hasOwnProperty.call(a,"teamSummary")||r.push("teamSummary/teamSummary"),Object.prototype.hasOwnProperty.call(a,"validationPasses")&&o.push({path:"teamSummary/validationPasses",kind:"invalidFormat",formatExpected:"teamSummary must not declare validationPasses; only command-backed closure packet evidence can pass validators.",actualValue:"present"})}}return t.evidenceFreshness!=="fresh"&&r.push("evidenceFreshness"),{ok:r.length===0&&o.length===0,missing:r,invalidFormat:o}}function Pje(e,t,r){let o=Q.join(e,".atm","history","evidence",`${t}.json`),a=D(e,o);if(!wt(o))return{evidencePath:a,changed:!1};let n=eo(o);if(!n)return{evidencePath:a,changed:!1};let s=rm(n),i=`${JSON.stringify(n,null,2)}
57
57
  `,c=`${JSON.stringify(s,null,2)}
58
58
  `;return i!==c?(r.write&&Ts(o,c,"utf8"),{evidencePath:a,changed:!0}):{evidencePath:a,changed:!1}}function Mje(e,t){let r=new Set,o=Q.join(e,".atm","history","tasks",`${t}.json`),a=eo(o);if(!a)return r;let n=c=>{if(typeof c!="string"||c.trim().length===0)return;let l=Wj(e,c);l&&r.add(l)};for(let c of["scopePaths","deliverables","targetAllowedFiles"])if(Array.isArray(a[c]))for(let l of a[c])n(l);let s=a.claim;if(s&&typeof s=="object"&&!Array.isArray(s)&&Array.isArray(s.files))for(let c of s.files)n(c);let i=a.taskDirectionLock;if(i&&typeof i=="object"&&!Array.isArray(i)&&Array.isArray(i.allowedFiles))for(let c of i.allowedFiles)n(c);return r}function Oje(e,t){let r=be(e);if(!r||t.size===0)return!1;for(let o of t)if(r===o||o.endsWith("/**")&&r.startsWith(o.slice(0,-3))||r.startsWith(`${o}/`))return!0;return!1}function Dje(e,t,r){let o=H3(e,t);return o.commandRuns.length===0?rm(r):rm({...r,commandRuns:o.commandRuns,validationPasses:o.validationPasses.length>0?o.validationPasses:r.validationPasses,evidenceFreshness:o.evidenceFreshness})}function Gj(e,t=[]){let r=t.filter(n=>!M3(n)),o=r.some(n=>/^(templates|integrations)\//.test(n)),a=r.some(n=>/^(release|templates\/root-drop|scripts\/build-)/.test(n)||n==="atm.mjs");return qt(e.filter(n=>n==="typecheck"?!0:n.startsWith("validate:")?n==="validate:integration-adapter"||n==="validate:skill-templates"?o:n==="validate:root-drop-release"||n==="validate:onefile-release"?a:!0:!1))}function MT(e){let t=Q.resolve(e.cwd),r=S0e(t,e.changedFiles,e.taskId),o=H3(t,e.taskId),a=qt((e.requiredGates??S3).map(s=>String(s).trim()).filter(Boolean)),n=B3({cwd:t,changedFiles:e.changedFiles??[],frameworkStatus:e.frameworkStatus??null,requiredGates:a});return{schemaId:"atm.closurePacket.v1",specVersion:_T,taskId:e.taskId,targetRepoIdentity:ht(t),targetCommit:r.currentCommitSha,governedTreeSha:r.governedTreeSha,targetCommitDelta:r,closedByCommand:"atm tasks close",commandRuns:o.commandRuns,validationPasses:e.validationPasses?qt(e.validationPasses.map(s=>String(s).trim()).filter(Boolean)):o.validationPasses,evidenceFreshness:e.evidenceFreshness??o.evidenceFreshness,requiredGates:a,requiredGatesSnapshot:n,evidencePath:e.evidencePath,closedAt:new Date().toISOString(),closedByActor:e.actorId,sessionId:ie(e.sessionId)??null,attestation:e.attestation??null,historicalDeliveryProvenance:e.historicalDeliveryProvenance??null,teamSummary:e.teamSummary===void 0?Fje(t,e.taskId):e.teamSummary}}function Fje(e,t){let r=Q.join(e,".atm","runtime","team-runs");if(!wt(r))return null;let a=Hf(r).filter(i=>i.endsWith(".json")).map(i=>{let c=Q.join(r,i),l=eo(c);return l&&String(l.taskId??"").trim()===t?{run:l,absolutePath:c}:null}).filter(i=>!!i).sort((i,c)=>l3(c.run).localeCompare(l3(i.run)))[0];if(!a)return null;let n=a.run,s=b3(n.teamSummary)?n.teamSummary:null;return{schemaId:"atm.closurePacketTeamSummary.v1",capturedAt:new Date().toISOString(),source:{kind:"team-run",teamRunPath:be(D(e,a.absolutePath))},teamRunId:String(n.teamRunId??Q.basename(a.absolutePath,".json")),captainDecision:n.captainDecision??by(n,["teamPlan","captainDecision"])??by(s,["captainDecision"])??null,agentReports:d3(n.agentReports??n.agent_reports??by(s,["agentReports"])),patrolFindings:d3(n.patrolFindings??n.patrol_findings??by(s,["patrolFindings"])),evidenceCuratorSummary:n.evidenceCuratorSummary??n.evidence_curator_summary??by(s,["evidenceCuratorSummary"])??null,teamSummary:s}}function l3(e){return ie(e.updatedAt)??ie(e.createdAt)??""}function b3(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function by(e,t){let r=e;for(let o of t){if(!b3(r))return null;r=r[o]}return r??null}function d3(e){return Array.isArray(e)?e:[]}function OT(e,t,r){let o=Q.join(e,".atm","history","evidence",`${t}.closure-packet.json`);Cy(Q.dirname(o),{recursive:!0});let a=rm(r);return Ts(o,`${JSON.stringify(a,null,2)}
59
59
  `,"utf8"),D(e,o)}function $je(e){let t=0;for(let r of Lje(e))t=Math.max(t,C3(Q.join(e,r)));return t}function Lje(e){let t=T3(e);if(!t)return["packages/cli/src","scripts"];let r=MF(t).filter(o=>!o.startsWith("release/")).map(o=>o.includes("*")?o.slice(0,o.indexOf("*")):o).map(o=>o.replace(/\/$/,"")).filter(o=>o.length>0);return[...new Set(r)]}function Nje(e){let t=Uj(e),r=_i("git",["diff","--name-only"],{cwd:e,encoding:"utf8",maxBuffer:64*1024*1024,env:t}),o=_i("git",["diff","--cached","--name-only"],{cwd:e,encoding:"utf8",maxBuffer:64*1024*1024,env:t}),a=new Set([...String(r.stdout??"").split(/\r?\n/),...String(o.stdout??"").split(/\r?\n/)].map(i=>be(i)).filter(Boolean)),n=_i("git",["ls-files","-s"],{cwd:e,encoding:"utf8",maxBuffer:64*1024*1024,env:t}),s=new Map;if((n.status??1)!==0)return s;for(let i of String(n.stdout??"").split(/\r?\n/)){let c=i.match(/^\d+\s+([0-9a-f]+)\s+\d+\t(.+)$/);if(!c)continue;let l=be(c[2]);if(!a.has(l)||!G0e(e,l).runnerAffecting){let d=a.has(l)?N0e(e,l):c[1];d&&s.set(l,d)}}return s}function Bje(e){let t=Q.join(e,"release","atm-root-drop","release-manifest.json");if(!wt(t))return{present:!1,valid:!1,digest:null};try{let o=JSON.parse(la(t,"utf8")).runnerSourceSeal;if(o?.schemaId!=="atm.runnerSourceSeal.v1"||o.algorithm!=="sha256"||!Array.isArray(o.files)||!/^sha256:[a-f0-9]{64}$/i.test(String(o.digest??"")))return{present:!1,valid:!1,digest:null};let a=o.files.filter(c=>typeof c=="string"&&c.length>0);if(a.length!==o.files.length||a.some(c=>!wt(Q.join(e,c))))return{present:!0,valid:!1,digest:null};let n=Nje(e),s=vje("sha256");for(let c of a){let l=la(Q.join(e,c));s.update(String(Buffer.byteLength(c))).update(":").update(c);let d=n.get(c);d?s.update("git:").update(d):s.update(String(l.byteLength)).update(":").update(l)}let i=`sha256:${s.digest("hex")}`;return{present:!0,valid:i.toLowerCase()===String(o.digest).toLowerCase(),digest:i}}catch{return{present:!1,valid:!1,digest:null}}}function T3(e){let t=Q.join(e,"scripts","AtmCore","runner-build-scope.json");try{return JSON.parse(la(t,"utf8"))}catch{return null}}function C3(e){let t=null;try{t=Lj(e)}catch{return 0}if(t.isFile())return t.mtimeMs;if(!t.isDirectory())return 0;let r=0;for(let o of Hf(e,{withFileTypes:!0}))o.name==="dist"||o.name==="node_modules"||(r=Math.max(r,C3(Q.join(e,o.name))));return r}function qje(e){let t=Q.join(e,"release","atm-onefile","atm.mjs");if(wt(t))return t;let r=Q.join(e,"packages","cli","dist","atm.js");return wt(r)?r:null}function R3(e){let t=process.argv[1]?Q.resolve(process.argv[1]):null;if(!t)return null;let r=Q.relative(Q.resolve(e),t).replace(/\\/g,"/");return r&&!r.startsWith("..")?r:t.replace(/\\/g,"/")}function om(e){return am(e).syncRequired}function am(e){let t=Q.resolve(e),r=R3(t),o=Xc(),a=!r||!jje.has(r),n=qje(t),s=$je(t),i=n?Lj(n).mtimeMs:0,c=Bje(t),l=s>i,d=!a&&!!n&&(c.present?!c.valid:l);return{schemaId:"atm.runnerSourceDrift.v1",entrypoint:r,frozenEntrypoint:!a,runnerPath:n?D(t,n):null,runnerMtime:i>0?new Date(i).toISOString():null,newestSourceMtime:s>0?new Date(s).toISOString():null,sourceSeal:c,syncRequired:d,advisory:d?c.present?"Frozen release runner source seal does not match the packaged framework sources; rebuild the runner release.":"Frozen runner is older than framework source files; live CLI behavior may lag source until the runner is rebuilt.":a?"Current entrypoint is not the frozen runner; source-first/source-import diagnostics may differ from node atm.mjs.":c.valid?"Frozen release runner source seal matches the packaged framework sources.":"Frozen runner is not older than framework source files.",syncCommand:o.runnerSyncCommand}}function Ry(){return`ATM_RUNNER_SYNC_REQUIRED: stable atm.mjs is older than framework source files. Run \`${Xc().runnerSyncCommand}\` before using the frozen runner, or use \`node atm.dev.mjs ...\` for source-first framework validation.`}function DT(e){let t=R3(Q.resolve(e.cwd))?.toLowerCase().replace(/\\/g,"/");if(!(t!=="atm.dev.mjs"&&!t?.endsWith("/atm.dev.mjs")))throw new h("ATM_SOURCE_FIRST_WRITE_REFUSED",`ATM refused ${e.action} through the source-first runner.`,{exitCode:1,details:{action:e.action,sourceFirstOnly:!0,guidance:"Use node atm.dev.mjs only for explicit source-first validation; use node atm.mjs after rebuilding for governed lifecycle mutations.",sourceFirstCommand:"node atm.dev.mjs ...",governedCommand:"node atm.mjs ..."}})}function Gje(e){return e==="tasks-import-write"||e==="tasks-create"||e==="tasks-mirror"||e==="tasks-scope-add"||e==="tasks-scope-repair-deliverables"?"ledger-only":"behavioral"}function da(e){let t=Xc(),r=Gje(e.action);if(!om(e.cwd))return{warning:null,policy:r};if(e.allowStaleRunner||r==="ledger-only")return{warning:Ry(),policy:r};throw new h("ATM_RUNNER_STALE_WRITE_REFUSED",`ATM refused ${e.action} because the frozen runner is older than framework source files.`,{exitCode:1,details:{action:e.action,policy:r,syncCommand:t.runnerSyncCommand,sourceFirstCommand:"node atm.dev.mjs ...",remediation:`Run ${t.runnerSyncCommand} before behavior-dependent write actions through node atm.mjs. Ledger-only writes may continue with a stale-runner warning.`}})}function Hje(e,t){return Q.join(e,".atm-temp",`close-journal-${t}.json`)}async function FT(e){let t=Hje(e.cwd,e.taskId);Cy(Q.dirname(t),{recursive:!0}),Ts(t,`${JSON.stringify({schemaId:"atm.closeJournal.v1",taskId:e.taskId,phase:e.phase,status:"staging",startedAt:new Date().toISOString()},null,2)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-atomic-framework/cli",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "private": false,
5
5
  "description": "CLI entrypoint for AI-Atomic-Framework repository adoption and validation.",
6
6
  "license": "Apache-2.0",