codex-workflow-v2 2.0.0-alpha.7 → 2.0.0-alpha.7.1
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/README.md +1 -1
- package/dist/src/alpha6/remediation.d.ts +3 -0
- package/dist/src/alpha6/remediation.js +70 -18
- package/dist/src/alpha6/remediation.js.map +1 -1
- package/dist/src/contracts.d.ts +2 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/src/workflow.d.ts +1 -0
- package/dist/src/workflow.js +238 -55
- package/dist/src/workflow.js.map +1 -1
- package/docs/alpha7.1-implementation-brief.md +268 -0
- package/docs/autonomy-guardrails.md +29 -14
- package/package.json +1 -1
- package/plugins/codex-workflow-gateway/references/protocol.md +13 -4
- package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +16 -4
- package/references/state-machine.md +17 -6
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# codex-workflow-v2 2.0.0-alpha.7.1 implementation brief
|
|
2
|
+
|
|
3
|
+
## Status and authority
|
|
4
|
+
|
|
5
|
+
This document is the single source of truth for the local `2.0.0-alpha.7.1`
|
|
6
|
+
release candidate. It was authorized in the current Codex task on 2026-08-14.
|
|
7
|
+
Workflow V2 must not be used to organize or authorize this development work.
|
|
8
|
+
|
|
9
|
+
The candidate is based on the published tag `v2.0.0-alpha.7` at commit
|
|
10
|
+
`b7ce0b5e14791e8177c104a2344dfb46f459696f` and is developed in the standalone
|
|
11
|
+
repository `/Users/home-pc/htdocs/codex-workflow-v2` on the isolated branch
|
|
12
|
+
`codex/workflow-v2-alpha7-1`.
|
|
13
|
+
|
|
14
|
+
No tag, push, or npm publication is authorized. The `signal_v4` repository,
|
|
15
|
+
its external Workflow state, and its Milestone 3 state are read-only evidence
|
|
16
|
+
and must not be changed.
|
|
17
|
+
|
|
18
|
+
## Problem statement
|
|
19
|
+
|
|
20
|
+
Alpha.7 adds a bounded Milestone autonomy contract, but its guarded remediation
|
|
21
|
+
state machine is not internally consistent after a strict Step review failure
|
|
22
|
+
causes Project Knowledge refresh, Task Knowledge rebind, and delegated
|
|
23
|
+
reauthorization.
|
|
24
|
+
|
|
25
|
+
The production-shaped failure is:
|
|
26
|
+
|
|
27
|
+
1. A guarded Step fails two strict reviews and records two ordinary remediation
|
|
28
|
+
events.
|
|
29
|
+
2. The Step's commits make Project Knowledge stale.
|
|
30
|
+
3. Project Knowledge is reconciled and approved, then the Task Plan is rebound
|
|
31
|
+
and reauthorized under a new Plan hash.
|
|
32
|
+
4. The Task remains runnable and the failed Step remains the remediation target,
|
|
33
|
+
but `next` no longer advertises `task corrective-decision` because the gate is
|
|
34
|
+
derived only for `needs_fix`.
|
|
35
|
+
5. `recordStepCorrectiveDecision` also accepts only `needs_fix` or a narrowly
|
|
36
|
+
defined `blocked` unverified-review posture, so the advertised and executable
|
|
37
|
+
transitions can diverge.
|
|
38
|
+
|
|
39
|
+
This creates a lifecycle deadlock and previously encouraged signal-specific
|
|
40
|
+
rescue patches. Alpha.7.1 must fix the generic transition semantics. It must not
|
|
41
|
+
hard-code repository names, Task IDs, Step IDs, revisions, commits, Plan hashes,
|
|
42
|
+
or package-upgrade rescue identities.
|
|
43
|
+
|
|
44
|
+
The real-agent E2E exposed a second autonomy deadlock. A normal Task that adds a
|
|
45
|
+
new test can cause the repository scanner to add that file as a supporting
|
|
46
|
+
Knowledge source. The Milestone autonomy contract currently permits only
|
|
47
|
+
content-hash-only atomic refresh, so the new source forces another human approval
|
|
48
|
+
even when its exact path, category, authority, and reason were declared in the
|
|
49
|
+
authorized Task Plan. Alpha.7.1 must distinguish such Plan-bounded supporting
|
|
50
|
+
source additions from unplanned source-set or authority changes.
|
|
51
|
+
|
|
52
|
+
## User outcomes
|
|
53
|
+
|
|
54
|
+
1. A Milestone coordinator can execute a bounded Milestone autonomously without
|
|
55
|
+
asking for repeated human approvals covered by the Milestone autonomy
|
|
56
|
+
contract.
|
|
57
|
+
2. A guarded Step gets at most two ordinary remediation attempts, then exactly
|
|
58
|
+
one independently audited corrective attempt when `continue-fix` is chosen.
|
|
59
|
+
3. Project Knowledge refresh, Task Knowledge rebind, and delegated
|
|
60
|
+
reauthorization preserve the remediation posture rather than losing or
|
|
61
|
+
bypassing it.
|
|
62
|
+
4. `next` always recommends a transition that the corresponding command can
|
|
63
|
+
execute from the same immutable state, subject only to the evidence explicitly
|
|
64
|
+
named by that recommendation.
|
|
65
|
+
5. A third failed guarded remediation reaches a hard stop. Only split or stop
|
|
66
|
+
escalation is permitted; a fourth run is impossible.
|
|
67
|
+
6. Discovery quality is checked, but ordinary human incompleteness and
|
|
68
|
+
non-blocking unknowns do not require the user to pre-plan agent behavior.
|
|
69
|
+
7. A Task may add a supporting Knowledge source declared by its already
|
|
70
|
+
authorized Plan without creating another human gate; undeclared additions,
|
|
71
|
+
canonical-source additions, removals, authority/category changes, gaps, and
|
|
72
|
+
conflicts still fail closed.
|
|
73
|
+
|
|
74
|
+
## Required state-machine semantics
|
|
75
|
+
|
|
76
|
+
### R1 — generic corrective posture
|
|
77
|
+
|
|
78
|
+
Derive the corrective posture from the current guarded Step, current Plan Risk
|
|
79
|
+
Audit, remediation history, and corrective-decision history. Do not infer it
|
|
80
|
+
solely from `Task.status`.
|
|
81
|
+
|
|
82
|
+
The derivation must work when the same failed guarded Step is represented in any
|
|
83
|
+
legitimate post-failure/post-refresh status produced by the Workflow, including
|
|
84
|
+
`needs_fix`, post-rebind `ready`, post-authorization `ready`, and the existing
|
|
85
|
+
blocked/unverified strict-review retry posture.
|
|
86
|
+
|
|
87
|
+
### R2 — `next`/command consistency
|
|
88
|
+
|
|
89
|
+
If a guarded Step has two failed remediation events and no decision for attempt
|
|
90
|
+
3, `next` must advertise `task corrective-decision` before `task run` regardless
|
|
91
|
+
of a content-only Knowledge refresh, Plan rebind, or delegated reauthorization.
|
|
92
|
+
|
|
93
|
+
When `next` advertises `task corrective-decision`,
|
|
94
|
+
`recordStepCorrectiveDecision` must accept the same Task/Step state with the
|
|
95
|
+
recommended revision, Plan Risk Audit, actor/lease posture, and independent
|
|
96
|
+
auditor evidence.
|
|
97
|
+
|
|
98
|
+
### R3 — Plan rebind continuity
|
|
99
|
+
|
|
100
|
+
Knowledge rebind may create a new Plan hash. Historical remediation events remain
|
|
101
|
+
immutable. A corrective decision is bound to the current Plan hash and the exact
|
|
102
|
+
covered remediation event IDs. Rebind must not reset attempt counts or permit a
|
|
103
|
+
third ordinary attempt.
|
|
104
|
+
|
|
105
|
+
### R4 — bounded recovery
|
|
106
|
+
|
|
107
|
+
- Attempts 1 and 2 are ordinary.
|
|
108
|
+
- Attempt 3 requires an independent corrective decision.
|
|
109
|
+
- `continue-fix` enables exactly the third corrective attempt.
|
|
110
|
+
- `replan-required` requires an actual new Plan posture before execution.
|
|
111
|
+
- `split-required` and `stop-escalate` block execution.
|
|
112
|
+
- After a third failed remediation event, `next` must expose a stable hard-stop
|
|
113
|
+
action and must not throw while merely reporting status.
|
|
114
|
+
- A fourth `task run` and a fourth `continue-fix` decision are prohibited.
|
|
115
|
+
|
|
116
|
+
### R5 — priority ordering
|
|
117
|
+
|
|
118
|
+
Pending strict review for an already recorded completion commit outranks
|
|
119
|
+
Knowledge refresh. After that review is terminal, required Project Knowledge
|
|
120
|
+
refresh and Task Knowledge rebind remain mandatory. Once current knowledge and
|
|
121
|
+
authorization are restored, an outstanding corrective decision outranks another
|
|
122
|
+
run. C1 claim/handoff constraints remain authoritative and must not be bypassed.
|
|
123
|
+
|
|
124
|
+
### R6 — Milestone autonomy
|
|
125
|
+
|
|
126
|
+
The alpha.7 Milestone autonomy contract remains bounded by its immutable semantic
|
|
127
|
+
scope, delegate, expiry, policy hash, and allowed transitions. It may cover
|
|
128
|
+
Milestone execution/final acceptance, Task execution/final acceptance, and
|
|
129
|
+
content-only Project Knowledge approval. Semantic scope changes still require
|
|
130
|
+
new human authority. Alpha.7.1 must not broaden these permissions.
|
|
131
|
+
|
|
132
|
+
### R7 — Plan-bounded supporting-source refresh
|
|
133
|
+
|
|
134
|
+
The user explicitly authorized this bounded delegated-approval expansion in the
|
|
135
|
+
current Codex task after the real-agent E2E exposed the supporting-source
|
|
136
|
+
deadlock. The authorization is limited to the complete fail-closed predicate
|
|
137
|
+
below.
|
|
138
|
+
|
|
139
|
+
The atomic delegated `task context-refresh` transition may accept a newly
|
|
140
|
+
discovered Knowledge source only when all of the following are true:
|
|
141
|
+
|
|
142
|
+
- the active Task belongs to the Milestone named by the autonomy grant;
|
|
143
|
+
- the current authorized Task Plan declares `knowledgeImpact: create` and an
|
|
144
|
+
exact `knowledgeTargets` entry for the new path and category;
|
|
145
|
+
- the scanner classifies that exact path and category as `supporting`;
|
|
146
|
+
- no previously approved source is removed;
|
|
147
|
+
- no existing source changes category or authority;
|
|
148
|
+
- no unplanned source is added;
|
|
149
|
+
- gaps and conflicts are unchanged and no new conflict exists.
|
|
150
|
+
|
|
151
|
+
The transition remains atomic: reconcile, approve the exact safe candidate,
|
|
152
|
+
rebind Task Knowledge, and supersede execution authorization together. It must
|
|
153
|
+
not permit standalone Project Memory approval, canonical-source creation,
|
|
154
|
+
wildcard/directory targets, or mutation beyond the Task's current Plan and the
|
|
155
|
+
existing Milestone autonomy policy. `next` must expose this delegated refresh
|
|
156
|
+
only when the complete predicate is satisfied and otherwise report the concrete
|
|
157
|
+
unsafe differences.
|
|
158
|
+
|
|
159
|
+
## Required tests
|
|
160
|
+
|
|
161
|
+
### Deterministic replay (release-blocking)
|
|
162
|
+
|
|
163
|
+
Add a production-shaped regression using opaque, non-hard-coded Step IDs. It must
|
|
164
|
+
replay the complete sequence:
|
|
165
|
+
|
|
166
|
+
1. Milestone autonomy and delegated Task authorization.
|
|
167
|
+
2. Guarded Step completion and strict-review failure 1.
|
|
168
|
+
3. Ordinary remediation, completion, and strict-review failure 2.
|
|
169
|
+
4. Project Knowledge staleness, content-only reconcile/approval, Task Knowledge
|
|
170
|
+
rebind, refreshed Plan Risk Audit, and delegated reauthorization.
|
|
171
|
+
5. `next -> task corrective-decision` and successful recording by an auditor
|
|
172
|
+
distinct from the latest strict reviewer.
|
|
173
|
+
6. Corrective attempt 3 and successful strict review, followed by Task completion.
|
|
174
|
+
7. A sibling replay where attempt 3 fails and proves stable hard-stop reporting,
|
|
175
|
+
rejection of a fourth run, and rejection of `continue-fix` for attempt 4.
|
|
176
|
+
|
|
177
|
+
The replay must assert state, sidecar bindings, attempt ordinals, Plan hashes,
|
|
178
|
+
returned actions, and absence of repository-specific rescue logic.
|
|
179
|
+
|
|
180
|
+
Add a sibling deterministic replay for R7. It must prove that one exact
|
|
181
|
+
Plan-declared supporting test source can be accepted through atomic delegated
|
|
182
|
+
context refresh, while an undeclared source, a canonical addition, a removal,
|
|
183
|
+
and an authority/category change remain ineligible and cannot mutate state.
|
|
184
|
+
|
|
185
|
+
### Existing suites (release-blocking)
|
|
186
|
+
|
|
187
|
+
`npm run validate`, `npm run release:check`, `npm run pack:check`,
|
|
188
|
+
`npm run smoke:downstream`, and `npm run plugin:check` must pass sequentially
|
|
189
|
+
under the repository's supported Node version. Parallel build/clean scripts are
|
|
190
|
+
not valid evidence because they race on shared output directories.
|
|
191
|
+
|
|
192
|
+
### Real-agent isolated E2E (release-blocking)
|
|
193
|
+
|
|
194
|
+
Create `test-runs/2.0.0-alpha.7.1/project` as a disposable repository inside the
|
|
195
|
+
standalone project. Use the sibling `codex-home`, `workflow-state`, `plugin-root`,
|
|
196
|
+
`npm-cache`, and `evidence` directories for complete isolation. Install the
|
|
197
|
+
candidate from a local `npm pack` tarball, not the public registry. The globally
|
|
198
|
+
installed Codex Workflow plugin remains disabled; the real agent loads only the
|
|
199
|
+
candidate gateway from the isolated plugin root.
|
|
200
|
+
|
|
201
|
+
Run a real Delegate agent through:
|
|
202
|
+
|
|
203
|
+
`initial Discovery -> Milestone -> bounded Milestone autonomy -> Tasks -> strict
|
|
204
|
+
review/remediation and Knowledge refresh -> merge/handback -> Milestone validate
|
|
205
|
+
-> delegated final accept`.
|
|
206
|
+
|
|
207
|
+
The Milestone must be small enough to finish but contain at least three Tasks:
|
|
208
|
+
|
|
209
|
+
1. A bounded safe-contract implementation Task that adds a Plan-declared
|
|
210
|
+
supporting test source and exercises the R7 atomic refresh path.
|
|
211
|
+
2. A guarded persistence/documentation Task that causes content drift and two
|
|
212
|
+
deterministic strict-review failures before a bounded corrective success,
|
|
213
|
+
exercising reconcile, rebind, and reauthorization.
|
|
214
|
+
3. A composition/acceptance Task that closes the Milestone.
|
|
215
|
+
|
|
216
|
+
The initial Discovery prompt should imitate a real product-owner request: desired
|
|
217
|
+
outcome, examples and constraints are present, while implementation details,
|
|
218
|
+
exact Step decomposition, retry mechanics, and some non-blocking design choices
|
|
219
|
+
are deliberately omitted. The agent must discover and resolve what it can,
|
|
220
|
+
record non-blocking unknowns honestly, and proceed without asking the user to
|
|
221
|
+
predict its implementation behavior. The signal_v4 M3 Discovery may be used as
|
|
222
|
+
read-only style evidence, but its domain and identifiers must not be copied into
|
|
223
|
+
the candidate logic.
|
|
224
|
+
|
|
225
|
+
E2E acceptance requires the Milestone to reach final acceptance, all Tasks to be
|
|
226
|
+
terminal, repository state clean, no active or stale writer leases, no action
|
|
227
|
+
requiring human approval inside the granted semantic scope, and an evidence log
|
|
228
|
+
that identifies every command/action and final entity status without secrets.
|
|
229
|
+
The run must include at least one new supporting test source admitted through the
|
|
230
|
+
R7 atomic delegated context-refresh path; manually approving that source is not
|
|
231
|
+
acceptable passing evidence.
|
|
232
|
+
|
|
233
|
+
## Ownership and integration
|
|
234
|
+
|
|
235
|
+
- Main coordinator: owns this Brief, integration, local tarball, isolated E2E,
|
|
236
|
+
final evidence, and all decisions that cross file ownership.
|
|
237
|
+
- State-machine implementer: owns production changes in `src/` and directly
|
|
238
|
+
related contracts/reference documentation. Must not edit E2E evidence.
|
|
239
|
+
- E2E/test owner: owns deterministic regression tests, fixtures, and isolated E2E
|
|
240
|
+
harness documentation/scripts. Must not change production semantics without a
|
|
241
|
+
written finding to the coordinator.
|
|
242
|
+
- Independent auditor: starts only after implementation and E2E evidence are
|
|
243
|
+
complete; reviews Brief-to-diff traceability, test validity, release artifacts,
|
|
244
|
+
and residual risks without editing implementation files.
|
|
245
|
+
|
|
246
|
+
All contributors share the worktree, must preserve concurrent edits, and must not
|
|
247
|
+
revert changes they did not create.
|
|
248
|
+
|
|
249
|
+
## Stop-loss and release gate
|
|
250
|
+
|
|
251
|
+
All local iterations retain version `2.0.0-alpha.7.1`; individual failures do not
|
|
252
|
+
create alpha.7.2/alpha.7.3 versions. No publication occurs until deterministic
|
|
253
|
+
replay, the real-agent Milestone, and independent audit all pass.
|
|
254
|
+
|
|
255
|
+
If real-agent execution cannot be completed because Codex cannot be launched with
|
|
256
|
+
the required isolation or cannot exercise a deterministic failure seam, that is
|
|
257
|
+
a release blocker, not permission to substitute a mocked test.
|
|
258
|
+
|
|
259
|
+
## Deliverables
|
|
260
|
+
|
|
261
|
+
1. This Brief.
|
|
262
|
+
2. Generic source diff and reference documentation.
|
|
263
|
+
3. Deterministic replay and all package validation evidence.
|
|
264
|
+
4. Local alpha.7.1 tarball identity and downstream installation evidence.
|
|
265
|
+
5. Real-agent E2E evidence through Milestone final acceptance.
|
|
266
|
+
6. Independent audit with every finding resolved or explicitly accepted by the
|
|
267
|
+
user.
|
|
268
|
+
7. Remaining risks and a release recommendation. No tag, push, or publish.
|
|
@@ -75,14 +75,18 @@ start another implementation loop.
|
|
|
75
75
|
For guarded Steps, remediation attempts are also tracked in
|
|
76
76
|
`remediation-events.jsonl`. Two ordinary remediation attempts are allowed. A third ordinary
|
|
77
77
|
retry is blocked until `task corrective-decision` records a current corrective decision in
|
|
78
|
-
`corrective-decisions.jsonl`.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
`corrective-decisions.jsonl`. The corrective gate is derived from the guarded Step, current
|
|
79
|
+
Plan Risk Audit, remediation history, and corrective-decision history, so it remains visible
|
|
80
|
+
after content-only context refresh, Task Knowledge rebind, and reauthorization. `continue-fix`
|
|
81
|
+
allows bounded continuation; `replan-required` requires an actual new Plan posture before
|
|
82
|
+
execution; the other decisions stop or redirect ordinary execution. If that third, corrective
|
|
83
|
+
remediation review also fails, Core enters a hard stop: `next` must report the stop without
|
|
84
|
+
throwing, a fourth run and another `continue-fix`/`replan-required` decision are rejected,
|
|
85
|
+
and only `split-required` or `stop-escalate` may be recorded. At the corrective boundary,
|
|
86
|
+
`next` derives a distinct `agent:corrective-auditor:<task-id>` actor; selecting that actor is
|
|
87
|
+
not a human approval, while auditor independence remains mandatory.
|
|
88
|
+
|
|
89
|
+
## Atomic context refresh
|
|
86
90
|
|
|
87
91
|
When `next.contextRefresh` offers an exact option, a project-scoped delegate may run one
|
|
88
92
|
composite transition:
|
|
@@ -96,10 +100,20 @@ task context-refresh
|
|
|
96
100
|
```
|
|
97
101
|
|
|
98
102
|
The command requires the exact Task and Knowledge Map revisions, delegate actor, and grant.
|
|
99
|
-
Core validates both grant transitions
|
|
100
|
-
|
|
101
|
-
and conflicts are unchanged.
|
|
102
|
-
|
|
103
|
+
Core validates both grant transitions and the complete Knowledge diff before the first write.
|
|
104
|
+
The existing content-only path remains limited to an already approved source set whose category,
|
|
105
|
+
scope, authority, gaps, and conflicts are unchanged.
|
|
106
|
+
|
|
107
|
+
A Milestone Autonomy Grant may additionally admit a new supporting source when the current,
|
|
108
|
+
already execution-authorized Task Plan declares `knowledgeImpact: create` and the source's exact
|
|
109
|
+
normalized file path and scanner category in `knowledgeTargets`. Every added source must match;
|
|
110
|
+
wildcards and directory-like targets are not authority. The Task must belong to that exact
|
|
111
|
+
Milestone and the delegate and grant must still satisfy the immutable autonomy contract. Removed
|
|
112
|
+
sources, canonical additions, unplanned additions, changes to existing category/scope/authority
|
|
113
|
+
or classification identity, changed gaps, and changed or non-empty conflicts fail closed before
|
|
114
|
+
state is written. `next.contextRefresh.addedSources` exposes the exact eligible additions, while
|
|
115
|
+
`next.contextRefreshBlocked.unsafeDifferences` reports the concrete mismatches.
|
|
116
|
+
Standalone Project Memory approval is never enabled by this path.
|
|
103
117
|
|
|
104
118
|
## Chat ownership
|
|
105
119
|
|
|
@@ -142,8 +156,9 @@ scope change remains explicit and human-only through `milestone scope-change-pre
|
|
|
142
156
|
|
|
143
157
|
After the initial Plan, one human may approve a time-bound (maximum 72 hours) Milestone
|
|
144
158
|
Autonomy Contract. It creates a milestone-scoped grant for Task/Milestone execution and final
|
|
145
|
-
acceptance plus Project Memory approval only inside an atomic
|
|
146
|
-
|
|
159
|
+
acceptance plus Project Memory approval only inside an atomic Task context refresh for the same
|
|
160
|
+
Milestone. That refresh covers content-only drift and the exact Plan-bounded supporting-source
|
|
161
|
+
addition described above. Standalone Project Memory approval remains forbidden. The contract binds
|
|
147
162
|
the immutable outcome, success signal, acceptance, checks, discovery, and base branch.
|
|
148
163
|
`milestone autonomy-evolve` may only alter Task memberships; it records the
|
|
149
164
|
agent actor plus the autonomy-contract event hash in the journaled scope-change sidecar and
|
package/package.json
CHANGED
|
@@ -121,10 +121,18 @@ fourth run is prohibited; only split or stop may be recorded.
|
|
|
121
121
|
|
|
122
122
|
## Context refresh
|
|
123
123
|
|
|
124
|
+
Before `task plan-set`, compare exact Step `allowedWrites` and expected output paths with scanner
|
|
125
|
+
classifications. A planned new scanner-visible Knowledge file must be declared with
|
|
126
|
+
`knowledgeImpact: create` and an exact path/category `knowledgeTargets` entry. Wildcards,
|
|
127
|
+
directories, and inferred authority are not declarations; only Core may decide whether the final
|
|
128
|
+
diff is eligible for delegated refresh.
|
|
129
|
+
|
|
124
130
|
Use `task context-refresh` only when the same `next` response exposes `contextRefresh` for the
|
|
125
131
|
exact grant. Pass Task revision, map revision, delegate actor, and grant ID. The composite
|
|
126
|
-
operation
|
|
127
|
-
|
|
132
|
+
operation accepts content-hash-only drift and, under a Milestone Autonomy Grant, an exact
|
|
133
|
+
supporting-source addition predeclared by the current execution-authorized Task Plan. Core checks
|
|
134
|
+
the full fail-closed predicate; do not reconstruct it in the gateway. When `next` instead returns
|
|
135
|
+
`contextRefreshBlocked.unsafeDifferences`, keep the change on the normal visible Knowledge path.
|
|
128
136
|
|
|
129
137
|
Before updating the installed package, run `update preflight`. Continue only for `safe=true`.
|
|
130
138
|
For an alpha.6 project trapped between a pending strict review and forbidden Knowledge rebind,
|
|
@@ -171,8 +179,9 @@ codex-workflow milestone autonomy-grant --repo <git-root> --id <MS-ID> \
|
|
|
171
179
|
```
|
|
172
180
|
|
|
173
181
|
The contract issues a milestone-scoped grant for the existing Task/Milestone approval transitions
|
|
174
|
-
and Project Memory approval only inside an atomic
|
|
175
|
-
|
|
182
|
+
and Project Memory approval only inside an atomic Task context refresh for the same Milestone.
|
|
183
|
+
That composite path covers content-only drift plus exact Plan-bounded supporting-source additions;
|
|
184
|
+
it cannot approve Project Memory independently. `milestone autonomy-evolve --file
|
|
176
185
|
<plan.json>` is permitted only when outcome, success signal, acceptance, checks, discovery, and
|
|
177
186
|
base branch still match the contract. It journals agent actor plus contract evidence and requires
|
|
178
187
|
reauthorization afterward.
|
|
@@ -43,9 +43,19 @@ classifications, hashes, gaps, conflicts, and approval evidence.
|
|
|
43
43
|
|
|
44
44
|
Do not create a memory directory or write project files during scan.
|
|
45
45
|
|
|
46
|
+
Before `task plan-set`, the Technical Planner compares every exact `allowedWrites` and expected
|
|
47
|
+
output path with the package scanner classifications. If the Plan will create a file that the
|
|
48
|
+
scanner will treat as Project Knowledge (for example a test or documentation source), declare
|
|
49
|
+
`knowledgeImpact: create` and one `knowledgeTargets` entry with that exact normalized path and
|
|
50
|
+
scanner category. Do not replace the path with a wildcard or directory, do not infer or assign
|
|
51
|
+
authority, and do not claim delegated-refresh eligibility; Core decides eligibility from the
|
|
52
|
+
resulting repository diff and current authorization state.
|
|
53
|
+
|
|
46
54
|
When `next` exposes an exact delegated `contextRefresh`, use `task context-refresh` only for
|
|
47
|
-
the returned Task/map revisions, actor, and grant.
|
|
48
|
-
|
|
55
|
+
the returned Task/map revisions, actor, and grant. A source-set change is eligible only when
|
|
56
|
+
Core identifies it as a Plan-bounded supporting-source addition under the same Milestone
|
|
57
|
+
Autonomy Grant. Never infer eligibility from the Plan yourself; if Core returns
|
|
58
|
+
`contextRefreshBlocked.unsafeDifferences`, use the ordinary visible Knowledge Map flow.
|
|
49
59
|
|
|
50
60
|
## Product Or Workflow Graph Refresh
|
|
51
61
|
|
|
@@ -112,8 +122,10 @@ For an entire Milestone, prefer one bounded `milestone autonomy-prepare` gate af
|
|
|
112
122
|
initial membership Plan exists. Show principal, delegate, expiry, semantic-scope hash, policy
|
|
113
123
|
hash, and `MAC-*` code, then stop. A later exact approval permits `milestone autonomy-grant`.
|
|
114
124
|
The resulting grant covers the existing Task/Milestone approval transitions and the Project
|
|
115
|
-
Memory approval portion of an atomic
|
|
116
|
-
|
|
125
|
+
Memory approval portion of an atomic Task context refresh for the same Milestone. Besides
|
|
126
|
+
content-only drift, Core may accept exact supporting-source additions predeclared by the current
|
|
127
|
+
execution-authorized Task Plan; unsafe differences remain blocked. The contract never permits
|
|
128
|
+
standalone Project Memory approval. It also permits `milestone autonomy-evolve`
|
|
117
129
|
only for membership changes; any change to outcome, success signal, acceptance, checks,
|
|
118
130
|
discovery, or base branch requires the ordinary human scope-change gate. Never self-renew or
|
|
119
131
|
replace the contract.
|
|
@@ -37,11 +37,16 @@ bindings, supersedes execution authorization, and returns the Task to
|
|
|
37
37
|
`awaiting_execution_authorization`. It cannot run while a Step is `in_progress` or while the
|
|
38
38
|
Task is `blocked`; unrelated blocks must be resolved through their owning transition.
|
|
39
39
|
|
|
40
|
-
For guarded remediation, two ordinary remediation attempts are allowed.
|
|
40
|
+
For guarded remediation, two ordinary remediation attempts are allowed. Corrective posture is
|
|
41
|
+
derived from the guarded Step, current Plan Risk Audit, remediation history, and
|
|
42
|
+
corrective-decision history rather than from `Task.status` alone, so the same gate survives
|
|
43
|
+
content-only Knowledge refresh, Task Knowledge rebind, and later reauthorization. A third
|
|
41
44
|
ordinary retry is blocked until a current corrective decision exists for the same Step and
|
|
42
|
-
Plan binding. `continue-fix` allows
|
|
43
|
-
`split-required
|
|
44
|
-
|
|
45
|
+
Plan binding. `continue-fix` allows exactly the third corrective attempt; `replan-required`
|
|
46
|
+
requires an actual new Plan posture before execution; `split-required` and `stop-escalate`
|
|
47
|
+
stop ordinary execution. A failed third corrective attempt is a hard stop: `next` must
|
|
48
|
+
report the stop without throwing, no fourth run is allowed, and no new `continue-fix` or
|
|
49
|
+
`replan-required` decision is accepted.
|
|
45
50
|
|
|
46
51
|
Milestone authorization is bound to its Plan and membership revision. Plan amendments
|
|
47
52
|
supersede authorization. Milestone validation and acceptance are bound to the current base
|
|
@@ -62,8 +67,14 @@ After that boundary, semantic updates use human-only `milestone scope-change-pre
|
|
|
62
67
|
`milestone scope-change-apply`. A human-confirmed, expiring Milestone Autonomy Contract may
|
|
63
68
|
use `milestone autonomy-evolve` only for membership changes while outcome, success signal,
|
|
64
69
|
acceptance, checks, discovery, and base branch remain fixed. It may also approve Project Memory
|
|
65
|
-
only within an atomic
|
|
66
|
-
|
|
70
|
+
only within an atomic context refresh for a Task in that Milestone; standalone map approval
|
|
71
|
+
remains forbidden. In addition to content-only drift, that composite transition may accept a new
|
|
72
|
+
supporting source only when its exact normalized path and scanner category were declared by the
|
|
73
|
+
current execution-authorized Task Plan under `knowledgeImpact: create`. The Task must belong to
|
|
74
|
+
the grant's Milestone. Every added source must match the Plan, and removals, canonical additions,
|
|
75
|
+
wildcard or directory targets, existing source category/scope/authority changes, gaps, and
|
|
76
|
+
conflicts fail closed before any state write. `next` exposes the composite option only when the
|
|
77
|
+
full predicate passes and otherwise reports concrete unsafe differences. Both update paths journal
|
|
67
78
|
`state.json`, `plan.json`, and `scope-change-events.jsonl` together. Membership integrity is validated
|
|
68
79
|
before scheduling, Task start, Milestone validation, scope change, and repository `next`.
|
|
69
80
|
The same guard scans in reverse and blocks every live Task whose `milestoneId` is absent from
|