@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,128 +1,246 @@
1
- # Automatic OpenSpec archival
1
+ # Atomic OpenSpec delivery and legacy archival
2
2
 
3
- The archive workflow handles merged OpenSpec implementations, visible acceptance review, a daily 90-day catch-up, and targeted retries. When acceptance is missing, it creates or reuses `Accept: <change> implementation #<number>`; only an authorized maintainer's verified manual merge of that exact record grants PR-backed acceptance. It then creates an OpenSpec-only archive PR, which existing documentation automation squash-integrates after real current-head CI. An open acceptance or archive PR is not completed acceptance or archival.
3
+ New OpenSpec deliveries use one ordinary development pull request from draft planning through implementation, validation, acceptance, specification synchronization, and archival. The only integration action is an authorized maintainer's manual merge. Automation never auto-merges implementation-bound work and never creates a version-3 acceptance or archive follow-up PR.
4
4
 
5
- Documentation CI installs only the pinned OpenSpec archive tool into runner temporary storage, not the repository dependency tree. Candidate validation selects that installation with `--tool-root`; the override is unavailable to publication and audit modes. The documentation job has read-only contents, PR, and Actions permissions; the existing merge owner also declares Actions read access for checking source validation.
5
+ Unrelated standalone documentation remains separate: a non-draft unassociated PR changing only `openspec/**`, `docs/**`, and/or root `README.md` retains the existing CI-gated automatic route. A new active change, implementation association, malformed lifecycle data, or mixed path keeps the manual hold.
6
6
 
7
- ## One PR: specs, implementation, CI, validation, merge, archive, cleanup
7
+ Version-1 and version-2 deliveries and their existing comments, acceptance PRs, archive PRs, receipts, retries, and bounded catch-up remain supported under [Legacy delivery](#legacy-delivery). Do not silently convert an in-flight legacy delivery.
8
8
 
9
- A new implementation-bound change starts as OpenSpec-only artifacts in one draft PR, not a plan merged ahead of its implementation. Planning requests authorize no code. The agent prepares the link below while opening that draft. After explicit plan approval and an implementation request, continue in the same worktree, branch, history, and PR; reconcile approved planning refinements before their code edits and include related product documentation there too.
9
+ ## Version-3 lifecycle
10
10
 
11
- Use this delivery sequence:
11
+ 1. **Draft plan:** create one normally named branch/PR such as `feature/...`, `fix/...`, or `chore/...`. Start the body with `## Proposal`, use it for one or two sentences of intent, follow it with `## Implementation` for the concrete planned work, omit quoted phase lines and routine validation command lists, and keep machine linkage under final collapsed `Automation`. Keep it draft and include only planning artifacts until the maintainer approves the plan and explicitly requests implementation.
12
+ 2. **Same-PR implementation:** continue after explicit approval in the same worktree, branch, history, draft PR, and phase-free body. Reconcile approved refinements in proposal, design, deltas, and tasks before corresponding code edits.
13
+ 3. **Complete evidence:** finish implementation, required tests/evidence, substantive tasks, and explicit known-gap disposition. CI success is objective evidence, not acceptance.
14
+ 4. **Plain acceptance list:** keep the body phase-free and add final `## Acceptance` with one to three concise implementation-specific behavior-and-result bullets. Do not use checkboxes, generic review/CI/approval/archive statements, URLs, mentions, or automated-test inventory.
15
+ 5. **In-branch finalization:** reconcile current `origin/develop`, conservatively synchronize all deltas, move the active change into its dated archive, and stage the conditional acceptance manifest in the same branch.
16
+ 6. **Ready and validate:** mark the finalized PR ready without changing its body lifecycle marker because none exists. One normal exact-head workflow validates the implementation, synchronized specs, archive, manifest, tasks/evidence, exact PR-body list, and every selected product/governance scope before emitting the stable protected aggregate. A new commit, acceptance-list change, or advanced target requires full renewed validation; no lifecycle body edit or second workflow run is required.
17
+ 7. **Manual merge accepts:** after the stable protected aggregate succeeds, an authorized human reviews and manually merges the exact validated head. That single action means the listed scenarios are accepted and explicitly authorizes integration. Auto-merge, merge queue, Apps, bots, and documentation reconciliation are forbidden.
18
+ 8. **Verify and clean:** trusted post-merge policy derives `Archived` and reports `accepted-and-archived` from committed bytes and immutable GitHub provenance without editing the accepted PR body. It publishes no lifecycle branch or PR. Shared exact-head remote cleanup may delete the unchanged topic ref; local cleanup remains separately ownership-controlled.
12
19
 
13
- 1. **Specs:** prepare and approve the plan in the draft PR. Planning does not authorize implementation by itself.
14
- 2. **Implementation:** after explicit approval/request, implement in that same worktree, branch, history, and PR. Keep it draft while implementation is unfinished.
15
- 3. **CI:** push the completed candidate and mark the PR **ready for review before running required CI**. Normal `ready_for_review`/`synchronize` events provide PR-visible test progress. Do not manually dispatch ordinary CI merely to keep the completed candidate draft and then run it again on readiness. Dedicated Full regression/native workflows remain separate required evidence where applicable.
16
- 4. **Implementation review:** after applicable CI passes, obtain actual maintainer validation of the exact final head. Readiness, plan approval, and green CI are not acceptance or merge authorization. A changed candidate requires current-head CI and renewed review.
17
- 5. **Implementation merge:** merge manually only after explicit authorization; implementation auto-merge stays disabled. This integrates code but does not invent post-merge archival acceptance.
18
- 6. **Visible acceptance:** trusted automation creates or reuses one acceptance PR from exact source and CI evidence. Pending substantive tasks and unknown outcomes keep it draft/blocked. Reconcile only evidence-backed stale bookkeeping in that same PR. After its current-head CI passes, an authorized maintainer manually merges it; auto-merge is always forbidden. That merge records archival acceptance without a JSON comment or acceptance-of-acceptance PR.
19
- 7. **Docs/specs auto-merge:** the verified acceptance merge resumes conservative synchronization and prepares the OpenSpec-only archive PR. Documentation automation merges that follow-up after its own required CI. Do not separately merge specs/docs or archive before implementation and acceptance integration.
20
- 8. **Cleanup:** verify implementation, acceptance, and archive integration before removing retained local task/acceptance worktrees. Preserve ownership, clean-tree, and closed/unmerged safety checks. The owning agent performs eligible local cleanup or explicitly releases a registered checkout to the opt-in [local cleanup worker](local-worktree-cleanup.md); no always-running service is provisioned automatically. Hosted remote-branch cleanup remains independently gated on the corresponding PR's verified merge.
20
+ The implementation, synchronized canonical specs, conditional acceptance record, and archive therefore reach `develop` atomically. Closing the PR unmerged integrates none of them.
21
21
 
22
- When a PR check fails, repair routine failures in its existing worktree, branch, and PR and repush; a separate proposal or PR is not required solely for the repair, including a narrowly scoped inherited failure. Preserve the tested behavior, assertions, coverage, and required checks, record the cause and validation, and obtain fresh current-head CI and renewed implementation review; post-merge acceptance remains separately recorded. Substantive new scope still requires clarification. Reclaim a registered released checkout before resuming work; a repair grants no live cleanup or merge authority.
22
+ ## Draft PR body
23
23
 
24
- The implementation, acceptance, and archive PRs each need their own CI because they carry different decisions and bytes. The redundant draft-dispatch-then-ready implementation run is what this sequence avoids. The documentation merge owner holds implementation-associated PRs, new active changes, and acceptance records/branches even if marked ready or their editable marker is removed. PR body edits trigger reconciliation and disable an excluded armed merge. Ordinary docs, standalone revisions to existing merged plans, and verified archive moves remain automatic under the exact path allowlist.
24
+ The first screen should separate purpose from delivery detail, not foreground CI mechanics. Distill `Proposal` into one or two sentences answering why the PR exists, then put two to five concrete points under `Implementation` answering what it will deliver:
25
25
 
26
- ## Normal implementation handoff
26
+ ```markdown
27
+ ## Proposal
28
+
29
+ Replace the multi-PR OpenSpec handoff with one manually merged development PR while preserving standalone documentation automation.
30
+
31
+ ## Implementation
32
+
33
+ - Keep planning and implementation in the same draft PR.
34
+ - Integrate implementation, synchronized specs, acceptance, and archive atomically.
35
+ - Preserve standalone documentation auto-merge while forbidding implementation auto-merge.
36
+
37
+ ## Automation
38
+
39
+ <details>
40
+ <summary>Used by CI to link this PR to its OpenSpec change</summary>
41
+
42
+ <!-- the openspec-implementation fence goes here -->
43
+
44
+ </details>
45
+ ```
46
+
47
+ Do not add a quoted phase line or a routine `Validation` section listing commands to an initial draft. Actual validation results belong in CI and the eventual implementation handoff. Continue with the same phase-free body after approval. When implementation is complete and ready for required tests, use this visible order:
48
+
49
+ ```markdown
50
+ ## Proposal
51
+
52
+ <!-- one or two sentences explaining why the PR exists -->
53
+
54
+ ## Implementation
55
+
56
+ <!-- concrete implementation bullets -->
57
+
58
+ ## Acceptance
27
59
 
28
- The delivery agent adds one version-2 block to the initial draft PR description. It identifies the plan and implementation in that same PR, without `specificationPr`:
60
+ <!-- one to three plain behavior-and-result bullets -->
61
+
62
+ ## Automation
63
+
64
+ <details>
65
+ <summary>Used by CI to link this PR to its OpenSpec change</summary>
66
+
67
+ <!-- the finalized openspec-implementation fence goes here -->
68
+
69
+ </details>
70
+ ```
71
+
72
+ Keep acceptance absent during proposal review so unfinished intent is not mistaken for final acceptance criteria. Keep the finalized phase-free body unchanged through exact-head validation, maintainer review, and authorized manual merge. The same workflow run validates its finalized delivery record and applicable product/governance scopes before the stable protected aggregate succeeds. Do not add a lifecycle body edit or start a second validation run. After manual merge, trusted verification derives `Archived`; do not rewrite the accepted body.
73
+
74
+ ## Version-3 implementation metadata
75
+
76
+ The initial draft uses the existing metadata fence:
29
77
 
30
78
  ````markdown
79
+ ## Automation
80
+
81
+ <details>
82
+ <summary>Used by CI to link this PR to its OpenSpec change</summary>
83
+
31
84
  ```openspec-implementation
32
85
  {
33
- "version": 2,
86
+ "version": 3,
87
+ "change": "example-change"
88
+ }
89
+ ```
90
+
91
+ </details>
92
+ ````
93
+
94
+ After finalization, replace it with the exact emitted paths:
95
+
96
+ ````markdown
97
+ ## Automation
98
+
99
+ <details>
100
+ <summary>Used by CI to link this PR to its OpenSpec change</summary>
101
+
102
+ ```openspec-implementation
103
+ {
104
+ "version": 3,
34
105
  "change": "example-change",
35
- "archivePreparationTasks": { "recordEvidence": "7.1", "stageArchive": "7.2" }
106
+ "archive": "openspec/changes/archive/2026-09-15-example-change/",
107
+ "acceptanceManifest": "openspec/changes/archive/2026-09-15-example-change/acceptance.md"
36
108
  }
37
109
  ```
110
+
111
+ </details>
38
112
  ````
39
113
 
40
- The minimal link is `{ "version": 2, "change": "example-change" }`. Version 2 verifies that the linked artifacts are present and identical in the accepted source and implementation merge; it never invents a separate specification PR. Omit `archivePreparationTasks` when no mechanical task mapping is needed. If used, the mapped task IDs must have exactly these descriptions:
114
+ Version 3 forbids `specificationPr` and `archivePreparationTasks`. Both final paths must be absent for a draft or present and mutually consistent for a finalized candidate. Unknown fields, duplicate fences/JSON keys, unsafe paths, mismatched dates/change identities, and partial finalization fail closed.
115
+
116
+ ## Acceptance list
117
+
118
+ Use plain bullets:
41
119
 
42
120
  ```markdown
43
- - [ ] 7.1 Record verified implementation acceptance and merge evidence for archive preparation.
44
- - [ ] 7.2 Stage and verify delta synchronization and the archive move in an OpenSpec-only candidate.
121
+ ## Acceptance
122
+
123
+ - Conservative fallback runs all required validation.
124
+ - Failed or stale evidence blocks integration.
125
+ - Finalized specs and archive match the implementation.
45
126
  ```
46
127
 
47
- All implementation, tests, CI, and manual-review tasks must be completed separately before acceptance. Never combine physical review or merge authorization into these mechanical tasks. An old mixed task is a blocker, not permission to tick unperformed work.
128
+ The committed conditional manifest contains the same ordered text. Trusted policy validates membership but never checks or edits it and never claims that the scenarios passed. Manual merge is the acceptance decision; no acceptance comment, checkbox edit, review-approval requirement, JSON edit, acceptance PR, archive PR, or later command is needed.
48
129
 
49
- After implementation merge, automation commits one version-1 JSON request at `openspec/acceptance/<change>/<source-head>.json` on `docs/accept-<change>-<source-pr>`. Its PR body shows the exact implementation head/merge, spec baseline, final-head source CI, recorded evidence, every original task and continuation line, unfinished work, known gaps, and this sentence: **Merging this PR records your acceptance.** It is a review record, not another proposal.
130
+ If the body list changes, candidate validation reruns and compares it with the committed manifest. If the head changes, all prior exact-head CI is stale. If only the body changes to disagree with the manifest, integration remains blocked until the list and committed candidate agree again. No lifecycle body edit is needed after green CI.
50
131
 
51
- A generated record expresses only the conditional decision `accept-on-manual-merge`; it never names a reviewer or claims the merge already occurred. Completed source tasks stay recorded. An unchecked substantive task remains pending until actual evidence is linked and its unchanged task identity is explicitly marked `evidenced`. Only the exact pure task `Record maintainer acceptance by manually merging the acceptance PR.` may use `signoff-on-merge`. Implementation, test, live/physical review, mixed, unknown, or known-gap work cannot use that shortcut. Archive-preparation tasks retain their existing mechanical handling.
132
+ ## Finalization command
52
133
 
53
- The acceptance PR starts draft whenever source CI or substantive evidence is incomplete. Edit the record on its existing bot-owned branch without unrelated files; automation preserves reviewer edits and makes a complete draft ready on a later synchronize/scheduled/targeted pass. Closing it without merging records no acceptance; replacement requires an authorized targeted retry. Never enable auto-merge. Reserved paths, branch identity, complete diff, both rename names, and authoritative base/head state preserve the manual hold even if title, label, or body metadata is removed.
134
+ Finalization has inspection mode by default and an explicit `--write` mode. It never commits, pushes, edits GitHub, marks a PR ready, or merges. Use a temporary body file so the operation can update exact version-3 paths without mutating remote PR state:
54
135
 
55
- Candidate CI checks the exact single added record using trusted base policy and read-only permissions; it does not execute candidate scripts or wait for its own result. After manual merge, the reader separately verifies exact committed bytes, current-head CI including the acceptance check, source identities, develop ancestry, write/maintain/admin human merger, and absence of automatic/App/merge-queue provenance. Archive evidence retains acceptance PR/head/merge, record digest, author and reviewed task reconciliation. Acceptance integration alone never authorizes local deletion.
136
+ ```bash
137
+ git fetch origin develop
138
+ git rebase origin/develop
139
+ gh pr view <pr> --json body --jq .body > "$TMPDIR/openspec-pr-body.md"
140
+ node scripts/governance/finalize-openspec-delivery.mjs \
141
+ --change example-change \
142
+ --repository owner/repo \
143
+ --pr <pr> \
144
+ --date YYYY-MM-DD \
145
+ --target "$(git rev-parse origin/develop)" \
146
+ --body-file "$TMPDIR/openspec-pr-body.md"
147
+ ```
56
148
 
57
- Existing valid version-1 `openspec-acceptance` comments remain supported. Their author still needs repository write/maintain/admin authority, and edited, contradictory, revoked, stale, known-gap, or current-head conflicts fail closed. Automation never creates a synthetic comment or chooses between conflicting comment-backed and PR-backed authority.
149
+ Inspect the reported paths. Then rerun with `--write` and update the existing PR body from the emitted file:
58
150
 
59
- The code PR still requires explicit manual merge authorization. After a verified acceptance merge, no additional archive command is needed for an eligible change. Planning-only and archive PRs never count as implemented changes. Existing `acceptance.md` files require manual reconciliation rather than being silently overwritten.
151
+ ```bash
152
+ node scripts/governance/finalize-openspec-delivery.mjs \
153
+ --change example-change \
154
+ --repository owner/repo \
155
+ --pr <pr> \
156
+ --date YYYY-MM-DD \
157
+ --target "$(git rev-parse origin/develop)" \
158
+ --body-file "$TMPDIR/openspec-pr-body.md" \
159
+ --write
160
+ gh pr edit <pr> --body-file "$TMPDIR/openspec-pr-body.md"
161
+ ```
60
162
 
61
- ## Rejection, standalone docs, and legacy migration
163
+ Use repeated `--known-gap "exact disposition"` only for an actually reviewed explicit gap. Gaps remain visible in the committed manifest and do not become test results. Missing or ambiguous disposition blocks finalization.
62
164
 
63
- - **New draft rejected:** if `example-change` never merged, close its PR. Neither its plan nor code lands on `develop`, and no main-branch reconciliation or completed-change archive is required. Closing alone does not authorize deleting an unmerged branch or dirty worktree; follow separate cleanup approvals.
64
- - **Legacy merged plan rejected:** preserve its historical merge. Obtain an explicit reconciliation disposition; do not claim successful implementation or archive it as complete.
65
- - **Legacy implementation continues:** keep the existing PR (for example #376 following #362), or create an isolated implementation stream only if none exists and implementation is explicitly requested. Retain the original version-1 link; the historical specification merge and ancestry are still verified. Unknown versions and version-2 links containing `specificationPr` are rejected.
66
- - **Standalone docs/revision:** an unassociated non-draft README/docs PR or revision of an already-present active change retains the usual CI-gated automatic path. Renaming an archive into a new active plan establishes a hold; moving a completed active change into its archive does not.
165
+ The operation validates the active change strictly, requires complete substantive tasks, runs the pinned OpenSpec archive/synchronization engine in isolation, verifies the resulting canonical specs, retains every archive artifact, computes deterministic content digests, writes `acceptance.md`, and applies only the allowed OpenSpec diff. Repeating it against identical finalized inputs is verification-only and byte-stable.
67
166
 
68
- Legacy link example:
167
+ Before finalization, canonical specs must still equal the selected target. If `develop` advances, rebase/reconcile and regenerate. To refine a finalized but unmerged change, restore the active artifacts with ordinary branch history, update plan/code coherently, and rerun finalization; never hand-edit only the synchronized spec or archive copy.
69
168
 
70
- ````markdown
71
- ```openspec-implementation
72
- { "version": 1, "change": "legacy-change", "specificationPr": 123 }
73
- ```
74
- ````
169
+ ## Conditional acceptance and derived receipt
75
170
 
76
- The repository-owned [change-delivery skill](../.agents/skills/change-delivery/SKILL.md) follows these boundaries without changing external or globally installed skills. This bootstrap still needs live evidence of the new draft/approval/same-PR/refinement lifecycle, a ready-but-unimplemented plan remaining held, rejection without archival, an ordinary docs control, and accepted merge through automatic archival. Unit tests are not that evidence.
171
+ `acceptance.md` truthfully says its verdict activates only when the containing exact head is manually merged by an authorized human after required current-head checks. Its `openspec-delivery` block records stable pre-merge facts:
77
172
 
78
- ## One-time publication setup
173
+ - schema version, repository, change, and source PR;
174
+ - archive and manifest paths and finalization date;
175
+ - reviewed target/spec baseline;
176
+ - ordered acceptance scenarios;
177
+ - archive, canonical-spec, task, and evidence digests; and
178
+ - explicit known-gap dispositions.
79
179
 
80
- Provisioning is a separate maintainer-approved operation, not performed by installing or running the script.
180
+ It does not predict source head, merge commit, merger, or merge time. The PR head contains the manifest, so required CI binds those bytes without a recursive self-hash. After merge, the shared reader combines the manifest with immutable GitHub source head, successful required run, authorized human actor, absence of automatic/queue/App provenance, merge commit/time, and `develop` ancestry. That derived result is the durable version-3 receipt used by audit and cleanup.
81
181
 
82
- 1. Create and install a repository-scoped GitHub App for this repository, without administration permissions or ruleset bypass.
83
- 2. Grant repository contents and pull-request read/write permissions. The workflow's ordinary token reads contents, PR metadata, and Actions validation; the App token is restricted to publication and status comments.
84
- 3. Set repository Actions secrets `OPENSPEC_ARCHIVE_APP_ID` and `OPENSPEC_ARCHIVE_APP_PRIVATE_KEY`. Do not paste keys into PRs, source, reports, or acceptance evidence.
85
- 4. Verify trusted default-branch deployment and run a read-only audit before the isolated live lifecycle test.
86
- 5. Record a real App-authored archive PR triggering ordinary CI, automatic protected squash integration, and exact-head branch cleanup before accepting live operation.
182
+ Unavailable, stale, automatic, unauthorized, conflicting, or contradictory provenance produces `invalid-provenance`/`blocked`, not acceptance. Post-merge code does not repair it by pushing `develop` or publishing another PR.
87
183
 
88
- The script mints and revokes a short-lived installation token. It does not publish with `GITHUB_TOKEN`: GitHub can suppress the resulting PR events, leaving a PR without required CI. Missing App setup blocks mutation and does not relax protection. No extra merge owner, status spoofing, or automatic repository-settings application is introduced.
184
+ ## CI and automation ownership
89
185
 
90
- ## Audit and retry
186
+ Normal Development CI remains complete for the implementation. An archive-shaped final diff does not select documentation-only validation because the authoritative version-3 association remains implementation-bound. The trusted acceptance-policy job validates finalization from base-controlled policy while ordinary impact selection retains all applicable product and governance owners.
91
187
 
92
- From a dependency-installed checkout, run a read-only audit using existing GitHub CLI authentication:
188
+ `pull_request` body edits rerun required CI. The ordinary finalized phase-free run exposes the stable protected aggregate directly; it does not wait for a lifecycle body edit. Documentation auto-merge's trusted owner also reevaluates lifecycle association and disables any armed merge. Every publication entry point explicitly refuses version 3.
93
189
 
94
- ```bash
95
- GH_TOKEN="$(gh auth token)" node scripts/governance/reconcile-openspec-archive.mjs --dry-run
96
- ```
190
+ The OpenSpec archive workflow remains default-branch trusted. For version 3 it uses read-only contents, PR, and Actions access to report the integrated result; App credentials are unnecessary and are not minted. For legacy candidates it retains its existing scoped App publication behavior.
191
+
192
+ ## Status and audit
97
193
 
98
- To inspect one implementation PR, including one older than the scheduled window:
194
+ Read-only inspection remains:
99
195
 
100
196
  ```bash
101
- GH_TOKEN="$(gh auth token)" node scripts/governance/reconcile-openspec-archive.mjs --dry-run --pr 123
197
+ GH_TOKEN="$(gh auth token)" node scripts/governance/reconcile-openspec-archive.mjs --dry-run --pr <implementation-pr>
102
198
  ```
103
199
 
104
- These commands do not launch the product UI and do not require a product build. They never mutate remote refs, PRs, comments, source specs/tasks, or persistent scan checkpoints. Disposable local staging verifies the proposed archive; the audit report is written to `.artifacts/openspec-archive/report.json`.
200
+ For version 3, status distinguishes `needs-finalization`, `ready-for-manual-merge`, `accepted-and-archived`, `closed`, `blocked`, and `invalid-provenance`. A successful workflow invocation does not imply acceptance while the PR is open. Dry run never mutates refs, PRs, body text, tasks, evidence, specs, or acceptance.
201
+
202
+ Scheduled scans continue to serve legacy catch-up. Version-3 candidates are verification-only and do not consume publication slots or block the legacy queue.
203
+
204
+ ## Cleanup
105
205
 
106
- For authorized publication or retry, use the **OpenSpec archive** Actions dispatch. Keep `dry_run` enabled for inspection. Set a specific PR and `retry_closed` only when deliberately authorizing replacement of its closed/unmerged archive PR. Closing an archive PR otherwise stops automatic recreation.
206
+ After version-3 merge, verify:
107
207
 
108
- ## Outcomes and bounds
208
+ - the source PR is merged with the exact reviewed head by an authorized human;
209
+ - required exact-head CI succeeded;
210
+ - current `develop` descends from the merge;
211
+ - the active change is absent;
212
+ - the declared archive, conditional manifest, and synchronized specs match their digests; and
213
+ - the unchanged remote topic ref is absent.
109
214
 
110
- - **awaiting-evidence**: an acceptance PR exists but lists missing CI, substantive tasks, or actual outcomes; update that same request without fabricating results.
111
- - **awaiting-manual-acceptance-merge**: the validated acceptance request needs explicit maintainer review and manual merge.
112
- - **eligible**: accepted evidence and isolated archive staging passed; dry-run did not publish.
113
- - **accepted-archive-blocked**: acceptance is verified, but tasks, synchronization, archive CI, or publication still blocks archival.
114
- - **blocked**: a named evidence/task/spec/setup/ownership/conflict problem requires attention.
115
- - **pending**: archive PR exists; current-head CI and automatic merge are not yet complete.
116
- - **already-archived**: merged archive identity and retained evidence were verified.
117
- - **deferred**: the queue or scan budget prevented work this run.
118
- - **unlinked**: no explicit implementation metadata; not presumed accepted or archived.
215
+ Only then shall the owning agent invoke the exact-candidate `complete` operation documented in [local cleanup](local-worktree-cleanup.md) from the primary checkout. The command owns registration/release, repository-generated disposables, one bounded evidence pass, non-force worktree removal, and unchanged local-ref cleanup; agents do not manually delete generated content, worktrees, or branches. Version 3 uses the implementation PR as both source and candidate and does not wait for nonexistent acceptance/archive PRs.
119
216
 
120
- Only one automatic archive PR is outstanding at a time. Runs never wait on CI. A failing pending PR blocks the queue until fixed or explicitly closed; neither a rerun nor a successful old head bypasses its required checks. Human-edited branches and unrelated paths are preserved.
217
+ Closing an unmerged PR does not authorize local or remote deletion. Remote cleanup deletes only the exact unchanged same-repository unprotected topic ref and never touches local worktrees.
121
218
 
122
- Catch-up scans a fixed 90-day window, up to 500 PRs per pass, with a 10-minute workflow budget and one publication per run. A small versioned cursor resumes unfinished windows; reports and cursors are retained for 14 days. Missing/expired cursors restart a bounded scan, not an assumed complete audit. Older PRs remain targetable. Exceptionally dense search buckets or incomplete GitHub search results are explicit blockers rather than silent truncation.
219
+ ## Legacy delivery
123
220
 
124
- Known-gap archival remains a separately authorized manual path. The existing backlog is not bulk-approved when automation starts. Local worktree cleanup remains local: the owning agent can release an explicitly registered checkout to the separately enabled [local reconciler](local-worktree-cleanup.md) after stopping its use. The reconciler waits for verified archive integration and remote-ref absence, checks ownership and all local content, and never force-discards dirty work. Unregistered or unreleased worktrees remain untouched.
221
+ Version 1 retains `specificationPr` and authorized exact-head comment-backed acceptance. Version 2 retains the same-PR planning/implementation link, final `## Acceptance checks` handoff, generated `#<source>(accept): ...` checkbox PR, verified authorized manual acceptance merge, and generated CI-gated archive PR. Existing records remain immutable and readable.
222
+
223
+ Legacy reconciliation may create/reuse only its established acceptance/archive branches and PRs, uses bounded catch-up/retry, preserves human edits, fails closed on missing evidence or conflicts, and never treats version 3 as publishable. Its App remains repository-scoped without administration/ruleset bypass; write credentials execute only trusted default-branch policy and never PR-head code.
224
+
225
+ A closed legacy follow-up requires targeted retry authorization. Existing valid acceptance comments and PR receipts are not rewritten. Legacy local cleanup continues to wait for implementation, acceptance where applicable, and archive integration.
226
+
227
+ ## First version-3 canary
228
+
229
+ This bootstrap policy itself finishes under deployed version-2 authority. The first isolated version-3 canary must record live evidence of:
230
+
231
+ - draft planning remaining unmerged;
232
+ - explicit plan approval and same-PR implementation;
233
+ - current-target finalization and exact-head CI;
234
+ - authorized human manual merge with plain acceptance scenarios;
235
+ - integrated canonical specs/archive and no generated acceptance/archive PR;
236
+ - read-only `accepted-and-archived` verification and exact-head branch cleanup;
237
+ - stale head/body/base, incomplete tasks/evidence, malformed manifest, and automatic-merge refusal fixtures; and
238
+ - an unrelated standalone spec/docs PR retaining auto-merge.
239
+
240
+ Unit tests or API success alone are not live acceptance. Until this evidence exists, version 3 is deployable but documented as awaiting its operational canary.
125
241
 
126
242
  ## Disable or roll back
127
243
 
128
- Disable the **OpenSpec archive** workflow or revoke its App publication credentials to stop new request/archive publication. Preserve authoritative acceptance records, their manual auto-merge hold, active changes, and open review/archive PRs. Do not delete receipts, undo synchronized specs, or modify repository rulesets merely to stop automation. Readers must remain compatible with existing PR-backed and legacy comment receipts or fail closed. Existing documentation auto-merge and remote branch cleanup remain independently governed.
244
+ Before a version-3 merge, disable new version-3 authoring and continue using legacy version 2. After a version-3 merge, preserve its integrated archive and provenance and use an ordinary explicit corrective PR. Never direct-push a rewritten receipt, delete historical evidence, relax branch protection, or reinterpret an automatic merge as human acceptance.
245
+
246
+ Disabling the OpenSpec archive workflow stops legacy publication and version-3 post-merge reporting, but does not change existing acceptance records, documentation auto-merge, remote branch cleanup, or release authority.
@@ -0,0 +1,62 @@
1
+ # Validation ownership and evidence
2
+
3
+ Development validation computes one exact base/head selection with:
4
+
5
+ ```bash
6
+ npm run select:validation-impact -- --base <full-base-sha> --head <full-head-sha> --output .artifacts/validation/impact.json
7
+ ```
8
+
9
+ The versioned `config/validation-ownership.json` registry maps stable product and test path groups to a mandatory PR core, affected unit tests, resource-sensitive tests, and integration owners. The initial coarse owners are UI/rendering, launch/startup, release/package/update, Pi, native containment, image/history, governance, and shared product inputs. Each integration owner in `config/integration-owners.json` declares `pull-request` or `exhaustive` cadence. A changed pull-request test selects its owner; a changed exhaustive test selects focused deterministic contracts and records the exhaustive owner as cadence-deferred. Shared support selects every declared PR consumer and records affected exhaustive consumers; copies, renames, and deletions inspect both identities. Reasons and changed paths are recorded in `impact.json`.
10
+
11
+ Unknown operational inputs, unavailable comparison history, workflow/selector/suite/aggregate changes, and manual Development dispatch select every pull-request owner. Missing, malformed, or unknown cadence blocks instead of guessing. Documentation-only and version-only changes retain explicit exemptions. Selection does not require whole-repository source parsing.
12
+
13
+ ## Commands and coverage levels
14
+
15
+ The public complete commands remain unchanged:
16
+
17
+ ```bash
18
+ npm run test:pr-core # mandatory type/architecture checks and bounded smoke tests
19
+ npm run test:fast # typecheck, changed docs, complete fast composition
20
+ npm run test:scope -- <scope...> # named atomic scopes
21
+ npm run test:full # complete deduplicated local composition
22
+ npm run test:release # release gates; publication authority is unchanged
23
+ ```
24
+
25
+ `test:pr-core` is not a replacement for `test:fast`: CI combines it with directly changed and coarse-owner tests from the exact impact selection. Selected resource-sensitive tests run independently on an isolated Windows runner. Selected package, startup, rendering, Pi, compatibility, and platform owners also run independently after their actual prerequisites.
26
+
27
+ Conservative Development retains every pull-request owner but does not schedule exhaustive owners. Full regression and nightly/stable release retain both cadence classes and declared Windows Node 22/24, Linux Node 24, and macOS Node 24 coverage. The real three-release `update-predecessor` exact-package oracle is exhaustive; deterministic predecessor command, fixture, materialization, warmup, package, and update contracts remain PR-eligible. Preview and release continue to consume exact candidate bytes under their channel-specific contracts. Use manual Full regression before merge when a risky release change needs real published-history evidence. The generated ownership ledger command is:
28
+
29
+ ```bash
30
+ node scripts/release/generate-validation-ownership-ledger.mjs --output .artifacts/validation/ownership-ledger.json
31
+ ```
32
+
33
+ ## Failed-job reruns and attempt evidence
34
+
35
+ Every modular outcome, content-free job envelope, and uploaded artifact name is qualified by `github.run_attempt`. Authority remains bound to the workflow run ID, exact head, complete selection identity, logical job, and platform/runtime target.
36
+
37
+ For GitHub's explicit **re-run failed jobs** action, a successful job that GitHub did not rerun may be reused only from an earlier attempt of that same run/head/selection. A job executed in the current attempt must use its current outcome; failure, cancellation, malformed evidence, duplicate authority, or missing evidence blocks the aggregate. No result is reused across commits, workflow runs, or changed selections. The aggregate lists each reused job and original attempt. Workflows do not automatically retry semantic assertions or performance failures.
38
+
39
+ ## Receipts and artifact boundaries
40
+
41
+ Checkout-bound type, architecture, governance, unit, and smoke outcomes bind head/run/selection/scope authority without inventing package identity. Build and package receipts remain mandatory wherever validation consumes emitted or packed bytes: package, startup, update, compatibility, preview, release, and publication boundaries.
42
+
43
+ A build receipt binds checkout head, complete build inputs, toolchain, emitted files, and native artifacts. A package receipt additionally binds exact tarball bytes, packed entries, manifest/bin identity, producer, and verified build/source authority. `VALIDATION_BUILD_READY` and `VALIDATION_CANDIDATE_TARBALL` only locate prerequisites; stale or tampered receipts cause fresh preparation or failure.
44
+
45
+ Npm download bytes may be reused with integrity checks and `--prefer-offline`, with normal network fallback. Every installation prefix remains fresh. Installed package trees, dependency certification, startup/profile state, mutable fixture repositories, passing outcomes, and publication evidence are never restored from caches.
46
+
47
+ ## Evidence inspection
48
+
49
+ Download these artifacts from the exact workflow run:
50
+
51
+ - `development-validation-impact`: base/head, global selection identity, PR-core tests, selected pull-request owners, cadence-deferred exhaustive owners, exclusions, and bounded reasons.
52
+ - `development-validation-outcome-<job>-<platform>-node<node>-attempt-<attempt>`: attempt-qualified outcome, content-free envelope, per-scope authority and duration, and applicable exact-artifact evidence.
53
+ - `development-validation-aggregate-<head>-<run>-<attempt>`: selected/deferred owners, accepted/reused attempts, evidence count, runner critical path, total runner time, aggregate processing, setup/gate/scope time, cache state, and invocation count. It reports the eight-minute critical-path and five-minute individual-scope targets as met or unmet; hosted queue delay is not test execution and remains separate.
54
+ - startup/resume phase JSONL and performance JSON: first-attempt launch evidence and retained failed setup/readiness records.
55
+
56
+ A finalized version-3 PR keeps its phase-free body unchanged. Its ordinary exact-head workflow runs selected product/governance lanes and `Finalized delivery validation` in parallel, then emits the stable protected `Development validation required` aggregate only when both authorities succeed. Green CI enables maintainer review and manual merge but does not claim human acceptance or merge automatically. No lifecycle body edit or second workflow run is required. Any implementation commit changes the head and reruns applicable validation; any body change reruns finalized-record validation and must continue to match the committed manifest. Legacy acceptance-record-only PRs retain their separate trusted `Acceptance record validation` route. Queue availability remains explicitly unavailable inside a runner and is calculated from the Actions API during final run analysis rather than guessed.
57
+
58
+ ## Rollback
59
+
60
+ To disable selective execution without reducing PR coverage, use manual Development dispatch or force conservative ownership selection. To restore the historical predecessor oracle to every applicable PR, change its cadence from `exhaustive` to `pull-request`; do not delete it from Full/nightly/release. To disable prior-attempt reuse, require all accepted attempts to equal the aggregate attempt; this must not remove attempt-qualified artifacts or failure visibility. To disable prerequisite reuse, unset readiness/tarball variables and receipt paths so tier orchestration rebuilds and repacks.
61
+
62
+ Rollback must retain every test, startup budget, zero automatic retry policy, platform/runtime lane, exact-package identity, resource isolation, complete fast/full/release compositions, and the single stable protected-branch aggregate.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timurproko/a1",
3
- "version": "0.1.8-dev.407",
3
+ "version": "0.1.8-dev.436",
4
4
  "description": "Standalone terminal workspace for supervised native and managed agents",
5
5
  "type": "module",
6
6
  "privateLaunchContract": "neutral-launch-v1",
@@ -24,7 +24,7 @@
24
24
  "scripts": {
25
25
  "postinstall": "node bin/sync-pi-tui-proxy.js",
26
26
  "clean": "node scripts/clean.mjs",
27
- "build": "npm run clean && tsc -p tsconfig.build.json && node scripts/development/build-process-guardian.mjs && node scripts/release/generate-runtime-payload-inventory.mjs",
27
+ "build": "npm run clean && tsc -p tsconfig.build.json && node scripts/pi/build-startup-public.mjs && node scripts/development/build-process-guardian.mjs && node scripts/release/generate-runtime-payload-inventory.mjs",
28
28
  "build:process-guardian": "node scripts/development/build-process-guardian.mjs",
29
29
  "typecheck": "tsgo -p tsconfig.json --noEmit",
30
30
  "check:architecture": "node scripts/governance/check-architecture.mjs && node scripts/governance/check-product-identity-boundaries.mjs && node scripts/governance/check-package-identity.mjs && node scripts/governance/check-pinned-pi-source-ledger.mjs && node scripts/governance/check-terminal-host-provenance.mjs",
@@ -42,6 +42,7 @@
42
42
  "develop": "node scripts/development/develop.mjs",
43
43
  "release": "node scripts/release/release.mjs",
44
44
  "test": "npm run test:fast",
45
+ "test:pr-core": "node scripts/release/run-validation-tier.mjs pr-core",
45
46
  "test:fast": "node scripts/release/run-validation-tier.mjs typecheck documentation-changed fast",
46
47
  "test:scope": "node scripts/release/run-validation-tier.mjs",
47
48
  "test:full": "node scripts/release/run-validation-tier.mjs full-release",
@@ -80,6 +81,7 @@
80
81
  "@types/semver": "7.8.0",
81
82
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
82
83
  "@xterm/headless": "6.0.0",
84
+ "esbuild": "0.25.10",
83
85
  "node-pty": "1.1.0",
84
86
  "tsx": "4.20.3",
85
87
  "typescript": "5.9.2",