@davoodmehraban89 / Aram-2 Mirror · read-only / commits / ee4458d
Fork 0

Mirrored from https://github.com/davoodmehraban89/Aram.git

Synced Dec 4, 15:30 UTC

Governance: renumber orchestration ADR 032->033 (R3 holds ADR-032-r3); refresh snapshots for R3 (PR #101 merged)

R3 (built-vs-official comparison, BS 16/16 MET, IS 6/6 source-data-blocked) merged as PR #101 @ 0578ea5 while this PR was open, taking ADR-032. Per the add-new-ADR discipline the orchestration ADR becomes ADR-033; all refs updated. Orchestration snapshots/queues refreshed: R2+R3 marked merged (retroactive T1 passes queued), B1 queue now R4 -> C1/C3, IS residue flagged as owner/data escalation (never agent-side tolerance). Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>

davoodmehraban89 committed Dec 4, 2026 at 14:04 UTC ee4458df379fe54a8d370e5f071073512715b00b
7 files changed +28 -27
AGENTS.md
+1 -1
@@ -27,7 +27,7 @@ Never treat a local file, task summary, or agent report as proof that a branch,
27 - Do not commit ZIP, EXE, build output, secrets, credentials, caches, or local databases unless explicitly required by an approved artifact task.
28 - Do not invent financial values, mapping rules, tests, CI outcomes, URLs, or acceptance status.
29
30 -## Agent orchestration (five-role model — ADR-032)
30 +## Agent orchestration (five-role model — ADR-033)
31
32 Work proceeds through a five-role agent orchestration coordinated by a single
33 manager (M0): **A1** Analyst (no product code), **B1** Backend Engineer,
PROJECT_STATUS.md
+1 -1
@@ -12,7 +12,7 @@
12 - Product objective: a controlled, auditable accounting and financial-statement workflow that preserves canonical source data.
13 - Authoritative work orders: booklet 1 v1.0 ([`docs/booklet/BOOKLET_v1.0.md`](docs/booklet/BOOKLET_v1.0.md), ADR-025) and **booklet 2 v2.0** ([`docs/booklet/BOOKLET_v2.0.md`](docs/booklet/BOOKLET_v2.0.md), ADR-027 — course correction + general-platform architecture; supersedes conflicting parts of booklet 1). Integrity anchored by SHA-256 in [`docs/booklet/MANIFEST.json`](docs/booklet/MANIFEST.json). **Governing now: booklet 2.1** (owner message 2026-12-04; no markdown copy is committed because the agent holds no byte-exact original — the owner's text is authoritative, see `MANIFEST.json`). It closes only the remaining gaps and takes precedence over booklets 2 and 1, whose other sections stay valid. Work is split into **R1…R6**, one PR each, ≤1,500 lines excluding tests/data; security/control defects may not be deferred.
14
15 -- **Agent operations — five-role orchestration (ADR-032, 2026-12-04):** M0 manager + A1 Analyst / B1 Backend / F1 Frontend / D1 DevOps / T1 Independent Tester; auto-discovered through the `AGENTS.md` pointer; entry point `docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md`, per-role prompts `docs/agent-orchestration/AGENT_PROMPTS.md`. Orchestration adds operating procedure only — it never overrides `AGENTS.md`, `docs/ACCEPTANCE_POLICY.md`, or the booklets; a T1 verdict is verification evidence, not acceptance.
15 +- **Agent operations — five-role orchestration (ADR-033, 2026-12-04):** M0 manager + A1 Analyst / B1 Backend / F1 Frontend / D1 DevOps / T1 Independent Tester; auto-discovered through the `AGENTS.md` pointer; entry point `docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md`, per-role prompts `docs/agent-orchestration/AGENT_PROMPTS.md`. Orchestration adds operating procedure only — it never overrides `AGENTS.md`, `docs/ACCEPTANCE_POLICY.md`, or the booklets; a T1 verdict is verification evidence, not acceptance.
16
17 ## Status vocabulary
18
docs/PROJECT_LOG.md
+4 -4
@@ -455,15 +455,15 @@ Each new entry must record: UTC timestamp, actor, task/phase, base branch and SH
455 - Protected data: `data/` tree 2ef8a512523f62f0cf84c5009f141be2f8a9cb5f and `samples/` tree 00aba54b1dc30485ba9b164c8036a7b4bbe9020e unchanged (before = after).
456 - Budget: **968 / 1500** authored lines excl. tests/data. Acceptance: R2 **MET** (15 controls in preflight, per-control ± tests, approval-rejected test). Next: R3 (build-vs-official comparison, IS 6/8/9 root cause, EQ/CF parsing).
457
458 -### 2026-12-04T10:40:55Z — ADR-032: five-role agent orchestration adopted + auto-discovery entry point (owner directive)
458 +### 2026-12-04T10:40:55Z — ADR-033: five-role agent orchestration adopted + auto-discovery entry point (owner directive)
459
460 - Actor: Arena agent (M0 implementation). Trigger: owner directive in Arena chat (2026-12-04): place the five-agent orchestration where every future agent reads it automatically — "you pick the best method" — so no prompt-pasting or file-naming is needed in a new session.
461 -- Landed: `docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md` + `AGENT_PROMPTS.md` (design from the earlier chat turns, now committed); `docs/adr/ADR-032-agent-orchestration.md`; compact pointer section in `AGENTS.md` (the ecosystem's auto-read agent entry point: read the master prompt before starting or resuming any task); `PROJECT_STATUS.md` bullet; `docs/handoff/LATEST_HANDOFF.md` refresh (governance change → ADR-026 cadence: role-model entry, superseded-head note, current single-next-action).
461 +- Landed: `docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md` + `AGENT_PROMPTS.md` (design from the earlier chat turns, now committed); `docs/adr/ADR-033-agent-orchestration.md`; compact pointer section in `AGENTS.md` (the ecosystem's auto-read agent entry point: read the master prompt before starting or resuming any task); `PROJECT_STATUS.md` bullet; `docs/handoff/LATEST_HANDOFF.md` refresh (governance change → ADR-026 cadence: role-model entry, superseded-head note, current single-next-action).
462 - Mechanism: a new session checks out the canonical branch → reads `AGENTS.md` → pointer → master prompt (roles, work-order → PR → tester-verdict → integration loop, serialization, invariants, first actions, "verify live" snapshot). **Goes live for new chats only after the merge into `source-data-cleanup`.**
463 -- الف‌5 disclosure: the Arena single-branch constraint (system-level; precedents ADR-028 / R1) forces co-landing with open tooling PR #99 — the governance commits join the same branch/PR; PR title+body updated (الف‌4); the split recipe is documented in ADR-032; the owner chooses combined acceptance or split.
463 +- الف‌5 disclosure: the Arena single-branch constraint (system-level; precedents ADR-028 / R1) forces co-landing with open tooling PR #99 — the governance commits join the same branch/PR; PR title+body updated (الف‌4); the split recipe is documented in ADR-033; the owner chooses combined acceptance or split.
464 - No product/backend/frontend/workflow behavior change; no R-task scope touched. Secret gate re-verified after the additions: `.secrets.baseline` unchanged (the new docs' 40-char tree hashes do not trigger the plugins — fresh-scan diff = 0 new / 0 gone).
465 - Protected data: `data/` tree `2ef8a512523f62f0cf84c5009f141be2f8a9cb5f` + `samples/` tree `00aba54b1dc30485ba9b164c8036a7b4bbe9020e` unchanged (before = after).
466 -- Coordination event (same day, mid-flight): a parallel Arena session (`arena/094f314c-aram`) implemented R2 and the owner merged it as **PR #100 @ `a8ba20c`** (10:40:42Z, owner directive). This branch merged that base (no force-push; ADR-028 precedent); the `PROJECT_LOG.md` conflict was resolved append-only and chronological (the R2 entry untouched); **this ADR renumbered 031→032** (R2 holds `ADR-031-r2-full-control-set.md`).
466 +- Coordination event (same day, mid-flight): a parallel Arena session (`arena/094f314c-aram`) implemented R2 and the owner merged it as **PR #100 @ `a8ba20c`** (10:40:42Z, owner directive). This branch merged that base (no force-push; ADR-028 precedent); the `PROJECT_LOG.md` conflict was resolved append-only and chronological (the R2 entry untouched); **this ADR renumbered 031→032→033** (R2 holds `ADR-031-r2-full-control-set.md`; R3 later holds `ADR-032-r3-built-vs-official.md`).
467 - Acceptance: IN_PROGRESS; author does not merge or tag. Next: independent review of the updated PR #99 (tooling + orchestration governance); after acceptance → **R3** via the orchestration loop, coordinated against the parallel session (R2 already merged).
468
469 ### 2026-12-04T11:30:00Z — R3 built-vs-official comparison (booklet 2.1)
docs/adr/ADR-033-agent-orchestration.md renamed
+2 -2
@@ -1,9 +1,9 @@
1 -# ADR-032 — Five-role agent orchestration and its auto-discovery entry point
1 +# ADR-033 — Five-role agent orchestration and its auto-discovery entry point
2
3 - Status: Accepted (owner directive, Arena chat, 2026-12-04)
4 - Date: 2026-12-04
5 - Related: `AGENTS.md` (agent instructions), ADR-026 (handoff cadence), ADR-028 (Arena single-branch constraint precedent), booklet 2 الف‌4/الف‌5, `docs/ACCEPTANCE_POLICY.md`
6 -- Renumbering note: introduced as ADR-031; the concurrent R2 PR (#100, merged 2026-12-04T10:40:42Z) holds `ADR-031-r2-full-control-set.md`, so this ADR is **ADR-032** per the add-new-ADR discipline (never rewrite an accepted ADR).
6 +- Renumbering note: introduced as ADR-031; two concurrent merges took the lower numbers first — R2 (PR #100, merged 2026-12-04T10:40:42Z) holds `ADR-031-r2-full-control-set.md`, R3 (PR #101, merged 2026-12-04T11:50:09Z) holds `ADR-032-r3-built-vs-official.md` — so this ADR is **ADR-033** per the add-new-ADR discipline (never rewrite an accepted ADR). Verify the number against the live `docs/adr/` at merge time; if it has moved again, take the next free number.
7
8 ## Context
9
docs/agent-orchestration/AGENT_PROMPTS.md
+8 -8
@@ -2,7 +2,7 @@
2
3 > **نسخهٔ یکپارچه:** پرامپت «کلی» تک‌ایجنتی (ارکستراتور M0) در `MASTER_ORCHESTRATION_PROMPT.md` همین پوشه است. این فایل، پرامپت‌های **تکی و کامل** برای ۵ session جداگانه باقی می‌ماند.
4
5 -> **وضعیت:** کامیت‌شده طبق **ADR-032** (2026-12-04، دستور owner در چت Arena). این فایل پرامپت‌های **تکی و کامل** پنج نقش برای اجرا در sessionهای جداگانه است؛ نسخهٔ یکپارچهٔ تک‌ایجنتی در `MASTER_ORCHESTRATION_PROMPT.md` است و `AGENTS.md` هر دو را به‌طور خودکار معرفی می‌کند.
5 +> **وضعیت:** کامیت‌شده طبق **ADR-033** (2026-12-04، دستور owner در چت Arena). این فایل پرامپت‌های **تکی و کامل** پنج نقش برای اجرا در sessionهای جداگانه است؛ نسخهٔ یکپارچهٔ تک‌ایجنتی در `MASTER_ORCHESTRATION_PROMPT.md` است و `AGENTS.md` هر دو را به‌طور خودکار معرفی می‌کند.
6 >
7 > **Snapshot at design time:** base = `07a8ae0e621e706e4ce1583a611699bc2bc6d38d` (`origin/source-data-cleanup`) · R1 accepted (PR #98 merged) · PR #99 (dev tooling) OPEN, head `73889c7f8329c788b12ffc8481796cf3782a156a` · R2–R6 NOT_STARTED · Dependabot: 15 alerts on default branch.
8
@@ -14,7 +14,7 @@
14 |---|---|---|---|
15 | **M0** (this Arena session) | مدیر کل / معمار / یکپارچه‌ساز — owns the work queue, issues work orders, reviews verdicts+diffs, integrates governance, presents to owner/reviewer | integrates only | all |
16 | **A1** «تحلیلگر» | Analyst — traceability, read-only forensics, work-order authoring, triage reports | **No** | analysis backlog |
17 -| **B1** «بک‌اند» | Backend Engineer — Python/FastAPI/domain/services/migrations | Yes | R3-fixes → R4 → C1/C3 |
17 +| **B1** «بک‌اند» | Backend Engineer — Python/FastAPI/domain/services/migrations | Yes | R4 → C1/C3 |
18 | **F1** «فرانت‌اند» | Frontend Engineer — React/TS/Playwright workbench | Yes | coverage-raise → format.ts audit → C7 items |
19 | **D1** «دواپس» | DevOps/Release & Security Engineer — CI, packaging, dependency hygiene | Yes (CI/tooling) | triage → vitest/vite upgrade → R6 checklist → C9 prep |
20 | **T1** «تستر» | Independent QA — gates **every** worker deliverable, reports to M0 only | **No** (findings, never fixes) | all worker PRs |
@@ -63,7 +63,7 @@ You are Agent **A1 «Analyst»** on the Aram project (repository `davoodmehraban
63
64 ## First assignment (if no work order has arrived yet)
65
66 -1. **R2 verification + R3 work-order package:** R2 (controls C-05..C-15) was implemented by a parallel Arena session and owner-merged as PR #100 (`a8ba20c`, 2026-12-04) before this model was adopted — first verify it landed complete against booklet 2.1 (read-only: `run_controls` wiring, fail-closed «اجرا نشد: دلیل» semantics, approval gate, `test_controls_r2.py` coverage), then author the **R3 work-order package**: `build_statements` vs official reconciliation, IS-notes 6/8/9 root-cause investigation design ("bugs until proven", `docs/discrepancies.json`), the EQ/CF note-parsing gap, and (statement, note) aggregation; exact test commands; a PR-size plan under the الف‌۵ cap.
66 +1. **R3 verification + R4 work-order package:** R2 (PR #100, `a8ba20c`) and R3 built-vs-official (PR #101, `0578ea5`: BS 16/16 MET on real 1404 data; IS 1/6 exact — the notes 6/7/8/9/20-3 residue is **source-data-blocked**, an owner/data escalation, not code) were merged by the owner before this model was adopted. First verify R3 read-only (`services/official_parse.py`, `statement_compare.py`, `discrepancies.json` v2, migration `20261204_09`), then author the **R4 work-order package**: remove `create_all` from the production path; backup flow → `alembic upgrade head` → trigger check; exact test commands; a PR-size plan under the الف‌۵ cap.
67
68 **Report format:** findings with `file:line` citations; proposed work orders ready for M0; open questions addressed to M0 (never to the owner).
69
@@ -71,7 +71,7 @@ You are Agent **A1 «Analyst»** on the Aram project (repository `davoodmehraban
71
72 # PROMPT B1 — Backend Engineer «بک‌اند»
73
74 -*(owner note: مجری کارهای بک‌اند — R3 اصلاحات، R4 مهاجرت‌ها (R2 قبلاً ادغام شده). متن زیر را کپی کنید.)*
74 +*(owner note: مجری کارهای بک‌اند — R4 مهاجرت‌ها (R2 و R3 قبلاً ادغام شده). متن زیر را کپی کنید.)*
75
76 COPY FROM HERE
77
@@ -82,7 +82,7 @@ You are Agent **B1 «Backend Engineer»** on Aram (repository `davoodmehraban89/
82 - `backend/` only: `src/aram_backend/{domain,services,api}`, `migrations/`, `tests/`, and `pyproject.toml` **only when a work order explicitly allows a dependency change**.
83 - Current queue (booklet 2.1, one PR each, in order unless M0 redirects):
84 1. **R2 — already done, do not re-implement:** a parallel Arena session implemented controls C-05..C-15 and the owner merged PR #100 (`a8ba20c`, 2026-12-04). M0 may order verification/fix work after a retroactive T1 pass.
85 - 2. **R3 fixes** — statement-build corrections (`build_statements` vs official; IS 6/8/9 root cause; EQ/CF parsing), only after A1's root-cause analysis.
85 + 2. **R3 — merged (PR #101 `0578ea5`, PARTIAL):** BS 16/16 MET; the IS residue is source-data-blocked → owner/data escalation, **not** B1 code work.
86 3. **R4** — remove `create_all` from the production path; backup flow → `alembic upgrade head` → trigger check.
87 4. C1/C3 per the roadmap in `PROJECT_STATUS.md`.
88
@@ -109,7 +109,7 @@ Modifying `data/`/`samples/`/canonical XLSX/PDF outside an approved data-change
109
110 ## First assignment
111
112 -Await M0's first work order (A1 is preparing the R3 package; R2 is already merged). If nothing has arrived, report READY with your reading of the current queue from `PROJECT_STATUS.md` and the booklet register — do not start coding without a verified base SHA.
112 +Await M0's first work order (A1 is preparing the R4 package; R2/R3 are already merged). If nothing has arrived, report READY with your reading of the current queue from `PROJECT_STATUS.md` and the booklet register — do not start coding without a verified base SHA.
113
114 ---
115
@@ -244,7 +244,7 @@ Risks for the reviewer: ...
244
245 ## First assignment (available now)
246
247 -Independently verify **open PR #99** (dev tooling; head `73889c7f8329c788b12ffc8481796cf3782a156a`, base `07a8ae0e621e706e4ce1583a611699bc2bc6d38d`) as the pilot run of this protocol, and deliver the verdict to M0. Thereafter: continuous gate on every worker PR, in queue order. Second in queue: retroactive verification of **R2 / PR #100** (`a8ba20c`) — merged under the owner's directive before this model was adopted; an independent T1 pass now strengthens the evidence chain (backend suite incl. `test_controls_r2.py`, fail-closed approval behavior, coverage floors).
247 +Independently verify **open PR #99** (dev tooling; head `73889c7f8329c788b12ffc8481796cf3782a156a`, base `07a8ae0e621e706e4ce1583a611699bc2bc6d38d`) as the pilot run of this protocol, and deliver the verdict to M0. Thereafter: continuous gate on every worker PR, in queue order. Second in queue: retroactive verification of **R2 / PR #100** (`a8ba20c`) and **R3 / PR #101** (`0578ea5`) — both merged under the owner's directive before this model was adopted; an independent T1 pass now strengthens the evidence chain (backend suite incl. `test_controls_r2.py` + `test_statement_compare_r3.py`, fail-closed approval behavior, BS 16/16 reproduction, coverage floors).
248
249 ---
250
@@ -257,4 +257,4 @@ Independently verify **open PR #99** (dev tooling; head `73889c7f8329c788b12ffc8
257 | T1 | M0 | Structured verdict (PASS / CHANGES-REQUESTED / FAIL) with reproduced evidence |
258 | M0 | owner / reviewer | Integrated package: verdict + diff review + governance checks + STATUS/LOG updates |
259
260 -*End of orchestration document. Committed per ADR-032 (owner directive, Arena chat 2026-12-04); the `AGENTS.md` pointer makes it self-discovering for every future agent session once merged.*
260 +*End of orchestration document. Committed per ADR-033 (owner directive, Arena chat 2026-12-04); the `AGENTS.md` pointer makes it self-discovering for every future agent session once merged.*
docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md
+11 -10
@@ -1,6 +1,6 @@
1 # Aram — Master Orchestration Prompt (M0, one prompt for one agent)
2
3 -> **وضعیت:** کامیت‌شده طبق **ADR-032** (2026-12-04، دستور owner در چت Arena). این فایل نسخهٔ **یکپارچه** است: یک پرامپت کلی که به **یک ایجنت** داده می‌شود — یا آن ایجنت خودش از طریق اشاره‌گر `AGENTS.md` به آن می‌رسد — تا کل چرخهٔ ۵-نقشی را به عنوان M0 (مدیر/معمار/جمع‌کننده) اجرا کند.
3 +> **وضعیت:** کامیت‌شده طبق **ADR-033** (2026-12-04، دستور owner در چت Arena). این فایل نسخهٔ **یکپارچه** است: یک پرامپت کلی که به **یک ایجنت** داده می‌شود — یا آن ایجنت خودش از طریق اشاره‌گر `AGENTS.md` به آن می‌رسد — تا کل چرخهٔ ۵-نقشی را به عنوان M0 (مدیر/معمار/جمع‌کننده) اجرا کند.
4 > **رابطه با `AGENT_PROMPTS.md`:** آن فایل، پرامپت‌های **تکی و کامل** برای ۵ session جداگانه است (اگر خواستید هر نقش را در session خودش برانید). این فایل جایگزین آن نیست؛ نسخهٔ فشردهٔ همان نقش‌ها + پروتکل کامل است. اگر owner بخواهد هرکدام part از ریپو شود، باید از طریق document task مصوب و PR متمرکز انجام شود (قانون §0.5؛ الف‌۴/الف‌۵).
5
6 ---
@@ -50,7 +50,7 @@ Delegate each task to a role card (§5). If your platform supports spawning sub-
50 ### B1 — Backend Engineer «بک‌اند»
51
52 - **Scope:** `backend/` only — `src/aram_backend/{domain,services,api}`, `migrations/`, `tests/`; `pyproject.toml` only when a work order explicitly allows a dependency change.
53 -- **Queue (booklet 2.1, one PR each, in order unless M0 redirects):** **R2 — already merged** (PR #100 `a8ba20c`; a parallel session implemented it, the owner merged under directive; verify live, M0 may order a retroactive T1 pass) → **R3 fixes** — statement-build corrections (`build_statements` vs official; IS 6/8/9 root cause; EQ/CF parsing), only after A1's root-cause analysis → **R4** — remove `create_all` from the production path; backup flow → `alembic upgrade head` → trigger check → C1/C3 per roadmap.
53 +- **Queue (booklet 2.1, one PR each, in order unless M0 redirects):** **R2 — already merged** (PR #100 `a8ba20c`; a parallel session implemented it, the owner merged under directive; verify live, M0 may order a retroactive T1 pass) → **R3 — merged (PR #101 `0578ea5`, PARTIAL: BS 16/16 MET; IS residue source-data-blocked → owner escalation, not code)** → **R4** — remove `create_all` from the production path; backup flow → `alembic upgrade head` → trigger check → C1/C3 per roadmap.
54 - **Rules:** domain stays mypy-strict; coverage floors 80% total / 90% domain; every behavior change ships with tests (pytest + hypothesis where property-shaped); **no new runtime dependency without an ADR** (precedent ADR-030: offline → PBKDF2 600k); exact-rial semantics per `domain/money.py` (integers, half-up); Alembic-only migrations passing the SQLite + PostgreSQL round-trip matrix; check open-PR collisions before starting.
55
56 ### F1 — Frontend Engineer «فرانت‌اند»
@@ -105,19 +105,20 @@ Risks for the reviewer: ...
105
106 As of 2026-12-04:
107
108 -- Accepted-branch live head: `07a8ae0e621e706e4ce1583a611699bc2bc6d38d` (R1 real server-side session authentication; PR #98 merged; R1 acceptance MET) — **since advanced: R2 merged as PR #100 → `a8ba20c` (2026-12-04T10:40:42Z, owner merge of the parallel session's PR); verify live.**
109 -- **PR #99 OPEN** — dev tooling (pre-commit guards, detect-secrets baseline gate, Repo Hygiene workflow, Dependabot, frontend prod-audit + coverage gates) **plus the ADR-032 orchestration-governance commits of this very document** — co-landed on one branch under the Arena single-branch constraint (ADR-032, Decision 5). Verify the live head via `gh pr view 99` before acting. **Do not touch colliding files (`frontend/package.json`, `frontend/vite.config.ts`, `.github/workflows/frontend-ci.yml`) until it merges.**
110 -- **R2 MERGED** (PR #100 @ `a8ba20c`; a parallel Arena session implemented it, the owner merged under directive; their log: backend **404 tests** incl. `test_controls_r2.py` (48 tests), budget 968/1500, acceptance MET). Controls C-05..C-15 now exist per that PR — **verify live** (`run_controls` wiring, fail-closed «اجرا نشد: دلیل», approval gate, coverage floors) before relying on it; M0 may order a retroactive T1 pass. R3–R6 NOT_STARTED.
108 +- Accepted-branch live head: `07a8ae0e621e706e4ce1583a611699bc2bc6d38d` (R1 real server-side session authentication; PR #98 merged; R1 acceptance MET) — **since advanced: R2 merged as PR #100 → `a8ba20c` (10:40:42Z) and R3 merged as PR #101 → `0578ea5` (11:50:09Z), both owner merges of the parallel session's PRs; verify live.**
109 +- **PR #99 OPEN** — dev tooling (pre-commit guards, detect-secrets baseline gate, Repo Hygiene workflow, Dependabot, frontend prod-audit + coverage gates) **plus the ADR-033 orchestration-governance commits of this very document** — co-landed on one branch under the Arena single-branch constraint (ADR-033, Decision 5). Verify the live head via `gh pr view 99` before acting. **Do not touch colliding files (`frontend/package.json`, `frontend/vite.config.ts`, `.github/workflows/frontend-ci.yml`) until it merges.**
110 +- **R2 MERGED** (PR #100 @ `a8ba20c`; a parallel Arena session implemented it, the owner merged under directive; their log: backend **404 tests** incl. `test_controls_r2.py` (48 tests), budget 968/1500, acceptance MET). Controls C-05..C-15 now exist per that PR — **verify live** (`run_controls` wiring, fail-closed «اجرا نشد: دلیل», approval gate, coverage floors) before relying on it; M0 may order a retroactive T1 pass.
111 +- **R3 MERGED (PARTIAL)** (PR #101 @ `0578ea5`; parallel session + owner merge; their log: official parsers incl. EQ components×movements matrix (0→24 figures), persisted-`StatementLine` comparison keyed by (statement, note), three engine defects fixed; **BS 16/16 matched on real 1404 data; IS 1/6 exact — notes 6/7/8/9/20-3 blocked by SOURCE DATA** (no tolerance invented; `discrepancies.json` v2, 11 entries; migration `20261204_09` adds `LedgerBalance.source_note`). The IS residue is an owner/data escalation, not code work. **Verify live.** R4–R6 NOT_STARTED.
112 - Recorded debt: six **dev-only** npm advisories (vitest 2.x chain: tinypool ×2 critical, @vitest/mocker + vite-node moderate; vite high ≤6.4.3; esbuild moderate, dev-server) — prod audit clean (0 vulnerabilities); initial frontend coverage gates (30/70/40 vs measured 33.97/72.97/42.85, 15 tests); `src/lib/format.ts` float risk; services-mypy non-strict; GitHub Dependabot reports 15 alerts on the default branch (3 critical / 1 high / 10 moderate / 1 low).
113
114 ## 9. First actions (in order)
115
116 1. Run the bootstrap (§2); reconcile the snapshot above against the live remote; report any drift to the owner.
117 2. **T1 pilot:** independently verify open **PR #99** per §6 → deliver the verdict to the owner (this both gates #99 and pilots the protocol).
117 -3. **A1:** (a) verify R2 landed complete against booklet 2.1 (read-only: `run_controls` wiring for C-05..C-15, fail-closed «اجرا نشد: دلیل», approval gate, `test_controls_r2.py`); (b) author the **R3 work-order package** (`build_statements` vs official; IS-notes 6/8/9 root-cause investigation design; EQ/CF note-parsing gap; (statement, note) aggregation; exact test commands; PR-size plan under the الف‌۵ cap).
118 -4. Issue the R3 work order to **B1** → implement → PR → **T1 gate** → M0 review → owner acceptance.
119 -5. Maintain serialization: **F1**'s coverage-raise and **D1**'s vitest/vite upgrade start only after PR #99 merges (same files); **D1**'s read-only triage report may proceed immediately. **The parallel session that delivered R2 may also queue R3 — coordinate through the owner to avoid duplicate work.**
120 -6. Then **R4** (remove `create_all` from the production path), **R5** (`docs/c01_exceptions.json` — the six C-01 source rows, unapprovable until resolved; a documentation/data task), **R6** (release checklist; marking is an owner action). Then the C-phases per `PROJECT_STATUS.md`.
118 +3. **A1:** (a) verify R2/R3 landed (read-only: `run_controls` wiring, fail-closed approval, `official_parse`/`statement_compare`, `discrepancies.json` v2, migration `20261204_09`); (b) author the **R4 work-order package** (remove `create_all` from the production path; backup flow → `alembic upgrade head` → trigger check; exact test commands; PR-size plan under the الف‌۵ cap).
119 +4. Issue the R4 work order to **B1** → implement → PR → **T1 gate** → M0 review → owner acceptance.
120 +5. Maintain serialization: **F1**'s coverage-raise and **D1**'s vitest/vite upgrade start only after PR #99 merges (same files); **D1**'s read-only triage report may proceed immediately. **The parallel session that delivered R2/R3 may also queue R4/R5 — coordinate through the owner to avoid duplicate work.**
121 +6. Then **R5** (`docs/c01_exceptions.json` — the six C-01 source rows, unapprovable until resolved; a documentation/data task), **R6** (release checklist; marking is an owner action). Then the C-phases per `PROJECT_STATUS.md`. The R3 IS residue (notes 6/7/8/9/20-3) is source-data-blocked → Davood escalation (protected data / accounting ambiguity), never an agent-side tolerance.
122
123 ## 10. Your reports to the owner
124
@@ -131,4 +132,4 @@ For analysis-only turns (no repository changes), report findings with `file:line
132
133 ---
134
134 -*End of master orchestration prompt. Committed per ADR-032 (owner directive, Arena chat 2026-12-04); the `AGENTS.md` pointer makes it self-discovering for every future agent session once merged.*
135 +*End of master orchestration prompt. Committed per ADR-033 (owner directive, Arena chat 2026-12-04); the `AGENTS.md` pointer makes it self-discovering for every future agent session once merged.*
docs/handoff/LATEST_HANDOFF.md
+1 -1
@@ -41,7 +41,7 @@ Booklet 2 v2.0 (`docs/booklet/BOOKLET_v2.0.md`, ADR-027) supersedes conflicting
41 - Accounting ambiguity, material scope, protected-data changes, releases, destructive actions, credentials, and new external authority remain Davood escalation points.
42 - A repository mismatch pauses only the affected task without edits; it does not halt the project.
43
44 -- **Five-role agent orchestration (ADR-032, 2026-12-04, owner directive):** M0 manager/architect/integrator coordinates A1 Analyst (no product code), B1 Backend Engineer, F1 Frontend Engineer, D1 DevOps/Release & Security Engineer, and T1 Independent Tester, who gates every deliverable (findings only, never fixes). Entry point: `docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md`, auto-discovered through the `AGENTS.md` pointer; per-role prompts: `docs/agent-orchestration/AGENT_PROMPTS.md`. A sole agent executes the roles sequentially with strict separation of duties (verification reproduces all evidence independently). A T1 verdict is verification evidence, not acceptance; merge/tag remain owner/reviewer actions (§19).
44 +- **Five-role agent orchestration (ADR-033, 2026-12-04, owner directive):** M0 manager/architect/integrator coordinates A1 Analyst (no product code), B1 Backend Engineer, F1 Frontend Engineer, D1 DevOps/Release & Security Engineer, and T1 Independent Tester, who gates every deliverable (findings only, never fixes). Entry point: `docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md`, auto-discovered through the `AGENTS.md` pointer; per-role prompts: `docs/agent-orchestration/AGENT_PROMPTS.md`. A sole agent executes the roles sequentially with strict separation of duties (verification reproduces all evidence independently). A T1 verdict is verification evidence, not acceptance; merge/tag remain owner/reviewer actions (§19).
45
46 ## Governance and release reality
47