code-ai-installer 4.1.0 → 4.3.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 +4 -1
- package/dist/index.js +4 -6
- package/dist/mcp/audit_ledger.d.ts +10 -0
- package/dist/mcp/audit_ledger.js +15 -0
- package/dist/mcp/cli.d.ts +5 -1
- package/dist/mcp/cli.js +10 -2
- package/dist/mcp/tools/render_diff.d.ts +25 -0
- package/dist/mcp/tools/render_diff.js +138 -0
- package/dist/mcp/tools/sign_off.js +10 -5
- package/dist/mcp/tools/stubs.js +2 -0
- package/dist/mcp_setup.d.ts +9 -4
- package/dist/mcp_setup.js +40 -13
- package/dist/shared/tools.d.ts +38 -0
- package/dist/shared/tools.js +24 -0
- package/dist/version.d.ts +8 -0
- package/dist/version.js +13 -0
- package/domains/analytics/agents/conductor.md +15 -1
- package/domains/analytics/locales/en/agents/conductor.md +15 -1
- package/domains/content/agents/conductor.md +15 -1
- package/domains/content/locales/en/agents/conductor.md +15 -1
- package/domains/development/.agents/skills/mcp-integration/SKILL.md +3 -1
- package/domains/development/.agents/workflows/audit.md +25 -0
- package/domains/development/.agents/workflows/pipeline-rules.md +1 -0
- package/domains/development/AGENTS.md +1 -0
- package/domains/development/agents/architect.md +1 -1
- package/domains/development/agents/auditor.md +4 -3
- package/domains/development/agents/conductor.md +4 -1
- package/domains/development/agents/devops.md +1 -1
- package/domains/development/agents/reviewer.md +2 -1
- package/domains/development/agents/senior_full_stack.md +1 -1
- package/domains/development/agents/tester.md +1 -1
- package/domains/development/locales/en/.agents/skills/mcp-integration/SKILL.md +3 -1
- package/domains/development/locales/en/.agents/workflows/audit.md +25 -0
- package/domains/development/locales/en/.agents/workflows/pipeline-rules.md +1 -0
- package/domains/development/locales/en/AGENTS.md +2 -0
- package/domains/development/locales/en/agents/architect.md +1 -1
- package/domains/development/locales/en/agents/auditor.md +4 -3
- package/domains/development/locales/en/agents/conductor.md +4 -1
- package/domains/development/locales/en/agents/devops.md +1 -1
- package/domains/development/locales/en/agents/reviewer.md +2 -1
- package/domains/development/locales/en/agents/senior_full_stack.md +1 -1
- package/domains/development/locales/en/agents/tester.md +1 -1
- package/domains/product/agents/conductor.md +15 -1
- package/domains/product/locales/en/agents/conductor.md +15 -1
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The installed `code-ai-installer` package version — the single source for the
|
|
3
|
+
* CLI `--version`, the MCP server registration pin, and the server startup
|
|
4
|
+
* banner. Resolves `package.json` relative to THIS module (dist/version.js →
|
|
5
|
+
* ../package.json = package root), so every caller gets the right path
|
|
6
|
+
* regardless of its own depth in the tree.
|
|
7
|
+
*/
|
|
8
|
+
export declare function readInstallerVersion(): string;
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
/**
|
|
3
|
+
* The installed `code-ai-installer` package version — the single source for the
|
|
4
|
+
* CLI `--version`, the MCP server registration pin, and the server startup
|
|
5
|
+
* banner. Resolves `package.json` relative to THIS module (dist/version.js →
|
|
6
|
+
* ../package.json = package root), so every caller gets the right path
|
|
7
|
+
* regardless of its own depth in the tree.
|
|
8
|
+
*/
|
|
9
|
+
export function readInstallerVersion() {
|
|
10
|
+
const requireJson = createRequire(import.meta.url);
|
|
11
|
+
const pkg = requireJson("../package.json");
|
|
12
|
+
return pkg.version;
|
|
13
|
+
}
|
|
@@ -5,7 +5,7 @@ domain: analytics
|
|
|
5
5
|
signs_off_at:
|
|
6
6
|
- RELEASE_GATE
|
|
7
7
|
tool_allowlist: role:conductor
|
|
8
|
-
budget_lines:
|
|
8
|
+
budget_lines: 473
|
|
9
9
|
schema_version: 1
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -360,6 +360,20 @@ $handoff → RES-02 (Researcher Beta).
|
|
|
360
360
|
|
|
361
361
|
---
|
|
362
362
|
|
|
363
|
+
## MCP-интеграция и операционные гарантии
|
|
364
|
+
|
|
365
|
+
Дирижёр оркестрирует весь поток гейтов через машину состояний `code-ai` MCP — общий поток см. в `analytics-pipeline-rules.md` § «Машина гейтов (code-ai MCP)». Conductor-specific операционные гарантии:
|
|
366
|
+
|
|
367
|
+
- **Оркестрация гейтов** — Дирижёр ведёт последовательность гейтов выбранного режима через MCP: `classify_gate` (на какой гейт ложится задача), `current_gate` (где сейчас), `advance_gate` (переход к следующему гейту только после deliverable + Handoff Envelope). Переход без полного Handoff Envelope → `advance_gate` блокирует.
|
|
368
|
+
- **`sign_off` — все гейты `user`, Дирижёр не подписывает за пользователя** — в аналитике каждый гейт закрывает ПОЛЬЗОВАТЕЛЬ. Дирижёр ОСТАНАВЛИВАЕТСЯ, показывает артефакт гейта и запрашивает `sign_off(signer="user")` — по одному гейту, без батчинга нескольких подтверждений, и не начинает работу следующего гейта, пока текущий не подписан. Авто-пас на зелёном не применяется (домен суждения, детерминированных авто-чеков нет).
|
|
369
|
+
- **RELEASE_GATE** фиксируется как `sign_off(gate="RELEASE_GATE", signer="user", decision=..., evidence=<RG checklist>)` — не «прозой».
|
|
370
|
+
- **`request_decision` для эскалаций** — конфликты между агентами и waiver'ы обязательных пунктов: `request_decision(...)` → решает пользователь → `record_decision`. См. § Conflict Resolution Protocol.
|
|
371
|
+
- **`record_decision` для ADR-достойных решений** — зафиксированные конфликты и отклонения от брифа, согласованные с пользователем: `record_decision(signer="user", domain="analytics", task_id, decision_text)`.
|
|
372
|
+
- **Circuit breaker отключён** — в аналитике нет полосы откатов в стиле development (DEV/REV/OPS/TEST); возвраты идут через reverse `$handoff` (см. Reverse Handoff).
|
|
373
|
+
- **Degraded mode** — если MCP-поток недоступен: Дирижёр ведёт Master Checklist (`$board`) и статусы Handoff Envelope вручную, sign-off фиксируется явным "Approved" пользователя, эскалации — вручную.
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
363
377
|
## Формат ответа агента
|
|
364
378
|
|
|
365
379
|
### Full Pipeline
|
|
@@ -5,7 +5,7 @@ domain: analytics
|
|
|
5
5
|
signs_off_at:
|
|
6
6
|
- RELEASE_GATE
|
|
7
7
|
tool_allowlist: role:conductor
|
|
8
|
-
budget_lines:
|
|
8
|
+
budget_lines: 471
|
|
9
9
|
schema_version: 1
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -358,6 +358,20 @@ If an agent's submission encounters `$gates` failure:
|
|
|
358
358
|
|
|
359
359
|
---
|
|
360
360
|
|
|
361
|
+
## MCP integration & operational guardrails
|
|
362
|
+
|
|
363
|
+
The Conductor orchestrates the whole gate-flow through the `code-ai` MCP state machine — for the general flow see `analytics-pipeline-rules.md` § "Gate machine (code-ai MCP)". Conductor-specific operational guardrails:
|
|
364
|
+
|
|
365
|
+
- **Gate-flow orchestration** — the Conductor drives the active mode's gate sequence through MCP: `classify_gate` (which gate the task lands on), `current_gate` (where we are now), `advance_gate` (move to the next gate only after the deliverable + Handoff Envelope). A transition without a complete Handoff Envelope → `advance_gate` blocks.
|
|
366
|
+
- **`sign_off` — all gates are `user`; the Conductor does not sign for the user** — in analytics every gate is closed by the USER. The Conductor STOPS, presents the gate artifact, and requests `sign_off(signer="user")` — one gate at a time, with no batching of approvals, and does NOT start next-gate work until the current one is signed. No auto-pass on green (a judgment domain, no deterministic auto-checks).
|
|
367
|
+
- **RELEASE_GATE** is recorded as `sign_off(gate="RELEASE_GATE", signer="user", decision=..., evidence=<RG checklist>)` — not prose approval.
|
|
368
|
+
- **`request_decision` for escalations** — conflicts between agents and waivers of mandatory items: `request_decision(...)` → the user decides → `record_decision`. See § Conflict Resolution Protocol.
|
|
369
|
+
- **`record_decision` for ADR-worthy outcomes** — recorded conflicts and brief deviations approved by the user: `record_decision(signer="user", domain="analytics", task_id, decision_text)`.
|
|
370
|
+
- **Circuit breaker disabled** — analytics has no development-style rollback lane (DEV/REV/OPS/TEST); returns go through reverse `$handoff` (see Reverse Handoff).
|
|
371
|
+
- **Degraded mode** — if the MCP flow is unavailable: the Conductor keeps the Master Checklist (`$board`) and Handoff Envelope statuses by hand, sign-off is recorded by the user's explicit "Approved", and escalations are manual.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
361
375
|
## Agent Response Template Format
|
|
362
376
|
|
|
363
377
|
### Full Pipeline Sequence
|
|
@@ -5,7 +5,7 @@ domain: content
|
|
|
5
5
|
signs_off_at:
|
|
6
6
|
- RELEASE_GATE
|
|
7
7
|
tool_allowlist: role:conductor
|
|
8
|
-
budget_lines:
|
|
8
|
+
budget_lines: 407
|
|
9
9
|
schema_version: 1
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -267,6 +267,20 @@ Conductor отслеживает соответствие контента ис
|
|
|
267
267
|
|
|
268
268
|
---
|
|
269
269
|
|
|
270
|
+
## MCP-интеграция и операционные гарантии
|
|
271
|
+
|
|
272
|
+
Дирижёр оркестрирует весь поток гейтов через машину состояний `code-ai` MCP — общий поток см. в `content-pipeline-rules.md` § «Машина гейтов (code-ai MCP)». Conductor-specific операционные гарантии:
|
|
273
|
+
|
|
274
|
+
- **Оркестрация гейтов** — Дирижёр ведёт последовательность гейтов выбранного режима через MCP: `classify_gate` (на какой гейт ложится задача), `current_gate` (где сейчас), `advance_gate` (переход к следующему гейту только после deliverable + Handoff Envelope). Переход без полного Handoff Envelope → `advance_gate` блокирует.
|
|
275
|
+
- **`sign_off` — все гейты `user`, Дирижёр не подписывает за пользователя** — в контенте каждый гейт закрывает ПОЛЬЗОВАТЕЛЬ. Дирижёр ОСТАНАВЛИВАЕТСЯ, показывает артефакт гейта и запрашивает `sign_off(signer="user")` — по одному гейту, без батчинга нескольких подтверждений, и не начинает работу следующего гейта, пока текущий не подписан. Авто-пас на зелёном не применяется (домен суждения, детерминированных авто-чеков нет).
|
|
276
|
+
- **RELEASE_GATE** фиксируется как `sign_off(gate="RELEASE_GATE", signer="user", decision=..., evidence=<RG checklist>)` — не «прозой».
|
|
277
|
+
- **`request_decision` для эскалаций** — конфликты между агентами и waiver'ы обязательных пунктов: `request_decision(...)` → решает пользователь → `record_decision`. См. § Conflict Resolution Protocol.
|
|
278
|
+
- **`record_decision` для ADR-достойных решений** — зафиксированные конфликты и отклонения от брифа, согласованные с пользователем: `record_decision(signer="user", domain="content", task_id, decision_text)`.
|
|
279
|
+
- **Circuit breaker отключён** — в контенте нет полосы откатов в стиле development (DEV/REV/OPS/TEST); возвраты идут через reverse `$handoff` (см. Reverse Handoff).
|
|
280
|
+
- **Degraded mode** — если MCP-поток недоступен: Дирижёр ведёт Master Checklist (`$board`) и статусы Handoff Envelope вручную, sign-off фиксируется явным "Approved" пользователя, эскалации — вручную.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
270
284
|
## Формат ответа Conductor (строго)
|
|
271
285
|
|
|
272
286
|
### Инициализация
|
|
@@ -5,7 +5,7 @@ domain: content
|
|
|
5
5
|
signs_off_at:
|
|
6
6
|
- RELEASE_GATE
|
|
7
7
|
tool_allowlist: role:conductor
|
|
8
|
-
budget_lines:
|
|
8
|
+
budget_lines: 407
|
|
9
9
|
schema_version: 1
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -267,6 +267,20 @@ If two agents disagree (Reviewer vs Copywriter on edits, Strategist vs Copywrite
|
|
|
267
267
|
|
|
268
268
|
---
|
|
269
269
|
|
|
270
|
+
## MCP integration & operational guardrails
|
|
271
|
+
|
|
272
|
+
The Conductor orchestrates the whole gate-flow through the `code-ai` MCP state machine — for the general flow see `content-pipeline-rules.md` § "Gate machine (code-ai MCP)". Conductor-specific operational guardrails:
|
|
273
|
+
|
|
274
|
+
- **Gate-flow orchestration** — the Conductor drives the active mode's gate sequence through MCP: `classify_gate` (which gate the task lands on), `current_gate` (where we are now), `advance_gate` (move to the next gate only after the deliverable + Handoff Envelope). A transition without a complete Handoff Envelope → `advance_gate` blocks.
|
|
275
|
+
- **`sign_off` — all gates are `user`; the Conductor does not sign for the user** — in content every gate is closed by the USER. The Conductor STOPS, presents the gate artifact, and requests `sign_off(signer="user")` — one gate at a time, with no batching of approvals, and does NOT start next-gate work until the current one is signed. No auto-pass on green (a judgment domain, no deterministic auto-checks).
|
|
276
|
+
- **RELEASE_GATE** is recorded as `sign_off(gate="RELEASE_GATE", signer="user", decision=..., evidence=<RG checklist>)` — not prose approval.
|
|
277
|
+
- **`request_decision` for escalations** — conflicts between agents and waivers of mandatory items: `request_decision(...)` → the user decides → `record_decision`. See § Conflict Resolution Protocol.
|
|
278
|
+
- **`record_decision` for ADR-worthy outcomes** — recorded conflicts and brief deviations approved by the user: `record_decision(signer="user", domain="content", task_id, decision_text)`.
|
|
279
|
+
- **Circuit breaker disabled** — content has no development-style rollback lane (DEV/REV/OPS/TEST); returns go through reverse `$handoff` (see Reverse Handoff).
|
|
280
|
+
- **Degraded mode** — if the MCP flow is unavailable: the Conductor keeps the Master Checklist (`$board`) and Handoff Envelope statuses by hand, sign-off is recorded by the user's explicit "Approved", and escalations are manual.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
270
284
|
## Conductor Response Format (Strict)
|
|
271
285
|
|
|
272
286
|
### Initialization
|
|
@@ -97,7 +97,7 @@ license: MIT
|
|
|
97
97
|
|
|
98
98
|
**`advance_gate`** — продвинуть задачу в следующий gate. **Только после** того как все artefacts текущего gate submitted и sign_off проставлен.
|
|
99
99
|
|
|
100
|
-
**`sign_off`** — подпись текущего gate. Sign_off без предыдущего `submit_artifact` — anti-pattern (см. §8). Сначала результат, потом подпись.
|
|
100
|
+
**`sign_off`** — подпись текущего gate. Sign_off без предыдущего `submit_artifact` — anti-pattern (см. §8). Сначала результат, потом подпись. **Кто подписывает — по `sign_off_policy` гейта:** user-гейты (PM/UX/ARCH/RG) требуют `signer="user"` — ОСТАНОВИСЬ и запроси подпись у пользователя, по одному гейту, без батчинга, и не начинай следующий gate пока текущий не подписан; исполнительские (DEV/REV/OPS/TEST, policy=either) можно подписать как `signer="mcp"` при выполненном DoD. Машина отвергнет `mcp`-подпись user-гейта.
|
|
101
101
|
|
|
102
102
|
**Канонический ритуал gate:** `current_gate` (понять где ты) → `classify_gate` → если fork: `request_decision` → ждёшь → `record_decision` → продолжаешь → `submit_artifact` → `verify_claim` (где применимо) → `sign_off` → `advance_gate`.
|
|
103
103
|
|
|
@@ -139,6 +139,8 @@ license: MIT
|
|
|
139
139
|
|
|
140
140
|
**`review_proposal`** — авторизовать переход статуса предложения (approve/reject для pending; пометить approved как applied) + обязательный отчёт. Применяет матрицу автономии + тумблер из `.code-ai/config.json`: `decided_by='auditor_auto'` может одобрить только low/additive и только при ВЫКЛЮЧЕННОМ гейте; destructive (high) и включённый гейт — всегда через user. Авто-добавление нового скила проходит дедуп-проверку: при пересечении с существующим скилом уходит к user, а не добавляется само. Только авторизация — сама запись в ассет это отдельный шаг submit_artifact/edit (см. next_step).
|
|
141
141
|
|
|
142
|
+
**`render_diff`** — отрендерить unified-diff (например вывод `git diff`) в цветную HTML-страницу ревью (по файлам, с номерами строк) в системный TEMP. Возвращает путь + `file://` URL для открытия в браузере. Зови на REV-гейте, чтобы показать изменения кода на ревью. Только информационный вывод — файл в TEMP (стирается при перезагрузке), проект не засоряет.
|
|
143
|
+
|
|
142
144
|
---
|
|
143
145
|
|
|
144
146
|
## 6. Группа 4 — Запись решений (6 инструментов + 1 служебный)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Прогон Аудитора — оценка агентов/скилов по накопленным прогонам и черновики улучшений. Вне пайплайна, код задачи не трогает.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /audit — проход Аудитора (мета / сопровождение)
|
|
6
|
+
|
|
7
|
+
Аудитор стоит СБОКУ от пайплайна: гейты не подписывает, задачу и код пользователя не трогает. Он оценивает, как сработали агенты / скилы / воркфлоу на реальных прогонах, и предлагает улучшения (или добавление новых). Полный контракт — в роли `auditor`.
|
|
8
|
+
|
|
9
|
+
## Когда запускать
|
|
10
|
+
- Вручную этой командой в любой момент — или по подсказке `audit_nudge`, которую `sign_off` возвращает после закрытия RG.
|
|
11
|
+
- Нужно **≥3 завершённых прогона** в леджере (`.code-ai/state/audit/runs.jsonl`). Меньше — данных мало, Аудитор молчит (малая выборка).
|
|
12
|
+
|
|
13
|
+
## Поток
|
|
14
|
+
1. `load_role auditor` — загрузить роль и её принципы (гипотезы, не вердикты; surfacing, не принуждение).
|
|
15
|
+
2. `aggregate_run_metrics` — сухие числа по агентам / воркфлоу / скилам. **Обязательно прочитать `notes`** — там честные ограничения данных.
|
|
16
|
+
3. Если `met_threshold=false` (прогонов <3) — остановиться, сообщить «данных мало», ничего не предлагать.
|
|
17
|
+
4. Сформировать находки-гипотезы. На каждое предложение — `propose_change` (`change_kind`: `edit_minor` / `add_asset` / `destructive`). Оно попадает в стор как `pending` и **ничего не меняет**.
|
|
18
|
+
5. Показать пользователю отчёт + `list_proposals` (что в очереди, с уровнем риска по матрице).
|
|
19
|
+
6. Применение — только через `review_proposal` (approve) + запись в ассет (`submit_artifact` / правка). Гейт одобрения по умолчанию включён: без явного решения человека ничего не применяется. `destructive` — всегда через человека.
|
|
20
|
+
|
|
21
|
+
## Принципы (из роли auditor)
|
|
22
|
+
- Гипотезы, не вердикты. Атрибуция со смирением (числа — корреляция, не причинность).
|
|
23
|
+
- Не оптимизировать метрику ради метрики (Goodhart); человек — бэкстоп. Никогда не действовать на n=1 (порог ≥3).
|
|
24
|
+
- Перед `add_asset` — дедуп-проверка пересечений; отчёт перечисляет добавления для последующей чистки.
|
|
25
|
+
- Пилот — домен `development`. Раскатка на другие домены — позже и совместно.
|
|
@@ -53,6 +53,7 @@ DEV (фикс+тест) → RG
|
|
|
53
53
|
|
|
54
54
|
- К пользователю попадает только: гейты-суждения (PM/UX/ARCH/RG) и явная эскалация через `request_decision` (классификация `fork`).
|
|
55
55
|
- Рутинные проходы пользователь не подтверждает.
|
|
56
|
+
- После закрытия RG `sign_off` может вернуть `audit_nudge` (накопилось ≥3 завершённых прогона, кратно 3) — показать одну строку: «📊 N прогонов — пора `/audit`» (Аудитор оценит агентов/скилы и предложит улучшения). Подсказка, не блокер.
|
|
56
57
|
|
|
57
58
|
## 🔁 Красный, Fix Cycle и Circuit Breaker
|
|
58
59
|
|
|
@@ -195,6 +195,7 @@ CONDUCTOR → DEV+TEST(Fix + self-check + GO/NO-GO)
|
|
|
195
195
|
|
|
196
196
|
> **Выбор режима:** Conductor определяет по Decision Tree (см. `agents/conductor.md`).
|
|
197
197
|
> Approved обязателен на **каждом** гейте, в любом режиме.
|
|
198
|
+
> **Ревью кода:** на REV-гейте diff показывается как HTML через MCP `render_diff` (file:// ссылка; файл в системном TEMP, не в проекте).
|
|
198
199
|
|
|
199
200
|
---
|
|
200
201
|
|
|
@@ -199,7 +199,7 @@ schema_version: 1
|
|
|
199
199
|
|
|
200
200
|
ARCH gate ritual через MCP — общий flow см. в `$mcp-integration`. Architect-specific operational guardrails:
|
|
201
201
|
|
|
202
|
-
- **`sign_off` для ARCH gate** — после финализации Architecture Doc + всех ADR + System Design Checklist: `sign_off(gate="ARCH", signer="
|
|
202
|
+
- **`sign_off` для ARCH gate** — после финализации Architecture Doc + всех ADR + System Design Checklist: `sign_off(gate="ARCH", signer="user", evidence=<architecture_doc_path + ADR_IDs>)`. Без подписи `advance_gate` не пропустит задачу в DEV.
|
|
203
203
|
- **`request_decision` для архитектурного выбора** — когда есть 2+ валидных решения с trade-offs (монолит vs микросервисы, ORM выбор, sync vs async pipeline): `request_decision(question, options=[plan_a, plan_b, plan_c], tradeoffs)`. Решение принимает пользователь, затем `record_decision` фиксирует ADR.
|
|
204
204
|
- **`record_decision` для каждого ADR** — каждое архитектурное решение = ADR через `$adr-log`. `record_decision(signer="user", domain="development", task_id, decision_text)` после approve. Архитектурные ADR — основной аудит-trail архитектуры.
|
|
205
205
|
- **Circuit Breaker (DEV-054) — destination, не source** — architect это **получатель** auto-route'а от MCP, не источник rollback'а. 2 consecutive DEV-rollback на REV/TEST → MCP блокирует return-to-DEV и роутит задачу в ARCH deep audit. Architect выполняет: current-state-analysis + system-design-checklist + design-patterns-reference review, выдаёт корректирующий ADR.
|
|
@@ -22,6 +22,7 @@ schema_version: 1
|
|
|
22
22
|
- НЕ на каждом гейте и НЕ в фоне. Один проход, когда накопилось **≥3 завершённых прогона** (порог настраивается).
|
|
23
23
|
- Ниже порога — молчит. На n=1 выводов не делает (малая выборка).
|
|
24
24
|
- Per-gate телеметрию уже пишет стейт-машина; Аудитор делает один проход по накопленным данным.
|
|
25
|
+
- Запуск прохода: команда `/audit` (вручную) или подсказка `audit_nudge`, которую `sign_off` возвращает после RG.
|
|
25
26
|
|
|
26
27
|
---
|
|
27
28
|
|
|
@@ -49,20 +50,20 @@ schema_version: 1
|
|
|
49
50
|
|
|
50
51
|
---
|
|
51
52
|
|
|
52
|
-
## Модель автономии (
|
|
53
|
+
## Модель автономии (поведение; механизм — `propose_change` / `review_proposal`)
|
|
53
54
|
- **По умолчанию: предлагает → человек одобряет.** Человек может отключить гейт одобрения.
|
|
54
55
|
- **Когда автономия включена** (матрица):
|
|
55
56
|
- **Сам, без спроса:** мелкие правки существующего (триггеры, `budget_lines`, `gates`, формулировки) + **ДОБАВЛЕНИЕ** новых агентов / скилов.
|
|
56
57
|
- **Через человека даже в автономии:** разрушительное по существующему (удаление, крупная переписка, снятие возможностей).
|
|
57
58
|
- **Всегда:** обязательный отчёт после любого автономного действия. Ничего невидимого.
|
|
58
59
|
- **Дедуп при добавлении:** перед авто-добавлением скила — проверка пересечения (`related` + контролируемый словарь); отчёт перечисляет добавления для последующей чистки.
|
|
59
|
-
-
|
|
60
|
+
- Механизм предложение→одобрение и тумблер автономии уже реализованы (`propose_change` → `review_proposal`: матрица рисков + дедуп). Проход запускается командой `/audit` или подсказкой после RG.
|
|
60
61
|
|
|
61
62
|
---
|
|
62
63
|
|
|
63
64
|
## MCP integration
|
|
64
65
|
- **Читает:** `aggregate_run_metrics` (числа по агентам / воркфлоу / скилам) + его `notes`.
|
|
65
|
-
- **Черновики правок** оформляет
|
|
66
|
+
- **Черновики правок** оформляет через `propose_change` (стор `pending`, ничего не меняет); человек смотрит `list_proposals`, одобряет через `review_proposal`; запись в ассет — отдельным `submit_artifact` / правкой.
|
|
66
67
|
- **НЕ зовёт** gate-инструменты (`classify_gate` / `sign_off` / `advance_gate`) — Аудитор вне стейт-машины.
|
|
67
68
|
- Пилот — домен `development`. Раскатка на другие домены — позже и совместно (граница доменов).
|
|
68
69
|
|
|
@@ -297,7 +297,10 @@ Tester report + Handoff Envelope → Conductor. Check: DEMO-xx validated + UX-PA
|
|
|
297
297
|
Conductor оркестрирует весь gate-flow через MCP — общий flow см. в `$mcp-integration`. Conductor-specific operational guardrails:
|
|
298
298
|
|
|
299
299
|
- **Gate-flow orchestration** — Conductor ведёт пайплайн `PM → UX → ARCH → DEV → REV → OPS → TEST → RG` через MCP: `classify_gate` (на какой гейт ложится задача), `current_gate` (где сейчас), `advance_gate` (переход к следующей фазе только после артефактов + Handoff Envelope). Phase transition без полного Handoff Envelope → `advance_gate` блокирует.
|
|
300
|
-
- **`sign_off`
|
|
300
|
+
- **`sign_off` — по политике гейта, НЕ «сам подписываю всё»** — гейты двух классов:
|
|
301
|
+
- **User-гейты (PM/UX/ARCH/RG, policy=user)** — подписывает ПОЛЬЗОВАТЕЛЬ. Conductor ОСТАНАВЛИВАЕТСЯ, показывает артефакт гейта и запрашивает `sign_off(signer="user")` — по одному гейту, без батчинга нескольких подтверждений, и не начинает работу следующего гейта, пока текущий не подписан. Неприменимый гейт (UX для backend/тест-задачи) — тоже явный sign-off пользователя: показать как N/A и спросить, не авто-проходить как `mcp`.
|
|
302
|
+
- **Исполнительские гейты (DEV/REV/OPS/TEST, policy=either)** — Conductor может подписать сам: `sign_off(signer="mcp")` при выполненном DoD.
|
|
303
|
+
- **RG** фиксируется как `sign_off(gate="RG", signer="user", decision=GO|NO-GO|GO-with-conditions, evidence=<RG checklist + REV-xx + QA-xx>)` (NOT prose approval). Детали → `$release-gate` § Decision Recording.
|
|
301
304
|
- **Circuit Breaker (DEV-054), MCP-enforced** — 2 последовательных DEV-rollback на REV/TEST → MCP блокирует return-to-DEV и auto-route в ARCH deep audit. Conductor НЕ обходит circuit breaker вручную. Полная логика → `$gates` § Circuit Breaker.
|
|
302
305
|
- **`request_decision` для маршрутизации эскалаций** — конфликты между агентами (DEV vs ARCH, REV vs DEV, UX vs PM) и waiver'ы mandatory-пунктов: `request_decision(conflict_summary, options, tradeoffs)` → решает пользователь → `record_decision`. См. § Conflict Resolution Protocol.
|
|
303
306
|
- **`record_decision` для ADR-достойных решений** — архитектурный дрейф, разрешённые конфликты, mandatory waiver'ы = ADR через `$adr-log`. `record_decision(signer="user", domain="development", task_id, decision_text)`.
|
|
@@ -213,7 +213,7 @@ lint → typecheck → unit tests → integration tests → build → deploy (st
|
|
|
213
213
|
|
|
214
214
|
OPS gate ritual через MCP — общий flow см. в `$mcp-integration`. DevOps-specific operational guardrails:
|
|
215
215
|
|
|
216
|
-
- **`sign_off` для OPS gate** — OPS-подпись это обязательное звено финальной RG-цепочки `DEV → REV → QA → OPS → RG` (см. `$release-gate`): `sign_off(gate="OPS", signer="
|
|
216
|
+
- **`sign_off` для OPS gate** — OPS-подпись это обязательное звено финальной RG-цепочки `DEV → REV → QA → OPS → RG` (см. `$release-gate`): `sign_off(gate="OPS", signer="mcp", evidence=<RG confirmation checklist ниже>)`. Подпись **блокирует RG**, если хотя бы один пункт failed. Доказательство OPS-подписи:
|
|
217
217
|
- HTTPS valid во всех prod-средах (cert expiry ≥ 30d)
|
|
218
218
|
- Secrets rotation актуален (последняя rotation ≤ 90d для критичных ключей)
|
|
219
219
|
- Rollback procedure протестирован за ≤ 30d
|
|
@@ -198,7 +198,8 @@ Reviewer обязан выдать отчёт, который может исп
|
|
|
198
198
|
|
|
199
199
|
REV gate ritual через MCP — общий flow см. в `$mcp-integration`. Reviewer-specific operational guardrails:
|
|
200
200
|
|
|
201
|
-
- **`
|
|
201
|
+
- **`render_diff` перед подписью REV** — покажи ревьюируемый diff как HTML-страницу: `render_diff(diff=<git diff>, title="REV-xx review")` → отдай пользователю `file://` URL. Только информационно (файл в системном TEMP), затем подпись.
|
|
202
|
+
- **`sign_off` для REV gate** — после завершения ревью один MCP-вызов: `sign_off(gate="REV", signer="mcp", evidence=<REV-xx_report_path или audit_trail link>)`. Без подписи `advance_gate` не пропустит задачу в OPS/TEST.
|
|
202
203
|
- **`request_decision` для P0 unresolved** — если P0 BLOCKER не решается технически (waiver-кандидат, конфликт с архитектурой): `request_decision(blocker_summary, options=[block, waive_with_compensating_control, escalate_to_architect], tradeoffs)`. Решение принимает пользователь, затем `record_decision` фиксирует ADR.
|
|
203
204
|
- **`record_decision` для P0 waiver** — каждый waiver = ADR через `$adr-log` (persona-base principle 3: рисковые решения видимы). `record_decision(signer="user", domain="development", task_id, decision_text)` после approve.
|
|
204
205
|
- **Circuit Breaker (DEV-054)** — 2 consecutive DEV-rollback на REV/TEST → MCP блокирует return-to-DEV, автоматически роутит задачу в ARCH deep audit (см. `$gates`). Reviewer не обходит circuit breaker manually.
|
|
@@ -200,7 +200,7 @@ REV проверяет это через `$tests-quality-review §2.G`. Без c
|
|
|
200
200
|
|
|
201
201
|
DEV gate ritual через MCP — общий flow см. в `$mcp-integration`. SFS-specific operational guardrails:
|
|
202
202
|
|
|
203
|
-
- **`sign_off` для DEV gate** — после завершения среза один MCP-вызов: `sign_off(gate="DEV", signer="
|
|
203
|
+
- **`sign_off` для DEV gate** — после завершения среза один MCP-вызов: `sign_off(gate="DEV", signer="mcp", evidence=<DEMO-xx envelope + green CI link; для tier 1-2 — RED_COMMIT_HASH + GREEN_COMMIT_HASH>)`. Содержание доказательства — это Test Integrity Discipline выше (Boundary Mocking + RED/GREEN hashes), здесь не пересказывается. Без подписи `advance_gate` не пропустит задачу в REV.
|
|
204
204
|
- **`request_decision` для заблокированного P0** — если P0 не решается технически (файл > 500 строк не декомпозируется, guardrails не заданы архитектором, упрощение ломает acceptance): `request_decision(blocker_summary, options=[block, simplify_with_tech_debt, escalate_to_architect], tradeoffs)`. Решение принимает пользователь, затем `record_decision`.
|
|
205
205
|
- **`record_decision` для tech-debt waiver** — каждое намеренное упрощение (`// TODO`) с риском = ADR через `$adr-log` (persona-base principle 3: рисковые решения видимы). `record_decision(signer="user", domain="development", task_id, decision_text)` после approve.
|
|
206
206
|
- **Circuit Breaker (DEV-054)** — sfs — **источник** отката: 2 consecutive DEV-rollback на REV/TEST → MCP блокирует возврат в DEV и автоматически роутит задачу в ARCH deep audit (см. `$gates`). sfs не обходит circuit breaker и не переоткрывает задачу вручную — ждёт корректирующий ADR от архитектора.
|
|
@@ -219,7 +219,7 @@ Tester не обязан писать всю автоматизацию сам,
|
|
|
219
219
|
|
|
220
220
|
TEST gate ritual через MCP — общий flow см. в `$mcp-integration`. Tester-specific operational guardrails:
|
|
221
221
|
|
|
222
|
-
- **`sign_off` для TEST gate** — TEST-подпись это звено финальной RG-цепочки `DEV → REV → QA → OPS → RG` (см. `$release-gate`): `sign_off(gate="TEST", signer="
|
|
222
|
+
- **`sign_off` для TEST gate** — TEST-подпись это звено финальной RG-цепочки `DEV → REV → QA → OPS → RG` (см. `$release-gate`): `sign_off(gate="TEST", signer="mcp", evidence=<QA-xx report + TID status>)`. Доказательство — tier-based GO logic из секции «Tier-based Release Recommendation logic» выше (mutation score ≥ 80%/60% для tier 1/2, flake rate < 1%, integrity audit clean, RED/GREEN hashes для tier 1-2), здесь не пересказывается. Без подписи `advance_gate` не пропустит релиз в RG.
|
|
223
223
|
- **Action tools, которые Tester гоняет через MCP** — `e2e_playwright` для автоматизированных E2E spec-файлов (`$qa-e2e-playwright`); `run_tests` / `docker_compose` для regression-прогона после подтверждённого container reload (evidence от DevOps обязателен).
|
|
224
224
|
- **`record_decision` для test-integrity finding** — block-merge на mutation regression или P0 integrity finding = ADR через `$adr-log`. `record_decision(signer="user", domain="development", task_id, decision_text)` после approve.
|
|
225
225
|
- **`request_decision` для спорного NO-GO / waiver** — если NO-GO оспаривается или нужен waiver на регрессию mutation score с компенсацией: `request_decision(blocker_summary, options=[block_release, waive_with_compensating_control, escalate_to_architect], tradeoffs)`. Решение принимает пользователь, затем `record_decision`.
|
|
@@ -97,7 +97,7 @@ This is the gate-passage ritual. **Every gate** must follow these steps in order
|
|
|
97
97
|
|
|
98
98
|
**`advance_gate`** — push the task into the next gate. **Only after** all artifacts of the current gate are submitted and sign_off is in place.
|
|
99
99
|
|
|
100
|
-
**`sign_off`** — sign the current gate. Sign_off without a prior `submit_artifact` is an anti-pattern (see §8). Result first, signature second.
|
|
100
|
+
**`sign_off`** — sign the current gate. Sign_off without a prior `submit_artifact` is an anti-pattern (see §8). Result first, signature second. **Who signs depends on the gate's `sign_off_policy`:** user gates (PM/UX/ARCH/RG) require `signer="user"` — STOP and request the user's sign-off, one gate at a time, no batching, and do not start the next gate until the current one is signed; execution gates (DEV/REV/OPS/TEST, policy=either) may be signed as `signer="mcp"` once DoD is met. The machine rejects an `mcp` sign-off of a user gate.
|
|
101
101
|
|
|
102
102
|
**Canonical gate ritual:** `current_gate` (understand where you are) → `classify_gate` → if fork: `request_decision` → wait → `record_decision` → continue → `submit_artifact` → `verify_claim` (where applicable) → `sign_off` → `advance_gate`.
|
|
103
103
|
|
|
@@ -139,6 +139,8 @@ Tools that **do** something in the project. Each answers one DoD question.
|
|
|
139
139
|
|
|
140
140
|
**`review_proposal`** — authorize a proposal status transition (approve/reject a pending one; mark an approved one applied) plus a mandatory report. Applies the autonomy matrix + the `.code-ai/config.json` toggle: `decided_by='auditor_auto'` may approve only low/additive AND only when the gate is OFF; destructive (high) and gate-ON always require user. Auto-adding a new skill also runs an additive-dedup guard — on overlap with an existing skill it routes to user instead of auto-adding. Authorization only — the byte write into the asset is a separate submit_artifact/edit step (see next_step).
|
|
141
141
|
|
|
142
|
+
**`render_diff`** — render a unified diff (e.g. `git diff` output) into a colored, per-file, line-numbered HTML review page in the system temp dir. Returns the path + a `file://` URL to open in a browser. Call it at the REV gate to present code changes for review. Informational only — the file lives in temp (cleared on reboot), never in the project.
|
|
143
|
+
|
|
142
144
|
---
|
|
143
145
|
|
|
144
146
|
## 6. Group 4 — Recording decisions (6 tools + 1 utility)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Auditor pass — evaluate agents/skills over accumulated runs and draft improvements. Beside the pipeline; does not touch the task's code.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /audit — Auditor pass (meta / maintenance)
|
|
6
|
+
|
|
7
|
+
The Auditor stands BESIDE the pipeline: it signs no gates and does not touch the user's task or code. It evaluates how agents / skills / workflows performed on real runs and proposes improvements (or new additions). Full contract — in the `auditor` role.
|
|
8
|
+
|
|
9
|
+
## When to run
|
|
10
|
+
- Manually with this command at any time — or on the `audit_nudge` that `sign_off` returns after RG is closed.
|
|
11
|
+
- Needs **≥3 completed runs** in the ledger (`.code-ai/state/audit/runs.jsonl`). Fewer — too little data, the Auditor stays silent (small sample).
|
|
12
|
+
|
|
13
|
+
## Flow
|
|
14
|
+
1. `load_role auditor` — load the role and its principles (hypotheses not verdicts; surfacing, not enforcing).
|
|
15
|
+
2. `aggregate_run_metrics` — dry numbers per agent / workflow / skill. **Read its `notes`** — the honest data limits live there.
|
|
16
|
+
3. If `met_threshold=false` (fewer than 3 runs) — stop, say "too little data", propose nothing.
|
|
17
|
+
4. Form hypotheses. For each proposal — `propose_change` (`change_kind`: `edit_minor` / `add_asset` / `destructive`). It lands in the store as `pending` and **changes nothing**.
|
|
18
|
+
5. Show the user a report + `list_proposals` (what is queued, with the matrix risk tier).
|
|
19
|
+
6. Apply only via `review_proposal` (approve) + the asset write (`submit_artifact` / edit). The approval gate is ON by default: nothing is applied without an explicit human decision. `destructive` — always via the human.
|
|
20
|
+
|
|
21
|
+
## Principles (from the auditor role)
|
|
22
|
+
- Hypotheses, not verdicts. Attribution with humility (numbers are correlation, not causation).
|
|
23
|
+
- Do not optimize a metric for its own sake (Goodhart); the human is the backstop. Never act on n=1 (threshold ≥3).
|
|
24
|
+
- Before `add_asset` — an overlap dedup check; the report lists additions for later pruning.
|
|
25
|
+
- Pilot — the `development` domain. Roll-out to other domains is later and joint.
|
|
@@ -53,6 +53,7 @@ The machine flows silently; the user is pulled in only for judgment decisions.
|
|
|
53
53
|
|
|
54
54
|
- The user sees only: judgment gates (PM/UX/ARCH/RG) and an explicit escalation via `request_decision` (a `fork` classification).
|
|
55
55
|
- Routine passes are not confirmed by the user.
|
|
56
|
+
- After RG is closed `sign_off` may return `audit_nudge` (≥3 completed runs, a multiple of 3) — surface one line: «📊 N runs — time for `/audit`» (the Auditor evaluates agents/skills and proposes improvements). A hint, not a blocker.
|
|
56
57
|
|
|
57
58
|
## 🔁 Red, Fix Cycle and Circuit Breaker
|
|
58
59
|
|
|
@@ -162,6 +162,8 @@ Use skills (folders with `SKILL.md`). Full list:
|
|
|
162
162
|
## Gates (Pipeline)
|
|
163
163
|
PM(PRD) -> UX(UX Spec) -> ARCH(Architecture/ADR/Contracts) -> DEV(TDD) -> REV(Security/Best) -> OPS(Infrastructure/CI-CD) -> TEST(Test plan/report) -> RG(Release Gate)
|
|
164
164
|
|
|
165
|
+
> **Code review:** at the REV gate the diff is presented as HTML via the MCP `render_diff` tool (file:// link; the file lives in the system temp dir, not the project).
|
|
166
|
+
|
|
165
167
|
---
|
|
166
168
|
|
|
167
169
|
## Mandatory function documentation rule
|
|
@@ -199,7 +199,7 @@ Canonical ADR format (Context / Decision / Consequences / Alternatives / Status
|
|
|
199
199
|
|
|
200
200
|
ARCH gate ritual via MCP — general flow in `$mcp-integration`. Architect-specific operational guardrails:
|
|
201
201
|
|
|
202
|
-
- **`sign_off` for ARCH gate** — after finalizing the Architecture Doc + all ADRs + System Design Checklist: `sign_off(gate="ARCH", signer="
|
|
202
|
+
- **`sign_off` for ARCH gate** — after finalizing the Architecture Doc + all ADRs + System Design Checklist: `sign_off(gate="ARCH", signer="user", evidence=<architecture_doc_path + ADR_IDs>)`. Without the signature `advance_gate` will not pass the task to DEV.
|
|
203
203
|
- **`request_decision` for architectural choice** — when 2+ valid options exist with trade-offs (monolith vs microservices, ORM choice, sync vs async pipeline): `request_decision(question, options=[plan_a, plan_b, plan_c], tradeoffs)`. the user decides, then `record_decision` writes the ADR.
|
|
204
204
|
- **`record_decision` for every ADR** — every architectural decision = ADR via `$adr-log`. `record_decision(signer="user", domain="development", task_id, decision_text)` after approval. Architectural ADRs are the primary audit trail of the architecture.
|
|
205
205
|
- **Circuit Breaker (DEV-054) — destination, not source** — architect is the **recipient** of an MCP auto-route, not the source of a rollback. 2 consecutive DEV-rollback on REV/TEST → MCP blocks return-to-DEV and routes the task to ARCH deep audit. Architect performs: current-state-analysis + system-design-checklist + design-patterns-reference review and produces a corrective ADR.
|
|
@@ -22,6 +22,7 @@ Close the self-improvement loop: build → run → measure → improve. Once rea
|
|
|
22
22
|
- NOT at every gate and NOT in the background. One pass, once **≥3 completed runs** have accumulated (threshold configurable).
|
|
23
23
|
- Below the threshold — silent. It draws no conclusions from n=1 (small sample).
|
|
24
24
|
- Per-gate telemetry is already persisted by the state machine; the Auditor makes one pass over the accumulated data.
|
|
25
|
+
- Triggering a pass: the `/audit` command (manual) or the `audit_nudge` that `sign_off` returns after RG.
|
|
25
26
|
|
|
26
27
|
---
|
|
27
28
|
|
|
@@ -49,20 +50,20 @@ Close the self-improvement loop: build → run → measure → improve. Once rea
|
|
|
49
50
|
|
|
50
51
|
---
|
|
51
52
|
|
|
52
|
-
## Autonomy model (
|
|
53
|
+
## Autonomy model (behavior; mechanism — `propose_change` / `review_proposal`)
|
|
53
54
|
- **By default: proposes → the human approves.** The human may disable the approval gate.
|
|
54
55
|
- **When autonomy is enabled** (matrix):
|
|
55
56
|
- **Auto, no ask:** low-risk edits to existing assets (triggers, `budget_lines`, `gates`, wording) + **ADDING** new agents / skills.
|
|
56
57
|
- **Human-gated even under autonomy:** destructive changes to existing assets (delete, major rewrite, capability removal).
|
|
57
58
|
- **Always:** a mandatory report after any autonomous action. Nothing invisible.
|
|
58
59
|
- **Additive dedup:** before auto-adding a skill — an overlap check (`related` + controlled vocab); the report lists additions for later pruning.
|
|
59
|
-
- The propose→approve mechanism and the autonomy toggle
|
|
60
|
+
- The propose→approve mechanism and the autonomy toggle already exist (`propose_change` → `review_proposal`: risk matrix + dedup). A pass is triggered by `/audit` or the post-RG nudge.
|
|
60
61
|
|
|
61
62
|
---
|
|
62
63
|
|
|
63
64
|
## MCP integration
|
|
64
65
|
- **Reads:** `aggregate_run_metrics` (numbers per agent / workflow / skill) + its `notes`.
|
|
65
|
-
- **Draft changes**
|
|
66
|
+
- **Draft changes** go through `propose_change` (pending in the store, changing nothing); the human reviews via `list_proposals` and approves via `review_proposal`; the asset write is a separate `submit_artifact` / edit.
|
|
66
67
|
- **Does NOT call** gate tools (`classify_gate` / `sign_off` / `advance_gate`) — the Auditor is outside the state machine.
|
|
67
68
|
- Pilot — the `development` domain. Roll-out to other domains is later and joint (domain boundary).
|
|
68
69
|
|
|
@@ -297,7 +297,10 @@ If two agents disagree (DEV vs ARCH on an ADR, REV vs DEV on a P0, UX vs PM on s
|
|
|
297
297
|
The Conductor orchestrates the entire gate flow via MCP — see the general flow in `$mcp-integration`. Conductor-specific operational guardrails:
|
|
298
298
|
|
|
299
299
|
- **Gate-flow orchestration** — the Conductor drives the pipeline `PM → UX → ARCH → DEV → REV → OPS → TEST → RG` via MCP: `classify_gate` (which gate a task lands on), `current_gate` (where it is now), `advance_gate` (move to the next phase only after artifacts + Handoff Envelope). A phase transition without a complete Handoff Envelope → `advance_gate` blocks.
|
|
300
|
-
- **`sign_off`
|
|
300
|
+
- **`sign_off` — by gate policy, NOT "I sign everything"** — gates fall into two classes:
|
|
301
|
+
- **User gates (PM/UX/ARCH/RG, policy=user)** — the USER signs. The Conductor STOPS, presents the gate artifact, and requests `sign_off(signer="user")` — one gate at a time, no batching of approvals, and does NOT start next-gate work until the current one is signed. An inapplicable gate (UX for a backend/test-only task) still needs an explicit user sign-off: present it as N/A and ask — do not auto-pass it as `mcp`.
|
|
302
|
+
- **Execution gates (DEV/REV/OPS/TEST, policy=either)** — the Conductor may sign itself: `sign_off(signer="mcp")` once DoD is met.
|
|
303
|
+
- **RG** is recorded as `sign_off(gate="RG", signer="user", decision=GO|NO-GO|GO-with-conditions, evidence=<RG checklist + REV-xx + QA-xx>)` (NOT prose approval). Details → `$release-gate` § Decision Recording.
|
|
301
304
|
- **Circuit Breaker (DEV-054), MCP-enforced** — 2 consecutive DEV-rollbacks at REV/TEST → MCP blocks return-to-DEV and auto-routes to ARCH deep audit. The Conductor does NOT bypass the circuit breaker manually. Full logic → `$gates` § Circuit Breaker.
|
|
302
305
|
- **`request_decision` for escalation routing** — conflicts between agents (DEV vs ARCH, REV vs DEV, UX vs PM) and waivers of mandatory items: `request_decision(conflict_summary, options, tradeoffs)` → the user decides → `record_decision`. See § Conflict Resolution Protocol.
|
|
303
306
|
- **`record_decision` for ADR-worthy outcomes** — architectural drift, resolved conflicts, mandatory waivers = an ADR via `$adr-log`. `record_decision(signer="user", domain="development", task_id, decision_text)`.
|
|
@@ -213,7 +213,7 @@ In case of a production incident:
|
|
|
213
213
|
|
|
214
214
|
OPS gate ritual via MCP — see the general flow in `$mcp-integration`. DevOps-specific operational guardrails:
|
|
215
215
|
|
|
216
|
-
- **`sign_off` for the OPS gate** — the OPS sign-off is a mandatory link in the final RG chain `DEV → REV → QA → OPS → RG` (see `$release-gate`): `sign_off(gate="OPS", signer="
|
|
216
|
+
- **`sign_off` for the OPS gate** — the OPS sign-off is a mandatory link in the final RG chain `DEV → REV → QA → OPS → RG` (see `$release-gate`): `sign_off(gate="OPS", signer="mcp", evidence=<RG confirmation checklist below>)`. The sign-off **blocks RG** if any item failed. Evidence for the OPS sign-off:
|
|
217
217
|
- HTTPS valid in all prod environments (cert expiry ≥ 30d)
|
|
218
218
|
- Secrets rotation up to date (last rotation ≤ 90d for critical keys)
|
|
219
219
|
- Rollback procedure tested within ≤ 30d
|
|
@@ -198,7 +198,8 @@ The Reviewer must produce a report usable by the conductor in the Release Gate:
|
|
|
198
198
|
|
|
199
199
|
REV gate ritual via MCP — general flow in `$mcp-integration`. Reviewer-specific operational guardrails:
|
|
200
200
|
|
|
201
|
-
- **`
|
|
201
|
+
- **`render_diff` before the REV sign-off** — present the reviewed diff as an HTML page: `render_diff(diff=<git diff>, title="REV-xx review")` → hand the user the `file://` URL. Informational only (file in the system temp dir), then sign off.
|
|
202
|
+
- **`sign_off` for REV gate** — after review completion one MCP call: `sign_off(gate="REV", signer="mcp", evidence=<REV-xx_report_path or audit_trail link>)`. Without the signature `advance_gate` will not pass the task to OPS/TEST.
|
|
202
203
|
- **`request_decision` for P0 unresolved** — if a P0 BLOCKER is not resolvable technically (waiver candidate, architectural conflict): `request_decision(blocker_summary, options=[block, waive_with_compensating_control, escalate_to_architect], tradeoffs)`. the user decides, then `record_decision` writes the ADR.
|
|
203
204
|
- **`record_decision` for P0 waiver** — every waiver = ADR via `$adr-log` (persona-base principle 3: risk decisions are visible). `record_decision(signer="user", domain="development", task_id, decision_text)` after approval.
|
|
204
205
|
- **Circuit Breaker (DEV-054)** — 2 consecutive DEV-rollback on REV/TEST → MCP blocks return-to-DEV and auto-routes the task to ARCH deep audit (see `$gates`). Reviewer does not bypass the circuit breaker manually.
|
|
@@ -200,7 +200,7 @@ Each stack workflow below has a companion `-reference` for deep lookup — the `
|
|
|
200
200
|
|
|
201
201
|
DEV gate ritual via MCP — see the general flow in `$mcp-integration`. SFS-specific operational guardrails:
|
|
202
202
|
|
|
203
|
-
- **`sign_off` for the DEV gate** — after finishing a slice, one MCP call: `sign_off(gate="DEV", signer="
|
|
203
|
+
- **`sign_off` for the DEV gate** — after finishing a slice, one MCP call: `sign_off(gate="DEV", signer="mcp", evidence=<DEMO-xx envelope + green CI link; for tier 1-2 — RED_COMMIT_HASH + GREEN_COMMIT_HASH>)`. The evidence content is the Test Integrity Discipline above (Boundary Mocking + RED/GREEN hashes), not restated here. Without the sign-off, `advance_gate` will not move the task to REV.
|
|
204
204
|
- **`request_decision` for a blocked P0** — when a P0 cannot be resolved technically (a >500-line file cannot be decomposed, guardrails not provided by the architect, a simplification breaks acceptance): `request_decision(blocker_summary, options=[block, simplify_with_tech_debt, escalate_to_architect], tradeoffs)`. the user decides, then `record_decision`.
|
|
205
205
|
- **`record_decision` for a tech-debt waiver** — every intentional simplification (`// TODO`) carrying risk = an ADR via `$adr-log` (persona-base principle 3: risky decisions are visible). `record_decision(signer="user", domain="development", task_id, decision_text)` after approval.
|
|
206
206
|
- **Circuit Breaker (DEV-054)** — sfs is the **origin** of rollback: 2 consecutive DEV-rollbacks on REV/TEST → MCP blocks the return to DEV and automatically routes the task to an ARCH deep audit (see `$gates`). sfs does not bypass the circuit breaker or re-open the task manually — it waits for a corrective ADR from the architect.
|
|
@@ -219,7 +219,7 @@ For testing applications inside closed ecosystems (Wix Dashboard, Shopify Admin,
|
|
|
219
219
|
|
|
220
220
|
TEST gate ritual via MCP — see the general flow in `$mcp-integration`. Tester-specific operational guardrails:
|
|
221
221
|
|
|
222
|
-
- **`sign_off` for the TEST gate** — the TEST sign-off is a link in the final RG chain `DEV → REV → QA → OPS → RG` (see `$release-gate`): `sign_off(gate="TEST", signer="
|
|
222
|
+
- **`sign_off` for the TEST gate** — the TEST sign-off is a link in the final RG chain `DEV → REV → QA → OPS → RG` (see `$release-gate`): `sign_off(gate="TEST", signer="mcp", evidence=<QA-xx report + TID status>)`. The evidence is the tier-based GO logic from the "Tier-based Release Recommendation logic" section above (mutation score ≥ 80%/60% for tier 1/2, flake rate < 1%, integrity audit clean, RED/GREEN hashes for tier 1-2), not restated here. Without the sign-off, `advance_gate` will not move the release to RG.
|
|
223
223
|
- **Action tools Tester drives via MCP** — `e2e_playwright` for automated E2E spec files (`$qa-e2e-playwright`); `run_tests` / `docker_compose` for the regression run after a confirmed container reload (evidence from DevOps required).
|
|
224
224
|
- **`record_decision` for a test-integrity finding** — a block-merge on mutation regression or a P0 integrity finding = an ADR via `$adr-log`. `record_decision(signer="user", domain="development", task_id, decision_text)` after approval.
|
|
225
225
|
- **`request_decision` for a contested NO-GO / waiver** — when a NO-GO is contested or a waiver on a mutation-score regression with compensation is needed: `request_decision(blocker_summary, options=[block_release, waive_with_compensating_control, escalate_to_architect], tradeoffs)`. the user decides, then `record_decision`.
|
|
@@ -5,7 +5,7 @@ domain: product
|
|
|
5
5
|
signs_off_at:
|
|
6
6
|
- RELEASE_GATE
|
|
7
7
|
tool_allowlist: role:conductor
|
|
8
|
-
budget_lines:
|
|
8
|
+
budget_lines: 543
|
|
9
9
|
schema_version: 1
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -396,6 +396,20 @@ $handoff → MED-01 (Unified Strategy Synthesis).
|
|
|
396
396
|
|
|
397
397
|
---
|
|
398
398
|
|
|
399
|
+
## MCP-интеграция и операционные гарантии
|
|
400
|
+
|
|
401
|
+
Дирижёр оркестрирует весь поток гейтов через машину состояний `code-ai` MCP — общий поток см. в `product-pipeline-rules.md` § «Машина гейтов (code-ai MCP)». Conductor-specific операционные гарантии:
|
|
402
|
+
|
|
403
|
+
- **Оркестрация гейтов** — Дирижёр ведёт последовательность гейтов выбранного режима через MCP: `classify_gate` (на какой гейт ложится задача), `current_gate` (где сейчас), `advance_gate` (переход к следующему гейту только после deliverable + Handoff Envelope). Переход без полного Handoff Envelope → `advance_gate` блокирует.
|
|
404
|
+
- **`sign_off` — все гейты `user`, Дирижёр не подписывает за пользователя** — в продукте каждый гейт закрывает ПОЛЬЗОВАТЕЛЬ. Дирижёр ОСТАНАВЛИВАЕТСЯ, показывает артефакт гейта и запрашивает `sign_off(signer="user")` — по одному гейту, без батчинга нескольких подтверждений, и не начинает работу следующего гейта, пока текущий не подписан. Авто-пас на зелёном не применяется (домен суждения, детерминированных авто-чеков нет).
|
|
405
|
+
- **RELEASE_GATE** фиксируется как `sign_off(gate="RELEASE_GATE", signer="user", decision=..., evidence=<RG checklist>)` — не «прозой».
|
|
406
|
+
- **`request_decision` для эскалаций** — конфликты между агентами и waiver'ы обязательных пунктов: `request_decision(...)` → решает пользователь → `record_decision`. См. § Conflict Resolution Protocol.
|
|
407
|
+
- **`record_decision` для ADR-достойных решений** — зафиксированные конфликты и отклонения от брифа, согласованные с пользователем: `record_decision(signer="user", domain="product", task_id, decision_text)`.
|
|
408
|
+
- **Circuit breaker отключён** — в продукте нет полосы откатов в стиле development (DEV/REV/OPS/TEST); возвраты идут через reverse `$handoff` (см. Reverse Handoff).
|
|
409
|
+
- **Degraded mode** — если MCP-поток недоступен: Дирижёр ведёт Master Checklist (`$board`) и статусы Handoff Envelope вручную, sign-off фиксируется явным "Approved" пользователя, эскалации — вручную.
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
399
413
|
## Формат ответа агента
|
|
400
414
|
|
|
401
415
|
### Full Pipeline (A / B)
|
|
@@ -5,7 +5,7 @@ domain: product
|
|
|
5
5
|
signs_off_at:
|
|
6
6
|
- RELEASE_GATE
|
|
7
7
|
tool_allowlist: role:conductor
|
|
8
|
-
budget_lines:
|
|
8
|
+
budget_lines: 543
|
|
9
9
|
schema_version: 1
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -396,6 +396,20 @@ If an agent's deliverable does not pass `$gates`:
|
|
|
396
396
|
|
|
397
397
|
---
|
|
398
398
|
|
|
399
|
+
## MCP integration & operational guardrails
|
|
400
|
+
|
|
401
|
+
The Conductor orchestrates the whole gate-flow through the `code-ai` MCP state machine — for the general flow see `product-pipeline-rules.md` § "Gate machine (code-ai MCP)". Conductor-specific operational guardrails:
|
|
402
|
+
|
|
403
|
+
- **Gate-flow orchestration** — the Conductor drives the active mode's gate sequence through MCP: `classify_gate` (which gate the task lands on), `current_gate` (where we are now), `advance_gate` (move to the next gate only after the deliverable + Handoff Envelope). A transition without a complete Handoff Envelope → `advance_gate` blocks.
|
|
404
|
+
- **`sign_off` — all gates are `user`; the Conductor does not sign for the user** — in product every gate is closed by the USER. The Conductor STOPS, presents the gate artifact, and requests `sign_off(signer="user")` — one gate at a time, with no batching of approvals, and does NOT start next-gate work until the current one is signed. No auto-pass on green (a judgment domain, no deterministic auto-checks).
|
|
405
|
+
- **RELEASE_GATE** is recorded as `sign_off(gate="RELEASE_GATE", signer="user", decision=..., evidence=<RG checklist>)` — not prose approval.
|
|
406
|
+
- **`request_decision` for escalations** — conflicts between agents and waivers of mandatory items: `request_decision(...)` → the user decides → `record_decision`. See § Conflict Resolution Protocol.
|
|
407
|
+
- **`record_decision` for ADR-worthy outcomes** — recorded conflicts and brief deviations approved by the user: `record_decision(signer="user", domain="product", task_id, decision_text)`.
|
|
408
|
+
- **Circuit breaker disabled** — product has no development-style rollback lane (DEV/REV/OPS/TEST); returns go through reverse `$handoff` (see Reverse Handoff).
|
|
409
|
+
- **Degraded mode** — if the MCP flow is unavailable: the Conductor keeps the Master Checklist (`$board`) and Handoff Envelope statuses by hand, sign-off is recorded by the user's explicit "Approved", and escalations are manual.
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
399
413
|
## Agent response format
|
|
400
414
|
|
|
401
415
|
### Full Pipeline (A / B)
|