@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.
- package/bin/cli.js +14 -9
- package/bin/guardian.js +3 -3
- package/bin/module-identity.js +21 -3
- package/bin/pinned-pi-public.d.ts +3 -0
- package/bin/pinned-pi-public.js +74 -0
- package/bin/ui.js +17 -18
- package/bin/warmup.js +8 -10
- package/dist/composition/owned-ui.d.ts +5 -3
- package/dist/composition/owned-ui.js +17 -10
- package/dist/composition/settings-route-host.d.ts +4 -5
- package/dist/composition/settings-route-host.js +90 -55
- package/dist/features/launch/intent.d.ts +5 -3
- package/dist/features/launch/intent.js +2 -2
- package/dist/features/launch/profile-paths.js +1 -1
- package/dist/features/launch/runtime-selection.d.ts +1 -1
- package/dist/features/launch/runtime-selection.js +1 -1
- package/dist/features/owned-ui/run.d.ts +6 -0
- package/dist/features/owned-ui/run.js +34 -2
- package/dist/features/owned-ui/settings-app.d.ts +1 -3
- package/dist/features/owned-ui/settings-app.js +2 -2
- package/dist/features/owned-ui/settings-route.d.ts +2 -0
- package/dist/features/owned-ui/settings-route.js +2 -0
- package/dist/foundation/release/update.js +5 -3
- package/dist/foundation/startup/startup-descriptor.js +34 -0
- package/dist/foundation/startup/startup-runtime.d.ts +10 -0
- package/dist/foundation/startup/startup-runtime.js +11 -3
- package/dist/foundation/terminal-cleanup/fatal-exit.js +4 -2
- package/dist/integrations/pi/components/components.js +1 -1
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +1 -1
- package/dist/integrations/pi/components/owned-editor-ux.js +6 -2
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +2 -2
- package/dist/integrations/pi/components/shell-extension-ui.d.ts +1 -1
- package/dist/integrations/pi/components/shell-extension-ui.js +1 -1
- package/dist/integrations/pi/components/shell-footer-status.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +2 -2
- package/dist/integrations/pi/components/shell-presenters-transcript.js +2 -2
- package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +1 -1
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +1 -1
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +1 -1
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +2 -0
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +8 -2
- package/dist/integrations/pi/components/tool-image-presentation.d.ts +1 -1
- package/dist/integrations/pi/components/tool-image-presentation.js +1 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/components/first-time-setup.js +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +1 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
- package/dist/integrations/pi/engine/adapter.d.ts +1 -1
- package/dist/integrations/pi/engine/adapter.js +1 -1
- package/dist/integrations/pi/engine/model-auth-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/package-integration.js +1 -1
- package/dist/integrations/pi/engine/project-trust-preflight.js +1 -1
- package/dist/integrations/pi/engine/resource-extension-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/runtime-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/runtime-integration.js +2 -2
- package/dist/integrations/pi/engine/session-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/session-selection.d.ts +1 -1
- package/dist/integrations/pi/engine/session-selection.js +1 -1
- package/dist/integrations/pi/engine/settings-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/windows-filesystem-hygiene.d.ts +1 -1
- package/dist/integrations/pi/engine/windows-filesystem-hygiene.js +1 -1
- package/dist/integrations/pi/session-ui/clipboard-diagnostics.d.ts +1 -1
- package/dist/integrations/pi/session-ui/clipboard-diagnostics.js +1 -1
- package/dist/integrations/pi/session-ui/paste-executor.d.ts +1 -1
- package/dist/integrations/pi/session-ui/paste-executor.js +1 -1
- package/dist/integrations/pi/session-ui/paste-protocol.d.ts +1 -1
- package/dist/integrations/pi/session-ui/prompt-chips.d.ts +1 -1
- package/dist/integrations/pi/session-ui/prompt-chips.js +1 -1
- package/dist/integrations/pi/session-ui/response-copy-coordinator.d.ts +1 -1
- package/dist/integrations/pi/session-ui/response-copy-coordinator.js +1 -1
- package/dist/integrations/pi/session-ui/response-copy-transport.d.ts +1 -1
- package/dist/integrations/pi/session-ui/session-shell-root.d.ts +8 -6
- package/dist/integrations/pi/session-ui/session-shell-root.js +31 -10
- package/dist/integrations/pi/session-ui/session-shell.d.ts +6 -3
- package/dist/integrations/pi/session-ui/session-shell.js +54 -11
- package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +8 -3
- package/dist/integrations/pi/session-ui/session-viewport-controller.js +33 -5
- package/dist/integrations/pi/session-ui/system-clipboard.d.ts +1 -1
- package/dist/integrations/pi/session-ui/system-clipboard.js +7 -4
- package/dist/integrations/pi/startup-public.d.ts +2 -0
- package/dist/integrations/pi/startup-public.js +2128 -0
- package/dist/integrations/pi/startup-public.manifest.json +11696 -0
- package/dist/integrations/pi/tui-runtime/adapter.js +1 -1
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/runtime-payload-inventory.json +4 -1
- package/docs/architecture/response-copy-delivery.md +3 -1
- package/docs/ci-release-runbook.md +20 -7
- package/docs/local-worktree-cleanup.md +30 -12
- package/docs/openspec-archive-automation.md +191 -73
- package/docs/validation.md +62 -0
- package/package.json +4 -2
|
@@ -1,128 +1,246 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Atomic OpenSpec delivery and legacy archival
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
9
|
+
## Version-3 lifecycle
|
|
10
10
|
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
22
|
+
## Draft PR body
|
|
23
23
|
|
|
24
|
-
The
|
|
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
|
-
|
|
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
|
-
|
|
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":
|
|
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
|
-
"
|
|
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
|
-
|
|
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
|
-
|
|
44
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
132
|
+
## Finalization command
|
|
52
133
|
|
|
53
|
-
|
|
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
|
-
|
|
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
|
-
|
|
149
|
+
Inspect the reported paths. Then rerun with `--write` and update the existing PR body from the emitted file:
|
|
58
150
|
|
|
59
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
71
|
-
```openspec-implementation
|
|
72
|
-
{ "version": 1, "change": "legacy-change", "specificationPr": 123 }
|
|
73
|
-
```
|
|
74
|
-
````
|
|
169
|
+
## Conditional acceptance and derived receipt
|
|
75
170
|
|
|
76
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
184
|
+
## CI and automation ownership
|
|
89
185
|
|
|
90
|
-
|
|
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
|
-
|
|
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
|
-
|
|
95
|
-
|
|
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
|
-
|
|
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
|
|
197
|
+
GH_TOKEN="$(gh auth token)" node scripts/governance/reconcile-openspec-archive.mjs --dry-run --pr <implementation-pr>
|
|
102
198
|
```
|
|
103
199
|
|
|
104
|
-
|
|
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
|
-
|
|
206
|
+
After version-3 merge, verify:
|
|
107
207
|
|
|
108
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
219
|
+
## Legacy delivery
|
|
123
220
|
|
|
124
|
-
|
|
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
|
-
|
|
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.
|
|
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",
|