codex-workflow-v2 2.0.0-alpha.2 → 2.0.0-alpha.3

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.
@@ -0,0 +1,154 @@
1
+ # Обновление Workflow V2 в начатом проекте через Codex
2
+
3
+ Эта инструкция предназначена для проекта, где Workflow V2 уже создал Discovery, Tasks или
4
+ Milestones. Пользователь не выполняет команды самостоятельно: все проверки, установка и
5
+ Git-операции поручаются Codex.
6
+
7
+ ## Что обновляется, а что сохраняется
8
+
9
+ Версия `codex-workflow-v2` закреплена точным значением в `package.json` и lock-файле каждого
10
+ проекта. Поэтому разные проекты могут использовать разные версии. Обновление одного проекта
11
+ не переключает остальные.
12
+
13
+ Состояние Workflow хранится отдельно от репозитория в
14
+ `$CODEX_HOME/workflow-state/v2/projects/<project-id>`. Оно определяется идентичностью Git
15
+ репозитория, а не версией npm-пакета. Обычное совместимое обновление заменяет зависимость и
16
+ gateway, но не удаляет и не пересоздаёт это состояние. Уже принятые Milestones, ревизии,
17
+ авторизации, evidence и Results сохраняются.
18
+
19
+ Никогда не разрешайте агенту вручную редактировать, переносить или удалять внешний state.
20
+ Команда миграции нужна только тогда, когда документация новой версии прямо сообщает о новой
21
+ state schema. Совпадение `stateSchemaVersion` до и после обновления означает, что миграция не
22
+ нужна.
23
+
24
+ ## 1. Подготовьте отдельный чат обновления
25
+
26
+ Не обновляйте пакет во время выполняющегося Worker Step. Дождитесь завершения текущего ответа
27
+ Codex и откройте в нужном проекте отдельный чат `Workflow update`.
28
+
29
+ Передайте агенту этот промпт, заменив `<НОВАЯ_ВЕРСИЯ>` точной опубликованной версией:
30
+
31
+ ```text
32
+ Обнови Codex Workflow V2 в этом проекте до точной версии <НОВАЯ_ВЕРСИЯ>
33
+ из npm: https://www.npmjs.com/package/codex-workflow-v2.
34
+
35
+ Все команды выполняешь ты. Сначала прочитай AGENTS.md и определи Git root.
36
+ До изменений запусти project-local gateway handshake, doctor, status и next;
37
+ зафиксируй текущую версию, protocolVersion, stateSchemaVersion, projectId,
38
+ активные сущности и наличие writer lease. Если Worker сейчас выполняется,
39
+ остановись без обновления.
40
+
41
+ Обнови только точную npm-зависимость и lock-файл, без диапазона версий.
42
+ Не удаляй и не редактируй вручную $CODEX_HOME/workflow-state/v2.
43
+ Не запускай state migration, если stateSchemaVersion не изменилась.
44
+ После установки проверь совпадение declared и installed версии, выполни
45
+ handshake, doctor, status и next новой версией. Затем установи или обнови
46
+ персональный codex-workflow-gateway из установленного npm-пакета штатным
47
+ installer скриптом. Покажи diff файлов репозитория и результаты проверок.
48
+ Не начинай продуктовую реализацию в этом чате.
49
+ ```
50
+
51
+ Агенту может потребоваться ваше разрешение на установку npm-зависимости и запись персонального
52
+ plugin за пределами workspace. Это ожидаемая граница безопасности Codex, а не миграция state.
53
+
54
+ ## 2. Проверьте отчёт чата обновления
55
+
56
+ До завершения чат должен подтвердить:
57
+
58
+ 1. В `package.json` указана точная версия без `^`, `~`, `latest` или `next`.
59
+ 2. Lock-файл и фактически установленный пакет содержат ту же версию.
60
+ 3. Handshake возвращает ожидаемые package/protocol/state-schema версии.
61
+ 4. `doctor` не сообщает о несовместимой зависимости или повреждённом state.
62
+ 5. `projectId` совпадает со значением до обновления.
63
+ 6. Существующие Task/Milestone ID, revisions и terminal statuses сохранились.
64
+ 7. Персональный gateway обновлён из установленного пакета.
65
+
66
+ Изменение `projectId`, исчезновение сущностей или ошибка unsupported state schema — причина
67
+ остановиться. Не соглашайтесь на «починку» удалением state. Агент должен вернуть dependency к
68
+ предыдущей точной версии либо ждать официального мигратора.
69
+
70
+ ## 3. Откройте новый чат после установки gateway
71
+
72
+ Codex загружает набор skills/plugin при старте чата. Уже открытый чат может продолжать видеть
73
+ старую gateway-инструкцию, даже если файлы plugin обновлены. Поэтому дальнейшую работу всегда
74
+ начинайте в новом чате проекта.
75
+
76
+ Промпт для контрольного чата:
77
+
78
+ ```text
79
+ Возобнови проект через установленный Codex Workflow V2.
80
+ Все команды выполняешь ты. Начни с AGENTS.md, project-local gateway
81
+ handshake, doctor, status и next. Подтверди точную declared/installed
82
+ версию, protocolVersion, stateSchemaVersion и прежний projectId.
83
+
84
+ Проверь Knowledge Map штатно. Если изменение package.json или lock-файла
85
+ сделало карту stale, выполни scan/reconcile и покажи мне классификацию и
86
+ изменения до approve. Не редактируй внешний workflow-state вручную.
87
+ Следуй только текущему ответу next и остановись перед любой human gate.
88
+ ```
89
+
90
+ Обновление dependency меняет `package.json` и обычно lock-файл. Если один из этих файлов входит
91
+ в Knowledge Map, изменение его content hash штатно делает карту `stale`. Это не потеря state:
92
+ нужно выполнить `scan/reconcile`, показать пользователю изменения классификации и получить
93
+ approval, если он требуется.
94
+
95
+ ## 4. Продолжите начатый Milestone или создайте следующий
96
+
97
+ Terminal Milestone со статусом `accepted` остаётся закрытым. Для следующего результата нужно
98
+ начать новый Discovery и материализовать новый Milestone; переписывать историю предыдущего не
99
+ следует.
100
+
101
+ Промпт для планирования следующего Milestone:
102
+
103
+ ```text
104
+ Создай следующий Milestone проекта через Workflow V2.
105
+ Все команды выполняешь ты. Начни с AGENTS.md, gateway handshake, doctor,
106
+ status и next. Проверь Knowledge Map штатно и показывай мне её смысловые
107
+ изменения до approve.
108
+
109
+ Проведи Discovery: outcome, scope, out-of-scope, acceptance, constraints,
110
+ unknowns и success signal. Не materialize сущность при blocking unknowns.
111
+ После согласования создай Milestone и тонкие связанные Tasks, подготовь
112
+ membership Plan и покажи его мне для execution authorization. После моей
113
+ явной авторизации доведи Milestone до active, выдай порядок required Tasks
114
+ и остановись. Реализацию в этом чате не начинай.
115
+ ```
116
+
117
+ ## 5. Как теперь закрывается Milestone
118
+
119
+ После merge всех `required` Tasks откройте отдельный чат финальной проверки:
120
+
121
+ ```text
122
+ Возобнови Milestone <MS-ID> и подготовь его к финальному принятию.
123
+ Все команды и проверки выполняешь ты. Начни с AGENTS.md, handshake,
124
+ doctor, status и next. Проверь, что все current required memberships merged,
125
+ выполни штатную Milestone validation и покажи Result, evidence, checks и
126
+ validated HEAD.
127
+
128
+ Когда next вернёт requiredHumanGate, покажи мне все связанные поля и код
129
+ подтверждения, запроси моё явное final acceptance и заверши ответ. Не
130
+ вызывай milestone accept в этом же ответе и не считай этот промпт заранее
131
+ выданным согласием.
132
+ ```
133
+
134
+ После этого Codex должен остановиться. Если результат устраивает, ответьте отдельным сообщением:
135
+
136
+ ```text
137
+ Принимаю Milestone <MS-ID> для revision <REVISION> с кодом <MSA-CODE>.
138
+ Выполни штатный final acceptance и подтверди status accepted.
139
+ ```
140
+
141
+ Код связан с Milestone ID, revision, Plan hash, Result hash, evidence hash и validated HEAD.
142
+ Если любой из них изменился, старый код недействителен и агент должен повторно показать новую
143
+ границу принятия.
144
+
145
+ ## 6. Проверка исправленного `next`
146
+
147
+ `next` не должен возвращать незапущенную историческую Task, если её текущее membership имеет
148
+ disposition `waived`/`cancelled` либо её Milestone уже `accepted`/`cancelled`. Для активного
149
+ Milestone он выбирает только `required` Tasks. Уже начатая Task может завершить допустимый
150
+ переход, поэтому её наличие анализируется отдельно от незапущенной истории.
151
+
152
+ Если после совместимого обновления `next` всё ещё показывает неподходящую Task, агент должен
153
+ собрать `status`, целевые Task/Milestone state и memberships и остановиться с диагностикой. Не
154
+ следует вручную менять JSON state или обходить transition checks.
@@ -1,20 +1,26 @@
1
1
  # V2 Alpha Validation Report
2
2
 
3
- Release candidate `2.0.0-alpha.2` was validated on 2026-08-08 with Node.js 24.17.0.
3
+ Release candidate `2.0.0-alpha.3` was validated on 2026-08-12 with Node.js 24.17.0.
4
4
 
5
5
  - TypeScript typecheck and build passed.
6
- - All 37 unit and integration tests passed. Coverage includes the complete Task lifecycle,
6
+ - All 41 unit and integration tests passed. Coverage includes the complete Task lifecycle,
7
7
  a Project Knowledge Map change between Steps, preservation of completed Step evidence,
8
8
  mandatory reauthorization, the public `task knowledge-rebind` CLI route, no-op and active
9
9
  Worker rejection, current gateway capability negotiation, and rejection of deprecated
10
10
  state schema instead of migration.
11
- - Milestone amendments and acceptance, graph binding, deterministic V1 snapshot, symlink
12
- rejection, writer leases, and strict reviewer fail-closed behavior also passed.
13
- - npm dry-run packaging produced `codex-workflow-v2-2.0.0-alpha.2.tgz` with runtime, schemas,
11
+ - Milestone scheduling now ignores unstarted Tasks with cancelled/waived or terminal
12
+ membership paths. Final Milestone acceptance exposes a revision/hash/HEAD-bound human gate,
13
+ rejects a wrong code, and regenerates its code after base advancement and revalidation.
14
+ - Milestone amendments, graph binding, deterministic V1 snapshot, symlink rejection, writer
15
+ leases, and strict reviewer fail-closed behavior also passed.
16
+ - npm dry-run packaging produced `codex-workflow-v2-2.0.0-alpha.3.tgz` with runtime, schemas,
14
17
  roles, references, docs, and plugin source.
15
18
  - Downstream installation from that tarball and the packaged CLI handshake passed; the
16
19
  installation created none of the forbidden repository workflow directories.
17
- - Plugin validation and the repository release check passed for `2.0.0-alpha.2`.
20
+ - Plugin validation and the repository release check passed for `2.0.0-alpha.3`.
21
+ - The alpha.3 CLI read the existing Signal project state created by alpha.2 without migration:
22
+ project ID and accepted Milestone 1 were preserved, while repository-level `next` returned
23
+ `idle` instead of the historical cancelled Task.
18
24
 
19
25
  The strict reviewer implementation did not change in this release candidate. Its original
20
26
  2026-07-16 real Codex CLI isolation probe denied a repository write and returned
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-workflow-v2",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.3",
4
4
  "description": "Requirements-first Codex development workflow with local state and explicit Git ownership.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,6 +11,23 @@ codex-workflow gateway handshake --repo <git-root>
11
11
  Require package name `codex-workflow-v2`, protocol version `1`, state
12
12
  schema version `2`, and the capabilities needed for the requested operation. Task execution
13
13
  that may cross a Project Knowledge Map revision requires `task-knowledge-rebind-v1`.
14
+ Milestone final acceptance requires `milestone-human-final-gate-v1`.
15
+
16
+ ## Milestone Human Gate
17
+
18
+ At `awaiting_final_acceptance`, `next` returns `requiredHumanGate` with kind
19
+ `milestone_final_acceptance`, Milestone ID, revision, Plan/Result/evidence hashes, validated
20
+ HEAD, and a confirmation code. Display the complete object and end the turn. Only a later
21
+ explicit user message that approves the same code authorizes:
22
+
23
+ ```text
24
+ codex-workflow milestone accept --repo <git-root> --id <MS-ID> \
25
+ --expected-revision <REVISION> --actor <USER-ACTOR> \
26
+ --confirmation-code <MSA-CODE>
27
+ ```
28
+
29
+ Do not infer approval from the request that initiated validation. A changed revision, hash,
30
+ or HEAD requires a new gate.
14
31
 
15
32
  ## Graph Refresh Request
16
33
 
@@ -45,7 +45,7 @@ Do not create a memory directory or write project files during scan.
45
45
  3. Stop for user selection when more than one project remains plausible.
46
46
  4. Check `index_status`; call `index_repository` with the request source root,
47
47
  mode, and `persistence: false` when missing or stale.
48
- 5. Build evidence exactly as specified in `references/protocol.md`.
48
+ 5. Build evidence exactly as specified in `../../references/protocol.md`.
49
49
  6. Pipe `{ "request": ..., "evidence": ... }` to `graph bind --stdin`, passing
50
50
  the current binding revision when one exists.
51
51
 
@@ -62,6 +62,19 @@ independently blocks the workflow.
62
62
  - Independent Reviewer: receives recorded evidence and confirms critical
63
63
  claims against files, Git, and tests.
64
64
 
65
+ ## Human Gates
66
+
67
+ Treat `requiredHumanGate` from the project-local package as a mandatory turn boundary.
68
+ For `milestone_final_acceptance`, show the user the Milestone ID, revision, Plan hash,
69
+ Result hash, evidence hash, validated HEAD, and confirmation code. Ask whether the user
70
+ accepts that exact result, then stop without invoking `milestone accept`.
71
+
72
+ Only after a later user message explicitly approves and repeats the same confirmation code
73
+ may you invoke `milestone accept` with explicit `--actor` and `--confirmation-code` values.
74
+ A generic instruction such as “continue”, “finish”, or “bring it to final status” is not
75
+ final acceptance. If `next` returns a different code or binding, discard the old response
76
+ and ask again.
77
+
65
78
  ## Stop Conditions
66
79
 
67
80
  - Dependency version is missing, ranged, or differs from the installed package.
@@ -70,3 +83,5 @@ independently blocks the workflow.
70
83
  - A request changes before evidence is bound.
71
84
  - An action would make MCP or the local map authoritative project memory.
72
85
  - A requested mutation is not authorized by the package CLI state.
86
+ - A human gate was emitted but the user has not approved its exact confirmation code in a
87
+ later message.
@@ -15,4 +15,14 @@ Task is `blocked`; unrelated blocks must be resolved through their owning transi
15
15
 
16
16
  Milestone authorization is bound to its Plan and membership revision. Plan amendments
17
17
  supersede authorization. Milestone validation and acceptance are bound to the current base
18
- HEAD; cancellation records intent but performs no Git reversal.
18
+ HEAD. In `awaiting_final_acceptance`, `next` returns a state-bound human gate. The agent must
19
+ display its revision, hashes, HEAD, and confirmation code, then end the turn. Acceptance is
20
+ valid only after a later explicit user response repeats that code; the CLI requires both an
21
+ explicit actor and the exact code. Cancellation records intent but performs no Git reversal.
22
+ If the base HEAD or final artifacts change before acceptance, `next` withholds the gate and
23
+ requires Milestone validation again; revalidation supersedes the previous candidate binding.
24
+
25
+ Repository-level scheduling respects current Milestone membership. An unstarted linked Task
26
+ is eligible only for an `active` Milestone with `required` disposition. Historical unstarted
27
+ Tasks from `waived`, `cancelled`, accepted, or cancelled Milestone paths cannot shadow the
28
+ Milestone/repository transition returned by `next`.
@@ -11,3 +11,8 @@ configuration and rules ignored, a read-only sandbox, structured output, and an
11
11
  write probe. The core seals repository HEAD, status, and content before/after the process.
12
12
  Any process error, malformed output, successful write, or changed seal records an
13
13
  `unverified` review and blocks Result creation and final acceptance.
14
+
15
+ Milestone validation similarly binds Result and evidence to the clean base HEAD. Its final
16
+ acceptance is a separate turn: `next` emits a confirmation code bound to the current
17
+ revision, Plan, Result, evidence, and HEAD; the coordinator shows it and stops. A later user
18
+ response must explicitly approve that exact code before the CLI transition is invoked.
@@ -8,5 +8,10 @@ Own state transitions, dispatch envelopes, evidence collection, and recovery gui
8
8
  - Own derived map revisions and context selection, but never edit the meaning of canonical project files.
9
9
  - Treat CLI `status`, `next`, revision, and lock state as authoritative machine state.
10
10
  - Never bypass authorization, scope checks, failed validation, or stale review.
11
+ - When `next.requiredHumanGate` is present, show every bound field and confirmation code,
12
+ request the user's explicit decision, and end the turn. Never call the acceptance command
13
+ in the same turn that produced or displayed the gate.
14
+ - Accept a Milestone only after a later user message explicitly approves that exact
15
+ confirmation code. Do not infer approval from a request to validate, finish, or continue.
11
16
  - Dispatch one Worker at a time for a concrete Step.
12
17
  - Do not make product-scope decisions or implement production changes.