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

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

Synced Dec 4, 15:30 UTC

Governance: renumber orchestration ADR 031->032; make orchestration docs R2-aware

The parallel session's R2 PR (#100, merged as a8ba20c) landed docs/adr/ADR-031-r2-full-control-set.md, colliding with this branch's ADR-031-agent-orchestration.md. Per the add-new-ADR discipline (never rewrite an accepted ADR), the orchestration ADR becomes ADR-032 with a renumbering note; all refs updated (AGENTS.md, PROJECT_STATUS.md bullet, PROJECT_LOG entry, LATEST_HANDOFF, both orchestration docs). Also refresh stale queue/snapshot claims now that R2 is merged: - B1 queue: R2 marked done/do-not-reimplement; R3-fixes next - MASTER snapshot: live head advanced to a8ba20c; R2 MERGED bullet; first actions reordered (A1 verifies R2, then authors R3 package) - AGENT_PROMPTS: A1 first task, B1 scope/ready text, T1 retroactive verification pass on PR #100, F1 coverage note - LATEST_HANDOFF: next action = R3 after #99 acceptance, with parallel-session coordination warning Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>

davoodmehraban89 committed Dec 4, 2026 at 10:47 UTC 047119f8a0271494b6c73bd910665aaf427fe6bb
7 files changed +34 -33
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-031)
30 +## Agent orchestration (five-role model — ADR-032)
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-031, 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-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.
16
17 ## Status vocabulary
18
docs/PROJECT_LOG.md
+5 -4
@@ -454,12 +454,13 @@ Each new entry must record: UTC timestamp, actor, task/phase, base branch and SH
454 - Legacy tests updated to the new contract (four-control expectations in `test_domain_controls`, `test_preflight`, `test_statement_build`; approval-after-mapping-alone in `test_mapping_workflow`; locked-year setup in `test_editing` now builds a complete year through the API). No test was deleted or skipped to reach green.
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 -### 2026-12-04T10:40:55Z — ADR-031: five-role agent orchestration adopted + auto-discovery entry point (owner directive)
457 +### 2026-12-04T10:40:55Z — ADR-032: five-role agent orchestration adopted + auto-discovery entry point (owner directive)
458
459 - 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.
460 -- Landed: `docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md` + `AGENT_PROMPTS.md` (design from the earlier chat turns, now committed); `docs/adr/ADR-031-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).
460 +- 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 - 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`.**
462 -- الف‌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-031; the owner chooses combined acceptance or split.
462 +- الف‌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 - 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).
464 - Protected data: `data/` tree `2ef8a512523f62f0cf84c5009f141be2f8a9cb5f` + `samples/` tree `00aba54b1dc30485ba9b164c8036a7b4bbe9020e` unchanged (before = after).
465 -- Acceptance: IN_PROGRESS; author does not merge or tag. Next: independent review of the updated PR #99 (tooling + orchestration governance); after acceptance → R2 via the orchestration loop.
465 +- 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 +- 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).
docs/adr/ADR-032-agent-orchestration.md renamed
+3 -2
@@ -1,8 +1,9 @@
1 -# ADR-031 — Five-role agent orchestration and its auto-discovery entry point
1 +# ADR-032 — 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).
7
8 ## Context
9
@@ -59,7 +60,7 @@ Two placement problems had to be solved:
60 stays far under the cap excluding tests/generated data. **Split recipe if the
61 owner prefers separation:** (a) create a `tooling-only` branch from
62 `source-data-cleanup`, cherry-pick the four tooling commits
62 - (`38b1e65`, `9f915fe`, `3b16aa1`, `73889c7`), PR + independent review +
63 + (`38b1e65`, `9f915fe`, `3b16aa1`, `73889c7`; verify live via `gh pr view 99` — the branch has since merged the advanced base `a8ba20c`), PR + independent review +
64 merge; (b) the remaining diff on the session branch is governance-only →
65 second focused PR. Or the owner approves the combined merge (one-time waiver,
66 PR #96/#97 precedent).
docs/agent-orchestration/AGENT_PROMPTS.md
+11 -12
@@ -2,7 +2,7 @@
2
3 > **نسخهٔ یکپارچه:** پرامپت «کلی» تک‌ایجنتی (ارکستراتور M0) در `MASTER_ORCHESTRATION_PROMPT.md` همین پوشه است. این فایل، پرامپت‌های **تکی و کامل** برای ۵ session جداگانه باقی می‌ماند.
4
5 -> **وضعیت:** کامیت‌شده طبق **ADR-031** (2026-12-04، دستور owner در چت Arena). این فایل پرامپت‌های **تکی و کامل** پنج نقش برای اجرا در sessionهای جداگانه است؛ نسخهٔ یکپارچهٔ تک‌ایجنتی در `MASTER_ORCHESTRATION_PROMPT.md` است و `AGENTS.md` هر دو را به‌طور خودکار معرفی می‌کند.
5 +> **وضعیت:** کامیت‌شده طبق **ADR-032** (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 | R2 → R4 → R3-fixes → C1/C3 |
17 +| **B1** «بک‌اند» | Backend Engineer — Python/FastAPI/domain/services/migrations | Yes | R3-fixes → 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,8 +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 work-order package:** inventory controls C-05..C-15 against booklet 2.1 and the current `backend/src/aram_backend/domain/controls.py` (only C-01..C-04 exist today); identify wiring points in `run_controls` + the approval gate; per-control acceptance criteria (including «اجرا نشد: دلیل» reporting for controls lacking inputs) and exact test commands; a PR-size plan under the الف‌۵ cap.
67 -2. **R3 pre-analysis plan:** a reproducible, read-only investigation design for the IS 6/8/9 magnitude mismatches and the EQ/CF note-parsing gap.
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.
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
@@ -72,7 +71,7 @@ You are Agent **A1 «Analyst»** on the Aram project (repository `davoodmehraban
71
72 # PROMPT B1 — Backend Engineer «بک‌اند»
73
75 -*(owner note: مجری کارهای بک‌اند — R2 کنترل‌ها، R4 مهاجرت‌ها، اصلاحات R3. متن زیر را کپی کنید.)*
74 +*(owner note: مجری کارهای بک‌اند — R3 اصلاحات، R4 مهاجرت‌ها (R2 قبلاً ادغام شده). متن زیر را کپی کنید.)*
75
76 COPY FROM HERE
77
@@ -82,9 +81,9 @@ You are Agent **B1 «Backend Engineer»** on Aram (repository `davoodmehraban89/
81
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):
85 - 1. **R2** — controls C-05..C-15 wired into `run_controls` + the approval gate. Security-critical and **may not be deferred**; only C-01..C-04 exist today, so approval can currently pass on unbalanced data.
86 - 2. **R4** — remove `create_all` from the production path; backup flow → `alembic upgrade head` → trigger check.
87 - 3. **R3 fixes** — statement-build corrections, only after A1's root-cause analysis.
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.
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
89 ## Engineering rules
@@ -110,7 +109,7 @@ Modifying `data/`/`samples/`/canonical XLSX/PDF outside an approved data-change
109
110 ## First assignment
111
113 -Await M0's R2 work order (A1 is preparing the package). If nothing has arrived, report READY with your reading of R2 scope 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 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.
113
114 ---
115
@@ -126,7 +125,7 @@ You are Agent **F1 «Frontend Engineer»** on Aram (repository `davoodmehraban89
125
126 - `frontend/` only: `src/` (React 18 + TypeScript + Vite workbench, RTL Persian UI), `e2e/` (Playwright), `package.json`/lockfile, `vite.config.ts`, `eslint.config.js`, `tsconfig.json`, `playwright.config.ts`.
127 - Current queue (one PR each unless M0 redirects):
129 - 1. **Test-growing PR that raises the vitest coverage thresholds.** Initial gates landed 2026-12-04 (lines/statements 30, branches 70, functions 40 vs measured 33.97/72.97/42.85 — see the `PROJECT_LOG.md` entry of that date). Add component tests, priority order: `AdminPanel`, `ApprovalPanel`, `MappingPanel`, `NotesManager`, `StatementView`, `LedgerUpload` (all currently <3% covered), then raise thresholds consciously. **Thresholds are never auto-updated.**
128 + 1. **Test-growing PR that raises the vitest coverage thresholds.** Initial gates landed 2026-12-04 (lines/statements 30, branches 70, functions 40 vs measured 33.97/72.97/42.85 — see the `PROJECT_LOG.md` entry of that date). Add component tests, priority order: `AdminPanel`, `MappingPanel`, `NotesManager`, `StatementView`, `LedgerUpload` (all currently <3% covered; `ApprovalPanel` gained R2 tests in PR #100 — re-measure before ordering), then raise thresholds consciously. **Thresholds are never auto-updated.**
129 2. **`src/lib/format.ts` float-risk audit** (`Number(value)` — a recorded known gap feeding C7): produce findings for M0; any fix ships only via an M0-approved work order with exact-rial discipline.
130 3. R1 follow-ups and C7 UI items per future work orders (exact-rial Persian UI, work center, Ctrl+K, print templates, group dashboard).
131
@@ -245,7 +244,7 @@ Risks for the reviewer: ...
244
245 ## First assignment (available now)
246
248 -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.
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).
248
249 ---
250
@@ -258,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
261 -*End of orchestration document. Committed per ADR-031 (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-032 (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
+10 -10
@@ -1,6 +1,6 @@
1 # Aram — Master Orchestration Prompt (M0, one prompt for one agent)
2
3 -> **وضعیت:** کامیت‌شده طبق **ADR-031** (2026-12-04، دستور owner در چت Arena). این فایل نسخهٔ **یکپارچه** است: یک پرامپت کلی که به **یک ایجنت** داده می‌شود — یا آن ایجنت خودش از طریق اشاره‌گر `AGENTS.md` به آن می‌رسد — تا کل چرخهٔ ۵-نقشی را به عنوان M0 (مدیر/معمار/جمع‌کننده) اجرا کند.
3 +> **وضعیت:** کامیت‌شده طبق **ADR-032** (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** — controls C-05..C-15 wired into `run_controls` + the approval gate; security-critical and **may not be deferred** (only C-01..C-04 exist today, so approval can currently pass on unbalanced data) → **R4** — remove `create_all` from the production path; backup flow → `alembic upgrade head` → trigger check → **R3 fixes** — statement-build corrections, only after A1's root-cause analysis → 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 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.
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,19 @@ 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).
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-031 orchestration-governance commits of this very document** — co-landed on one branch under the Arena single-branch constraint (ADR-031, 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–R6 NOT_STARTED. Only controls C-01..C-04 exist; C-05..C-15 missing → approval can pass on unbalanced data (top priority; security/control defects may not be deferred).
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.
111 - 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).
112
113 ## 9. First actions (in order)
114
115 1. Run the bootstrap (§2); reconcile the snapshot above against the live remote; report any drift to the owner.
116 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:** author the **R2 work-order package**: inventory controls C-05..C-15 against booklet 2.1 and the current `backend/src/aram_backend/domain/controls.py`; wiring points in `run_controls` + the approval gate; per-control acceptance criteria (including «اجرا نشد: دلیل» reporting for controls lacking inputs); exact test commands; a PR-size plan under the الف‌۵ cap.
118 -4. Issue the R2 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.
120 -6. After R2 acceptance: **R3** (A1 root-cause → B1 fixes), **R4**, **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`.
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`.
121
122 ## 10. Your reports to the owner
123
@@ -131,4 +131,4 @@ For analysis-only turns (no repository changes), report findings with `file:line
131
132 ---
133
134 -*End of master orchestration prompt. Committed per ADR-031 (owner directive, Arena chat 2026-12-04); the `AGENTS.md` pointer makes it self-discovering for every future agent session once merged.*
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.*
docs/handoff/LATEST_HANDOFF.md
+3 -3
@@ -8,7 +8,7 @@
8
9 - Repository: davoodmehraban89/Aram
10 - Canonical branch: `source-data-cleanup`
11 -- **Live accepted head: `46253c94405abd065dfc5e8cf080b295cb83cde4`** — squash merge of [PR #96](https://github.com/davoodmehraban89/Aram/pull/96) at 2026-12-03T15:22:02Z (owner final acceptance). *(Superseded: the head has since advanced — PR #97 → `f2e6da5`, PR #98/R1 → `07a8ae0`; verify live.)*
11 +- **Live accepted head: `46253c94405abd065dfc5e8cf080b295cb83cde4`** — squash merge of [PR #96](https://github.com/davoodmehraban89/Aram/pull/96) at 2026-12-03T15:22:02Z (owner final acceptance). *(Superseded: the head has since advanced — PR #97 → `f2e6da5`, PR #98/R1 → `07a8ae0`, PR #100/R2 → `a8ba20c`; verify live.)*
12 - **Release tag `v1.0.0`** → `46253c94405abd065dfc5e8cf080b295cb83cde4` (owner-authorized, pre-mission). Author does not tag (§19).
13 - Post-merge CI on accepted head: [Backend #47137691800](https://github.com/davoodmehraban89/Aram/actions/runs/47137691800) ✅, [Frontend #47137691857](https://github.com/davoodmehraban89/Aram/actions/runs/47137691857) ✅.
14 - Booklet Phases 0–9 are **VERIFIED_AND_MERGED** at this head (319 backend tests; see `PROJECT_STATUS.md`).
@@ -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-031, 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-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).
45
46 ## Governance and release reality
47
@@ -54,4 +54,4 @@ Booklet 2 v2.0 (`docs/booklet/BOOKLET_v2.0.md`, ADR-027) supersedes conflicting
54
55 ## Single next action
56
57 -Independent GitHub review of PR #99 (verify the live head — the branch advances with pushes): dev tooling (pre-commit + secret gate, Repo Hygiene workflow, Dependabot, frontend prod-audit + coverage gates) **and** the ADR-031 five-role orchestration governance (owner directive, Arena chat 2026-12-04). After #99 acceptance, start R2 (booklet 2.1: controls C-05..C-15 wired into `run_controls` + the approval gate) from the new accepted head via the orchestration loop (M0 work order → B1 implements → T1 gates → M0 integrates), recording evidence in `PROJECT_STATUS.md`. Do not merge or tag; R2 starts only after #99 acceptance.
57 +Independent GitHub review of PR #99 (verify the live head — the branch advances with pushes): dev tooling (pre-commit + secret gate, Repo Hygiene workflow, Dependabot, frontend prod-audit + coverage gates) **and** the ADR-032 five-role orchestration governance (owner directive, Arena chat 2026-12-04). Note: a parallel Arena session delivered R2 (C-05..C-15) and the owner merged it as PR #100 (`a8ba20c`) on 2026-12-04, before this review. After #99 acceptance, start R3 (booklet 2.1: `build_statements` vs official; IS 6/8/9 root cause; EQ/CF parsing) from the new accepted head via the orchestration loop (M0 work order → B1 implements → T1 gates → M0 integrates), recording evidence in `PROJECT_STATUS.md`, and coordinate with the parallel session through the owner to avoid duplicate R3 work. Do not merge or tag.