@timurproko/a1 0.1.8-dev.407 → 0.1.8-dev.436

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/bin/cli.js +14 -9
  2. package/bin/guardian.js +3 -3
  3. package/bin/module-identity.js +21 -3
  4. package/bin/pinned-pi-public.d.ts +3 -0
  5. package/bin/pinned-pi-public.js +74 -0
  6. package/bin/ui.js +17 -18
  7. package/bin/warmup.js +8 -10
  8. package/dist/composition/owned-ui.d.ts +5 -3
  9. package/dist/composition/owned-ui.js +17 -10
  10. package/dist/composition/settings-route-host.d.ts +4 -5
  11. package/dist/composition/settings-route-host.js +90 -55
  12. package/dist/features/launch/intent.d.ts +5 -3
  13. package/dist/features/launch/intent.js +2 -2
  14. package/dist/features/launch/profile-paths.js +1 -1
  15. package/dist/features/launch/runtime-selection.d.ts +1 -1
  16. package/dist/features/launch/runtime-selection.js +1 -1
  17. package/dist/features/owned-ui/run.d.ts +6 -0
  18. package/dist/features/owned-ui/run.js +34 -2
  19. package/dist/features/owned-ui/settings-app.d.ts +1 -3
  20. package/dist/features/owned-ui/settings-app.js +2 -2
  21. package/dist/features/owned-ui/settings-route.d.ts +2 -0
  22. package/dist/features/owned-ui/settings-route.js +2 -0
  23. package/dist/foundation/release/update.js +5 -3
  24. package/dist/foundation/startup/startup-descriptor.js +34 -0
  25. package/dist/foundation/startup/startup-runtime.d.ts +10 -0
  26. package/dist/foundation/startup/startup-runtime.js +11 -3
  27. package/dist/foundation/terminal-cleanup/fatal-exit.js +4 -2
  28. package/dist/integrations/pi/components/components.js +1 -1
  29. package/dist/integrations/pi/components/owned-editor-ux.d.ts +1 -1
  30. package/dist/integrations/pi/components/owned-editor-ux.js +6 -2
  31. package/dist/integrations/pi/components/shell-editor-autocomplete.js +2 -2
  32. package/dist/integrations/pi/components/shell-extension-ui.d.ts +1 -1
  33. package/dist/integrations/pi/components/shell-extension-ui.js +1 -1
  34. package/dist/integrations/pi/components/shell-footer-status.js +1 -1
  35. package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
  36. package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +2 -2
  37. package/dist/integrations/pi/components/shell-presenters-transcript.js +2 -2
  38. package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +1 -1
  39. package/dist/integrations/pi/components/shell-selectors-dialogs.js +1 -1
  40. package/dist/integrations/pi/components/shell-shared-facade.d.ts +1 -1
  41. package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +2 -0
  42. package/dist/integrations/pi/components/submitted-prompt-adapter.js +8 -2
  43. package/dist/integrations/pi/components/tool-image-presentation.d.ts +1 -1
  44. package/dist/integrations/pi/components/tool-image-presentation.js +1 -1
  45. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
  46. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  47. package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
  48. package/dist/integrations/pi/components/upstream/components/first-time-setup.js +1 -1
  49. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +1 -1
  50. package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
  51. package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
  52. package/dist/integrations/pi/components/upstream/components/tool-execution.js +1 -1
  53. package/dist/integrations/pi/components/upstream/components/tree-selector.js +1 -1
  54. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  55. package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
  56. package/dist/integrations/pi/engine/adapter.d.ts +1 -1
  57. package/dist/integrations/pi/engine/adapter.js +1 -1
  58. package/dist/integrations/pi/engine/model-auth-integration.d.ts +1 -1
  59. package/dist/integrations/pi/engine/package-integration.js +1 -1
  60. package/dist/integrations/pi/engine/project-trust-preflight.js +1 -1
  61. package/dist/integrations/pi/engine/resource-extension-integration.d.ts +1 -1
  62. package/dist/integrations/pi/engine/runtime-integration.d.ts +1 -1
  63. package/dist/integrations/pi/engine/runtime-integration.js +2 -2
  64. package/dist/integrations/pi/engine/session-integration.d.ts +1 -1
  65. package/dist/integrations/pi/engine/session-selection.d.ts +1 -1
  66. package/dist/integrations/pi/engine/session-selection.js +1 -1
  67. package/dist/integrations/pi/engine/settings-integration.d.ts +1 -1
  68. package/dist/integrations/pi/engine/windows-filesystem-hygiene.d.ts +1 -1
  69. package/dist/integrations/pi/engine/windows-filesystem-hygiene.js +1 -1
  70. package/dist/integrations/pi/session-ui/clipboard-diagnostics.d.ts +1 -1
  71. package/dist/integrations/pi/session-ui/clipboard-diagnostics.js +1 -1
  72. package/dist/integrations/pi/session-ui/paste-executor.d.ts +1 -1
  73. package/dist/integrations/pi/session-ui/paste-executor.js +1 -1
  74. package/dist/integrations/pi/session-ui/paste-protocol.d.ts +1 -1
  75. package/dist/integrations/pi/session-ui/prompt-chips.d.ts +1 -1
  76. package/dist/integrations/pi/session-ui/prompt-chips.js +1 -1
  77. package/dist/integrations/pi/session-ui/response-copy-coordinator.d.ts +1 -1
  78. package/dist/integrations/pi/session-ui/response-copy-coordinator.js +1 -1
  79. package/dist/integrations/pi/session-ui/response-copy-transport.d.ts +1 -1
  80. package/dist/integrations/pi/session-ui/session-shell-root.d.ts +8 -6
  81. package/dist/integrations/pi/session-ui/session-shell-root.js +31 -10
  82. package/dist/integrations/pi/session-ui/session-shell.d.ts +6 -3
  83. package/dist/integrations/pi/session-ui/session-shell.js +54 -11
  84. package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +8 -3
  85. package/dist/integrations/pi/session-ui/session-viewport-controller.js +33 -5
  86. package/dist/integrations/pi/session-ui/system-clipboard.d.ts +1 -1
  87. package/dist/integrations/pi/session-ui/system-clipboard.js +7 -4
  88. package/dist/integrations/pi/startup-public.d.ts +2 -0
  89. package/dist/integrations/pi/startup-public.js +2128 -0
  90. package/dist/integrations/pi/startup-public.manifest.json +11696 -0
  91. package/dist/integrations/pi/tui-runtime/adapter.js +1 -1
  92. package/dist/native/darwin-arm64/manifest.json +1 -1
  93. package/dist/native/linux-x64/manifest.json +1 -1
  94. package/dist/native/win32-x64/manifest.json +2 -2
  95. package/dist/native/win32-x64/process-guardian.exe +0 -0
  96. package/dist/runtime-payload-inventory.json +4 -1
  97. package/docs/architecture/response-copy-delivery.md +3 -1
  98. package/docs/ci-release-runbook.md +20 -7
  99. package/docs/local-worktree-cleanup.md +30 -12
  100. package/docs/openspec-archive-automation.md +191 -73
  101. package/docs/validation.md +62 -0
  102. package/package.json +4 -2
@@ -1,7 +1,7 @@
1
1
  import { HStack, ProcessTerminal, ScrollView, TuiAltScreen, TuiMainScreen, VStack, visibleWidth, } from "#pi-tui";
2
2
  import { MouseReportInput } from "./mouse-report-input.js";
3
3
  import { GeometryObservedAltScreen, OverlayGeometryTracker } from "./overlay-geometry.js";
4
- import { boundedCleanup, EMERGENCY_TERMINAL_RESET } from "../../../foundation/terminal-cleanup/index.js";
4
+ import { boundedCleanup, EMERGENCY_TERMINAL_RESET } from "../../../foundation/terminal-cleanup/terminal-reset.js";
5
5
  import { InputPresentationCoordinator, } from "./input-presentation-coordinator.js";
6
6
  /** Identifies the Pi TUI lifecycle stage that failed while preserving the original cause. */
7
7
  export class PiTuiRuntimeError extends Error {
@@ -5,7 +5,7 @@
5
5
  "platform": "darwin",
6
6
  "architecture": "arm64",
7
7
  "capability": "supported",
8
- "builtAt": "2026-09-15T08:46:47.594Z",
8
+ "builtAt": "2026-09-16T16:00:56.139Z",
9
9
  "artifact": {
10
10
  "filename": "process-guardian",
11
11
  "sha256": "9db1726bbe3fc2e8292f2ead1e7e9d0fd4d7d0dc9217b372582bf354b0f565dc",
@@ -5,7 +5,7 @@
5
5
  "platform": "linux",
6
6
  "architecture": "x64",
7
7
  "capability": "supported",
8
- "builtAt": "2026-09-15T08:46:40.389Z",
8
+ "builtAt": "2026-09-16T16:00:53.100Z",
9
9
  "artifact": {
10
10
  "filename": "process-guardian",
11
11
  "sha256": "d8cda6b0c7cb36c0cc41e90802aceebf6c02eaebbc08a83d7d963d2e918dbd7a",
@@ -5,10 +5,10 @@
5
5
  "platform": "win32",
6
6
  "architecture": "x64",
7
7
  "capability": "supported",
8
- "builtAt": "2026-09-15T08:47:16.137Z",
8
+ "builtAt": "2026-09-16T16:01:51.175Z",
9
9
  "artifact": {
10
10
  "filename": "process-guardian.exe",
11
- "sha256": "3693ca18bc9008f730b7816c1a7854c24fc343511e1fd9f761a20afbfd6c9cfb",
11
+ "sha256": "6a50d218059b28154f0a1727b80e670fa478ef3f25b6e2f5780f60addfe83fc7",
12
12
  "size": 177664
13
13
  },
14
14
  "provenance": {
@@ -6,9 +6,12 @@
6
6
  "bin/supervisor.js",
7
7
  "bin/ui.js",
8
8
  "bin/update-recovery.js",
9
- "bin/warmup.js"
9
+ "bin/warmup.js",
10
+ "dist/foundation/startup/startup-descriptor.js",
11
+ "dist/integrations/pi/startup-public.js"
10
12
  ],
11
13
  "declaredAssets": [
14
+ "dist/integrations/pi/startup-public.manifest.json",
12
15
  "node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.css",
13
16
  "node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.html",
14
17
  "node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/assets/clankolas.png",
@@ -29,7 +29,9 @@ A generated probe on Windows Node 24.16.0 copied the same eight-character range
29
29
 
30
30
  Set `A1_CLIPBOARD_DIAGNOSTICS` to an existing-parent local file path to capture metadata in bare A1. It is disabled by default and ignored by comparison/settings-free compositions. Records include copy/paste phases, runtime receipt/composition/write phases, and a 100 ms heartbeat. At most 128 scalar-only rows and one newest pending asynchronous disk snapshot are retained. No copied/pasted text, paths, image data, encoded payloads, raw errors, or extra fields from event objects are serialized. Disk errors remain silent and disk completion is never awaited by input or teardown.
31
31
 
32
- Diagnostic accounting includes the transient incoming copy before its older pending predecessor is superseded (eight pastes plus three transient copy records). Paste-helper exit no longer prematurely clears insertion accounting: request cleanup is recorded after the insertion lifetime. Literal workflow copies do not invent transcript selection-clear events. Composition tests verify explicit/environment opt-in, comparison/settings-free exclusion, destination precedence, and disposal even when construction or shell teardown fails. Request identifiers are local to their source; runtime identifiers are input revisions and negative framing identifiers identify terminal input observations. `pendingBytes` is observed payload/source accounting, not native heap measurement.
32
+ First-use keyboard routing emits `shortcut-received`, `shortcut-matched`, and `shortcut-admitted` under one negative request identifier. A standard Ctrl+V record with only `shortcut-received` identifies a key that reached the custom viewport but did not match; all three together with a positive `admitted`/`acquiring` request identify successful synchronous reservation and asynchronous acquisition. Editor right-click emits `pointer-admitted`; terminal-owned bracketed input emits `framing` plus truthful inline `inserting`/`settled` phases, or the positive isolated-preparation phases, without keyboard or native-acquisition routing. This lets an exact-candidate run identify the route and last completed boundary without capturing the clipboard value.
33
+
34
+ Diagnostic accounting includes the transient incoming copy before its older pending predecessor is superseded (eight pastes plus three transient copy records). Paste-helper exit no longer prematurely clears insertion accounting: request cleanup is recorded after the insertion lifetime. Literal workflow copies do not invent transcript selection-clear events. Composition tests verify explicit/environment opt-in, comparison/settings-free exclusion, destination precedence, and disposal even when construction or shell teardown fails. Request identifiers are local to their source; runtime identifiers are input revisions, while negative identifiers cover first-use routing and terminal framing observations. `pendingBytes` is observed payload/source accounting, not native heap measurement.
33
35
 
34
36
  A healthy heartbeat with stalled visible painting differs from a blocked application event loop. These diagnostics support attribution but do not themselves establish the user's physical-terminal root cause. The baseline's main-thread path classifier and write/paste barriers are investigated independently of OSC 52.
35
37
 
@@ -46,7 +46,7 @@ effect of stable publication, not a trigger.
46
46
 
47
47
  | Trigger | Validation and outcome |
48
48
  | --- | --- |
49
- | Pull request into `develop` | Modular fast validation; changed/new source documentation is checked once, and rendering runs as `none`, `smoke`, or `full` from the exact impact |
49
+ | Pull request into `develop` | Bounded PR-cadence validation; changed/new source documentation is checked once, rendering runs as `none`, `smoke`, or `full`, and exhaustive owners are reported as deferred |
50
50
  | `npm run develop` | Preview package gates on Windows, Linux, and macOS; an existing numbered preview is an early successful no-op |
51
51
  | Nightly at `03:17 UTC` | One full documentation review plus the complete non-physical suite on Windows, Linux, and macOS, every night |
52
52
  | `npm run release -- ...` | Complete exact-byte stable gates, then npm `latest`, tag, GitHub Release, and `master` |
@@ -58,6 +58,12 @@ effect of stable publication, not a trigger.
58
58
 
59
59
  Ordinary type, architecture, unit/contract, and dist checks always run for code changes. Changed-file documentation and rendering run as independent parallel jobs. Rendered shell/component changes select `smoke`; viewport, scheduler, terminal adapter, evidence harness, package identity, and selector changes select `full`; unrelated changes select `none`. The aggregate accepts a skipped modular job only when the current selector requested the skip.
60
60
 
61
+ Integration owners declare one cadence in `config/integration-owners.json`. Impact mode selects affected `pull-request` owners; an invalidator, unknown operational path, or manual Development dispatch selects every `pull-request` owner. `exhaustive` owners are never silently skipped or reported as passed: impact and aggregate evidence list them as cadence-deferred, and malformed cadence blocks selection. Full regression and nightly/stable release still execute both cadence classes.
62
+
63
+ The real three-release `update-predecessor` scenario is exhaustive because four fresh npm installations dominated recent PR critical paths. PR validation retains deterministic predecessor command, lifecycle, fault, fixture, materialization, warmup, package, and update contracts. This permits a real published-history incompatibility to reach `develop` before nightly detects it; nightly failure still blocks publication. For a high-risk release/update change, explicitly dispatch `.github/workflows/full-regression.yml` before merge instead of adding the exhaustive owner back to ordinary Development.
64
+
65
+ Development outcomes report each owner/scope invocation separately while sharing authenticated build/package preparation. The aggregate reports setup, scope, job, aggregate-processing, total runner, and runner-critical-path durations. The acceptance targets are at most eight minutes of runner critical path and five minutes for one PR-required scope; an over-target result remains unmet without retries, timeout increases, workload reduction, or mutable installation caches. Hosted queue time is reported separately when available and is not counted as test execution.
66
+
61
67
  Inspect local committed and worktree impact without running tests:
62
68
 
63
69
  ```sh
@@ -80,7 +86,7 @@ Rendering evidence captures each selected producer/mode/workload matrix once and
80
86
 
81
87
  ## Resource-sensitive fast validation
82
88
 
83
- The authoritative fast-tier declaration identifies tests that repeatedly create temporary repositories, launch child processes, mutate storage, or coordinate release cohorts. The planner removes those files from the parallel remainder and runs them exactly once as `vitest-fast-resource-sensitive` with file parallelism disabled. Pull-request, development-package, and complete release plans use the same partition on every platform.
89
+ The authoritative fast-tier declaration identifies tests that repeatedly create temporary repositories, launch child processes, mutate storage, or coordinate release cohorts. The planner removes those files from the parallel remainder and runs each exactly once in its own `vitest-fast-resource-sensitive-*` process with file parallelism disabled. Per-file process isolation prevents one resource-heavy file from consuming another file's unchanged five-second test budget; no timeout override or retry is added. Pull-request, development-package, and complete release plans use the same partition on every platform.
84
90
 
85
91
  The partition retains Vitest's five-second default test timeout. It does not add a test, suite, platform, or workflow timeout, and a failure is not retried or converted to success. If a serialized test still approaches five seconds, use `scripts/release/report-resource-sensitive-validation.mjs` to record repeated per-file and test-body timing, then optimize repository setup, subprocess count, storage operations, or release fixtures. Do not increase a timeout to create margin.
86
92
 
@@ -107,7 +113,7 @@ node scripts/release/report-resource-sensitive-validation.mjs --repeats 3 --outp
107
113
 
108
114
  Each selected startup lane runs the package-install scenarios once: a failed budget remains failed and is never retried to obtain a warmed result. Both post-update profiles must reach input-ready state within five seconds, and both warm profiles must remain within three seconds. Node 24 runtime support, other PR jobs, Defender, and publication gates are unchanged. Full validation retains every deferred startup, image, and history test through its existing suite owners.
109
115
 
110
- The trade-off is delayed detection: a Node-24-specific regression can reach `develop` before nightly catches it. A green Node 22 PR check does not certify Node 24, and nightly failure still blocks its publication. When Node 24 feedback is needed before nightly, explicitly request the non-publishing Full regression workflow for the desired branch or tag:
116
+ The trade-off is delayed detection: a Node-24-specific regression can reach `develop` before nightly catches it, and the same is true for a real published-predecessor regression. A green bounded PR check does not certify Node 24 or real historical predecessor execution, and nightly failure still blocks its publication. When deferred feedback is needed before nightly, explicitly request the non-publishing Full regression workflow for the desired branch or tag:
111
117
 
112
118
  ```sh
113
119
  gh workflow run full-regression.yml --ref <branch-or-tag>
@@ -132,10 +138,16 @@ or auto-merge is manually enabled; if any path is outside the allowlist, it disa
132
138
  auto-merge while leaving the pull request available for a later manual merge. Every
133
139
  docs-only change runs lightweight generated-governance consistency, so archiving an
134
140
  inventoried OpenSpec occurrence fails that pull request rather than a later code pull
135
- request. A legitimate generated baseline update remains outside the allowlist and
136
- follows the manually accepted mixed/code path.
141
+ request. The only narrower route is an exact single added canonical
142
+ `openspec/acceptance/<change>/<source-head>.json` record: trusted base policy reads the
143
+ complete live diff before dependency installation, then the dedicated acceptance job
144
+ must validate its exact source, CI, scope, branch, body, checklist, and conflict state.
145
+ Only that verified route skips generic impact installation and documentation/all-spec
146
+ validation; malformed, mixed, renamed, stale, or unavailable inputs fail closed.
147
+ A legitimate generated baseline update remains outside the allowlist and follows the
148
+ manually accepted mixed/code path.
137
149
 
138
- A new implementation-bound specification starts as OpenSpec-only artifacts in one draft PR. Explicit approval to implement continues in that same worktree, branch, history, and PR; the plan does not merge first. Approved refinements reconcile the planning artifacts before code changes. Make the completed PR ready for final review, but leave integration manual after CI, exact-head maintainer acceptance, and explicit merge authorization. Closing a rejected unmerged draft integrates and archives nothing; local unmerged cleanup still needs separate approval. Existing merged plans retain their legacy implementation PRs and require explicit reconciliation if rejected. See [delivery and archive handoff](openspec-archive-automation.md) for the version-2 link and legacy version-1 compatibility.
150
+ A new implementation-bound specification starts as OpenSpec-only artifacts in one normally named draft PR. Explicit approval to implement continues in that same worktree, branch, history, and PR; the plan does not merge first. Approved refinements reconcile planning before code. After implementation, the same branch conservatively synchronizes deltas and stages the dated archive plus conditional acceptance manifest. Add one to three plain implementation-specific bullets under `## Acceptance`, mark the finalized PR ready, and require exact-head CI. Auto-merge remains disabled: an authorized maintainer's manual merge accepts the listed scenarios and atomically integrates implementation, specs, and archive. No acceptance or archive follow-up PR is created. Closing an unmerged draft integrates nothing; cleanup still needs separate approval. See [delivery and archive handoff](openspec-archive-automation.md) for commands and legacy compatibility.
139
151
 
140
152
  ## Numbered development previews
141
153
 
@@ -227,7 +239,8 @@ Rules that do not bend:
227
239
 
228
240
  ## When something fails
229
241
 
230
- - **PR validation fails:** fix the code and push; do not mark a failed tier optional.
242
+ - **PR validation fails:** fix the code and push; do not mark a failed PR-cadence tier optional. If real predecessor history is needed, run Full regression rather than changing the exhaustive result into PR success.
243
+ - **Nightly exhaustive predecessor validation fails:** treat the focused PR result as insufficient, keep publication blocked, and repair the incompatibility without reducing predecessor count, timeouts, or exact-package isolation.
231
244
  - **Documentation auto-merge fails:** leave the pull request open, inspect its exact
232
245
  changed-file classification, docs-sensitive inventory, and workflow permissions,
233
246
  and never broaden the allowlist to make one pull request pass.
@@ -1,9 +1,27 @@
1
- # Local worktree cleanup after automatic archival
1
+ # Local worktree cleanup after verified delivery
2
2
 
3
- Local cleanup completes the delivery order in [the archive runbook](openspec-archive-automation.md): implementation merge, verified manual acceptance-record **merge**, automatic OpenSpec archive **merge**, remote topic-ref deletion, then safe local cleanup. GitHub Actions never reaches into a developer machine. This command neither publishes archives nor merges PRs or deletes remote refs.
3
+ Local cleanup completes the delivery order in [the archive runbook](openspec-archive-automation.md). For version 3 that is one authorized manual implementation/acceptance/archive merge, read-only verification, remote topic-ref deletion, then safe local cleanup. Legacy versions still require their applicable acceptance-record and automatic archive merges. GitHub Actions never reaches into a developer machine. This command neither publishes archives nor merges PRs or deletes remote refs.
4
4
 
5
5
  The implementation is repository tooling, not part of the installed A1 product. It requires Node, Git, and GitHub read access. No product build, dependency installation, interactive UI, or OS-service provisioning is needed. It supports this repository's `origin` on github.com, via HTTPS or SSH.
6
6
 
7
+ ## Standard completed-delivery command
8
+
9
+ After authorized merge, accepted/archive verification, and remote topic-ref removal, the owning agent runs one command from the primary checkout:
10
+
11
+ ```bash
12
+ node scripts/governance/local-worktree-cleanup.mjs complete \
13
+ --repo D:/Git/a1 \
14
+ --path D:/Git/a1/.worktrees/example-task \
15
+ --change example-change \
16
+ --pr 123
17
+ ```
18
+
19
+ `complete` is explicit cleanup authorization for that exact candidate. It creates and releases an exact registration when needed, applies the repository-owned generated-path policy, verifies live merge/archive/CI/ref evidence, evaluates only that candidate, uses journaled non-force Git removal, deletes only the unchanged local topic ref, and leaves persistent watcher authority unchanged. Repeating it reports the completed candidate as already absent. Existing conflicting ownership, identity drift, unavailable evidence, or unknown content remains blocking.
20
+
21
+ The central disposable policy is `node_modules`, `dist`, `.builds`, `.artifacts/openspec-archive`, and `.artifacts/validation`. The last root contains repository-generated validation selection and result reports. Each encountered path must be ignored and stay inside the exact worktree with no link, special file, or nested repository boundary. Authority is component-exact: `.artifacts`, sibling directories such as `.artifacts/other`, and near matches such as `.artifacts/validation-user` remain blocking. Tracked/staged/unstaged/untracked content and every unknown ignored path still block. A tracked regular `.gitmodules` file alone is ordinary content; actual nested `.git` metadata, gitlinks, configured submodules, and submodule changes block. Ordinary content and these approved generated roots are traversed under separate finite entry allowances, so a normal dependency installation does not consume the ordinary source-tree allowance; both allowances retain the same deadline and content-boundary checks.
22
+
23
+ Agents do not manually remove generated content, call `git worktree remove`, or delete the local branch after delivery. The JSON result is authoritative: report success only for `removed` or verified `already-absent`; otherwise retain the worktree and report the exact blocker. Legacy roles can supply separate `--source-pr`, `--candidate-pr`, and `--role` values.
24
+
7
25
  ## Preview first
8
26
 
9
27
  From a checkout containing the reviewed tooling:
@@ -17,9 +35,9 @@ node scripts/governance/local-worktree-cleanup.mjs status --repo D:/Git/a1
17
35
 
18
36
  Remote reads use `GH_TOKEN`/`GITHUB_TOKEN`, otherwise existing `gh auth token --hostname github.com` authentication. Do not put tokens in command arguments, source files, reports, or PR comments. Missing/expired private-repository authentication blocks evidence checks.
19
37
 
20
- ## Explicit local enablement
38
+ ## Explicit queue/watch enablement
21
39
 
22
- Only after the maintainer authorizes activation, use the reviewed tool in the primary/stable checkout outside `.worktrees/`:
40
+ The exact-candidate `complete` command does not enable or scan the persistent queue. Only after the maintainer separately authorizes queue/watch activation, use the reviewed tool in the primary/stable checkout outside `.worktrees/`:
23
41
 
24
42
  ```bash
25
43
  node scripts/governance/local-worktree-cleanup.mjs enable --repo D:/Git/a1
@@ -34,7 +52,7 @@ For eventual cleanup after asynchronous archive integration, run watch mode in a
34
52
  node scripts/governance/local-worktree-cleanup.mjs watch --repo D:/Git/a1
35
53
  ```
36
54
 
37
- It runs one immediate pass and retries at five-minute intervals, with rate-limit backoff and no overlapping mutations. Each pass is bounded to 100 registration evaluations, 500 remote requests, and 60 seconds; individual subprocess/remote calls have a 10-second deadline. Local content traversal is additionally bounded to 20,000 entries; insufficient inspection never grants deletion authority. Reports identify incomplete coverage. A durable round-robin cursor lets later pending candidates run on subsequent passes.
55
+ It runs one immediate pass and retries at five-minute intervals, with rate-limit backoff and no overlapping mutations. Each pass is bounded to 100 registration evaluations, 500 remote requests, and 60 seconds; individual subprocess/remote calls have a 10-second deadline. Local content traversal is additionally bounded to 20,000 ordinary entries plus 100,000 entries beneath exact approved generated roots; exhausting either allowance never grants deletion authority. Reports identify incomplete coverage. A durable round-robin cursor lets later pending candidates run on subsequent passes.
38
56
 
39
57
  When the process is stopped or the machine is offline, GitHub cannot remove local folders. The next enabled invocation rechecks the queue and live evidence. No implicit service, scheduled task, or A1/Pi startup hook is installed.
40
58
 
@@ -54,13 +72,13 @@ node scripts/governance/local-worktree-cleanup.mjs register --repo D:/Git/a1 --p
54
72
 
55
73
  Registration binds the repository, exact directory/filesystem identity, candidate PR, HEAD/ref, role, and generation. It returns an ID and generation, not the owner token. The worktree stays `owned`: registration alone never authorizes removal. Supported roles:
56
74
 
57
- - `implementation`: exact merged implementation PR head; candidate PR equals source PR.
58
- - `acceptance`: exact verified implementation merge commit; candidate PR equals source PR.
59
- - `archive`: exact merged generated archive PR head; candidate PR is the archive PR and source PR is the implementation PR.
75
+ - `implementation`: exact merged implementation PR head; candidate PR equals source PR. This is the only version-3 role because the same PR contains implementation, acceptance manifest, synchronized specs, and archive.
76
+ - `acceptance`: legacy exact verified implementation merge commit; candidate PR equals source PR.
77
+ - `archive`: legacy exact merged generated archive PR head; candidate PR is the archive PR and source PR is the implementation PR.
60
78
 
61
- A CI/base/older-ancestor checkout does not qualify automatically. No local archive checkout is required when the archive was generated entirely on GitHub. Legacy version-1 implementation linkage remains supported, but individually reviewing and registering a legacy checkout is explicit adoption, not a bulk sweep.
79
+ A CI/base/older-ancestor checkout does not qualify automatically. Version 3 has no local acceptance/archive checkout to register. No local archive checkout is required when a legacy archive was generated entirely on GitHub. Legacy version-1/version-2 linkage remains supported, but individually reviewing and registering a legacy checkout is explicit adoption, not a bulk sweep.
62
80
 
63
- The disposable ignored-path allowlist defaults to **empty**. Only append flags such as `--disposable node_modules --disposable dist` when those exact generated directories may be discarded. This is not permission to discard tracked, staged, or untracked changes. Unknown ignored data, nested repositories/submodules, links, and special files remain blockers. Declaring a generated directory does not bypass safety or traversal bounds.
81
+ Low-level `register` keeps an explicit disposable allowlist for legacy and diagnostic use. The standard `complete` command supplies the central repository policy automatically; agents do not choose flags for normal completed-delivery cleanup. Neither route permits discarding tracked, staged, unstaged, untracked, unknown ignored, linked, special, or actual nested repository/submodule content. Declaring or centrally recognizing a generated directory does not bypass ignored-path, identity, type, or traversal checks.
64
82
 
65
83
  Before handing a completed checkout to cleanup, stop its development processes, leave its directory, and release it using the returned ID and current generation:
66
84
 
@@ -68,9 +86,9 @@ Before handing a completed checkout to cleanup, stop its development processes,
68
86
  node scripts/governance/local-worktree-cleanup.mjs release --repo D:/Git/a1 --id REGISTRATION_ID --generation CURRENT_GENERATION
69
87
  ```
70
88
 
71
- Release verifies ownership and the original directory, records the owner's current final HEAD/ref, and returns a new generation. It does not declare acceptance or archival. The worker still verifies the actual merged implementation, exact legacy-comment or human-manually-merged acceptance receipt, automatic archive markers/merge/CI, current `develop` archive contents, and live absence of implementation, acceptance, and archive topic refs. An acceptance merge alone remains ineligible. A bot/automatic/merge-queue acceptance, stale record, missing acceptance-head CI, or unmatched archived receipt blocks cleanup. It will not remove an open or closed-unmerged PR's worktree.
89
+ Release verifies ownership and the original directory, records the owner's current final HEAD/ref, and returns a new generation. It does not declare acceptance or archival. For version 3 the worker verifies the exact authorized human manual source merge, required CI, conditional manifest, synchronized specs/archive on current `develop`, and absence of the source topic ref. For legacy versions it still verifies the exact comment or human-manually-merged acceptance receipt, generated archive marker/merge/CI, archive contents, and all applicable topic refs. A bot/automatic/merge-queue acceptance, stale record, missing required CI, unmatched archive, or open/closed-unmerged PR blocks cleanup.
72
90
 
73
- After release, request a pass from the stable checkout if cleanup is enabled. A running watcher will also pick it up. Never release another session's worktree or use a clean status/dead PID as a substitute for ownership.
91
+ After a low-level release, request a pass from the stable checkout if queue cleanup is enabled. A running watcher will also pick it up. Normal completed delivery instead uses `complete`. Never release another session's worktree or use a clean status/dead PID as a substitute for ownership.
74
92
 
75
93
  ## Resume or recover ownership
76
94