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
|---|---|---|---|
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
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
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
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
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
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
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
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.*