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

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

Synced Dec 4, 14:15 UTC

Dev tooling gates + ADR-033 agent-orchestration governance (branch synced to R3 base 0578ea5) (#99)

* Tooling: pre-commit guards, detect-secrets baseline gate, Dependabot, Repo Hygiene workflow - .pre-commit-config.yaml: pre-commit-hooks v6.0.0 + ruff-pre-commit v0.17.6 (revs verified via GitHub API); ruff scopes mirror Backend CI exactly. end-of-file-fixer deliberately omitted (14 pre-existing EOF violations incl. governance-frozen files = unrelated churn); trailing-whitespace kept (zero pre-existing violations). - .secrets.baseline: 9 files / 18 reviewed false-positive findings. - scripts/check_secrets_baseline.py: churn-free CI gate — fails only on new (file, type, line-hash) triples; pragma allowlist escape hatch; negative- tested with a staged fake secret (exit 1) and pragma variant (exit 0). - .github/workflows/repo-hygiene.yml: pre-commit --all-files + secret gate on every PR and accepted-branch push. - .github/dependabot.yml: weekly github-actions/npm/pip updates (npm minors grouped; majors stay individual). Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> * CI: frontend prod-dependency npm audit gate + vitest coverage thresholds - frontend-ci quality job: npm audit --omit=dev --audit-level=moderate (prod deps must be moderate-clean; currently 0 vulnerabilities) and npm test -> npm run test:coverage. Dev-only advisories in the vitest/vite chain are recorded in PROJECT_LOG for a dedicated major-upgrade task (not shipped). - vite.config.ts: v8 coverage scoped to src/** (tests/main.tsx/d.ts excluded), thresholds lines/statements 30, branches 70, functions 40 vs measured baseline 33.97/72.97/42.85/33.97 (15 tests); autoUpdate off. - package.json/lock: @vitest/coverage-v8 ^2.1.9 devDependency (+ test:coverage script); lockfile +591 generated lines for its dependency tree. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> * Docs: PROJECT_LOG entry + PROJECT_STATUS CI-gap update for the tooling PR Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> * Fix: exclude .secrets.baseline from its own secret scan The baseline stores hashed_secret values and "hashed_secret" keys, which are secret-shaped by construction: the moment the file became tracked, every scan reported 22 self-referential findings (caught by the first CI run of PR #99; the pre-commit step of the same run passed). The gate now scans with --exclude-files '^\.secrets\.baseline$'; the documented regeneration command carries the same exclusion. PROJECT_LOG entry updated (same-PR doc). Verified: gate 0 new (18 baselined) on the tracked-baseline tree; negative test (staged fake secret) still exits 1 with file:line; pre-commit --all-files all hooks pass with zero modifications; git diff --check clean. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> * Docs(ADR-031): five-role agent orchestration — master prompt + per-role prompts - docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md: the consolidated single-agent prompt (M0 role, loop, invariants, verify-live snapshot, first actions) — owner directive, Arena chat 2026-12-04. - docs/agent-orchestration/AGENT_PROMPTS.md: the five per-role prompts (A1 Analyst / B1 Backend / F1 Frontend / D1 DevOps / T1 Independent Tester) for separate sessions. - docs/adr/ADR-031-agent-orchestration.md: decision record incl. the Arena single-branch constraint, the الف‌5 co-landing disclosure + split recipe, and the merge-activation semantics. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> * Governance: AGENTS.md orchestration pointer + STATUS/LOG/HANDOFF records (ADR-031) - AGENTS.md: compact 'Agent orchestration (five-role model — ADR-031)' section — the ecosystem's auto-read agent entry point now directs every future session to the master prompt before starting or resuming work; precedence clause (never overrides AGENTS.md / ACCEPTANCE_POLICY / booklets) included. - PROJECT_STATUS.md: Agent-operations bullet in the repository baseline. - docs/PROJECT_LOG.md: append-only entry (mechanism, الف‌5 disclosure, secret-gate re-verification, protected-data confirmation). - docs/handoff/LATEST_HANDOFF.md: governance-change refresh per ADR-026 — role-model entry, superseded-head note, current single-next-action. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> * 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> * 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> * Governance: record owner-delegated acceptance of PR #99 (PASS, combined); reviewed secret-baseline update for R3 integrity hashes Owner directive (this Arena chat, 2026-12-04): «خودت اینکاری که از من خواستی رو انجام بده» — the pending owner step (independent review + combined-vs-split decision for PR #99) is delegated to the author session; the independence waiver is recorded in PROJECT_LOG per the PR #100/#101 self-merge precedent. Verdict: PASS; decision: combined acceptance (option a); mechanics: squash merge, no tag. Also: reviewed baseline update (.secrets.baseline 18->19) for the two high-entropy false positives R3 introduced in docs/discrepancies.json (SHA-256 integrity digests; JSON cannot host pragma comments) so the gate is green on the merged tree; HANDOFF superseded-note + single-next- action refreshed (mechanism goes live for new sessions after this merge; next: R4 via the orchestration loop; IS residue = owner escalation). Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> --------- Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>

davoodmehraban89 committed Dec 4, 2026 at 17:40 UTC 70a0110aa39b04c73795812c8ac6293d6189071e
16 files changed +1695 -7
.github/dependabot.yml new
+31
@@ -0,0 +1,31 @@
1 +# Automated dependency update PRs — complements the existing scan gates
2 +# (pip-audit in Backend CI, prod-dependency npm audit in Frontend CI):
3 +# those detect vulnerabilities, Dependabot turns them into reviewed updates.
4 +#
5 +# Known limitation: Dependabot does not manage .pre-commit-config.yaml hook
6 +# revisions; bump those deliberately (see the header of that file).
7 +version: 2
8 +updates:
9 + - package-ecosystem: github-actions
10 + directory: /
11 + schedule:
12 + interval: weekly
13 +
14 + - package-ecosystem: npm
15 + directory: /frontend
16 + schedule:
17 + interval: weekly
18 + open-pull-requests-limit: 5
19 + groups:
20 + # Batch low-risk updates; majors (e.g. the pending vitest/vite upgrade
21 + # tracked after this tooling PR) stay individual and reviewable.
22 + npm-minor-and-patch:
23 + update-types:
24 + - minor
25 + - patch
26 +
27 + - package-ecosystem: pip
28 + directory: /backend
29 + schedule:
30 + interval: weekly
31 + open-pull-requests-limit: 5
.github/workflows/frontend-ci.yml
+9 -2
@@ -31,12 +31,19 @@ jobs:
31 cache-dependency-path: frontend/package-lock.json
32 - name: Install
33 run: npm ci --no-audit --no-fund
34 + - name: Dependency audit (prod deps, gate)
35 + # Gate: production dependencies must be free of moderate+ advisories.
36 + # The dev/test chain currently carries known advisories (vitest 2.x →
37 + # tinypool/vite-node/@vitest/mocker, vite, esbuild — all dev-only,
38 + # none shipped); clearing them needs a vitest/vite major upgrade, a
39 + # separate focused task per AGENTS.md (recorded in PROJECT_LOG.md).
40 + run: npm audit --omit=dev --audit-level=moderate
41 - name: ESLint
42 run: npm run lint
43 - name: TypeScript
44 run: npm run typecheck
38 - - name: Unit tests (vitest)
39 - run: npm test
45 + - name: Unit tests + coverage gate (vitest)
46 + run: npm run test:coverage
47 - name: Build
48 run: npm run build
49
.github/workflows/repo-hygiene.yml new
+30
@@ -0,0 +1,30 @@
1 +name: Repo Hygiene
2 +
3 +# Repo-wide tooling gate: the same pre-commit hooks developers run locally,
4 +# plus the churn-free detect-secrets baseline gate. Runs on every PR and on
5 +# pushes to the accepted branch (no path filter — hygiene covers everything).
6 +
7 +on:
8 + pull_request:
9 + push:
10 + branches:
11 + - source-data-cleanup
12 +
13 +permissions:
14 + contents: read
15 +
16 +jobs:
17 + hygiene:
18 + name: pre-commit + secret gate
19 + runs-on: ubuntu-latest
20 + steps:
21 + - uses: actions/checkout@v4
22 + - uses: actions/setup-python@v5
23 + with:
24 + python-version: "3.12"
25 + - name: Install tooling
26 + run: python -m pip install pre-commit detect-secrets
27 + - name: pre-commit (all files)
28 + run: pre-commit run --all-files --show-diff-on-failure
29 + - name: New-secret gate (detect-secrets baseline)
30 + run: python scripts/check_secrets_baseline.py
.pre-commit-config.yaml new
+50
@@ -0,0 +1,50 @@
1 +# Local pre-commit hygiene for the Aram repository.
2 +#
3 +# Role: catch issues *before* commit. CI remains the enforcement point —
4 +# .github/workflows/repo-hygiene.yml runs the same hooks via
5 +# `pre-commit run --all-files`, plus the churn-free new-secret gate
6 +# (scripts/check_secrets_baseline.py against .secrets.baseline).
7 +#
8 +# Hook revisions are pinned to tags verified via the GitHub API on 2026-12-04
9 +# (pre-commit-hooks v6.0.0, ruff-pre-commit v0.17.6 — satisfies the backend
10 +# pyproject constraint ruff>=0.8,<1). Dependabot does not manage this file;
11 +# bump revisions deliberately with `pre-commit autoupdate` and re-run the
12 +# suites (one focused PR, per AGENTS.md).
13 +#
14 +# detect-secrets is intentionally NOT a pre-commit hook here: its baseline
15 +# mode rewrites .secrets.baseline line numbers (exit code 3) whenever a file
16 +# holding a baselined false positive is edited, which conflicts with this
17 +# repo's strict diff discipline. Secret enforcement lives in the CI gate.
18 +repos:
19 + - repo: https://github.com/pre-commit/pre-commit-hooks
20 + rev: v6.0.0
21 + hooks:
22 + - id: check-added-large-files
23 + args: [--maxkb=1024]
24 + # data/ and samples/ hold the protected canonical sources (largest:
25 + # ~31 MB XLSX); they are read-only per AGENTS.md and are never
26 + # grown through tooling.
27 + exclude: '^(data|samples)/'
28 + - id: check-merge-conflict
29 + - id: check-toml
30 + - id: check-yaml
31 + - id: detect-private-key
32 + # trailing-whitespace only: the repo currently has zero trailing-whitespace
33 + # violations (verified 2026-12-04), so this hook adds churn-free value.
34 + # end-of-file-fixer is deliberately NOT enabled: 14 pre-existing files
35 + # (including governance-frozen docs/handoff and docs/archive files) lack
36 + # the convention, and normalizing them repo-wide is unrelated churn
37 + # against AGENTS.md's focused-diff rule. PR diffs stay clean via the
38 + # existing `git diff --check` CI steps.
39 + - id: trailing-whitespace
40 + - repo: https://github.com/astral-sh/ruff-pre-commit
41 + rev: v0.17.6
42 + hooks:
43 + # Mirrors Backend CI: `ruff check src tests` (run from backend/).
44 + # Ruff discovers backend/pyproject.toml by walking up from each file.
45 + - id: ruff-check
46 + files: ^backend/(src|tests)/.*\.py$
47 + args: [--fix]
48 + # Mirrors the Backend CI format gate: domain, services, migrations only.
49 + - id: ruff-format
50 + files: ^backend/(src/aram_backend/(domain|services)|migrations)/.*\.py$
.secrets.baseline new
+285
@@ -0,0 +1,285 @@
1 +{
2 + "version": "1.5.0",
3 + "plugins_used": [
4 + {
5 + "name": "ArtifactoryDetector"
6 + },
7 + {
8 + "name": "AWSKeyDetector"
9 + },
10 + {
11 + "name": "AzureStorageKeyDetector"
12 + },
13 + {
14 + "name": "Base64HighEntropyString",
15 + "limit": 4.5
16 + },
17 + {
18 + "name": "BasicAuthDetector"
19 + },
20 + {
21 + "name": "CloudantDetector"
22 + },
23 + {
24 + "name": "DiscordBotTokenDetector"
25 + },
26 + {
27 + "name": "GitHubTokenDetector"
28 + },
29 + {
30 + "name": "GitLabTokenDetector"
31 + },
32 + {
33 + "name": "HexHighEntropyString",
34 + "limit": 3.0
35 + },
36 + {
37 + "name": "IbmCloudIamDetector"
38 + },
39 + {
40 + "name": "IbmCosHmacDetector"
41 + },
42 + {
43 + "name": "IPPublicDetector"
44 + },
45 + {
46 + "name": "JwtTokenDetector"
47 + },
48 + {
49 + "name": "KeywordDetector",
50 + "keyword_exclude": ""
51 + },
52 + {
53 + "name": "MailchimpDetector"
54 + },
55 + {
56 + "name": "NpmDetector"
57 + },
58 + {
59 + "name": "OpenAIDetector"
60 + },
61 + {
62 + "name": "PrivateKeyDetector"
63 + },
64 + {
65 + "name": "PypiTokenDetector"
66 + },
67 + {
68 + "name": "SendGridDetector"
69 + },
70 + {
71 + "name": "SlackDetector"
72 + },
73 + {
74 + "name": "SoftlayerDetector"
75 + },
76 + {
77 + "name": "SquareOAuthDetector"
78 + },
79 + {
80 + "name": "StripeDetector"
81 + },
82 + {
83 + "name": "TelegramBotTokenDetector"
84 + },
85 + {
86 + "name": "TwilioKeyDetector"
87 + }
88 + ],
89 + "filters_used": [
90 + {
91 + "path": "detect_secrets.filters.allowlist.is_line_allowlisted"
92 + },
93 + {
94 + "path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
95 + "min_level": 2
96 + },
97 + {
98 + "path": "detect_secrets.filters.heuristic.is_indirect_reference"
99 + },
100 + {
101 + "path": "detect_secrets.filters.heuristic.is_likely_id_string"
102 + },
103 + {
104 + "path": "detect_secrets.filters.heuristic.is_lock_file"
105 + },
106 + {
107 + "path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
108 + },
109 + {
110 + "path": "detect_secrets.filters.heuristic.is_potential_uuid"
111 + },
112 + {
113 + "path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
114 + },
115 + {
116 + "path": "detect_secrets.filters.heuristic.is_sequential_string"
117 + },
118 + {
119 + "path": "detect_secrets.filters.heuristic.is_swagger_file"
120 + },
121 + {
122 + "path": "detect_secrets.filters.heuristic.is_templated_secret"
123 + },
124 + {
125 + "path": "detect_secrets.filters.regex.should_exclude_file",
126 + "pattern": [
127 + "^\\.secrets\\.baseline$"
128 + ]
129 + }
130 + ],
131 + "results": {
132 + ".github/workflows/backend-ci.yml": [
133 + {
134 + "type": "Secret Keyword",
135 + "filename": ".github/workflows/backend-ci.yml",
136 + "hashed_secret": "947f6c13826812af1df6a3fba06092a9b6c6b082",
137 + "is_verified": false,
138 + "line_number": 67
139 + },
140 + {
141 + "type": "Basic Auth Credentials",
142 + "filename": ".github/workflows/backend-ci.yml",
143 + "hashed_secret": "947f6c13826812af1df6a3fba06092a9b6c6b082",
144 + "is_verified": false,
145 + "line_number": 96
146 + }
147 + ],
148 + "backend/tests/conftest.py": [
149 + {
150 + "type": "Secret Keyword",
151 + "filename": "backend/tests/conftest.py",
152 + "hashed_secret": "a761ce3a45d97e41840a788495e85a70d1bb3815",
153 + "is_verified": false,
154 + "line_number": 55
155 + }
156 + ],
157 + "backend/tests/test_auth_r1.py": [
158 + {
159 + "type": "Secret Keyword",
160 + "filename": "backend/tests/test_auth_r1.py",
161 + "hashed_secret": "a761ce3a45d97e41840a788495e85a70d1bb3815",
162 + "is_verified": false,
163 + "line_number": 147
164 + },
165 + {
166 + "type": "Secret Keyword",
167 + "filename": "backend/tests/test_auth_r1.py",
168 + "hashed_secret": "a4b48a81cdab1e1a5dd37907d6c85ca1c61ddc7c",
169 + "is_verified": false,
170 + "line_number": 195
171 + },
172 + {
173 + "type": "Secret Keyword",
174 + "filename": "backend/tests/test_auth_r1.py",
175 + "hashed_secret": "a0f4ea7d91495df92bbac2e2149dfb850fe81396",
176 + "is_verified": false,
177 + "line_number": 244
178 + }
179 + ],
180 + "backend/tests/test_desktop.py": [
181 + {
182 + "type": "Secret Keyword",
183 + "filename": "backend/tests/test_desktop.py",
184 + "hashed_secret": "a761ce3a45d97e41840a788495e85a70d1bb3815",
185 + "is_verified": false,
186 + "line_number": 42
187 + }
188 + ],
189 + "backend/tests/test_phase7_admin.py": [
190 + {
191 + "type": "Secret Keyword",
192 + "filename": "backend/tests/test_phase7_admin.py",
193 + "hashed_secret": "a761ce3a45d97e41840a788495e85a70d1bb3815",
194 + "is_verified": false,
195 + "line_number": 33
196 + },
197 + {
198 + "type": "Secret Keyword",
199 + "filename": "backend/tests/test_phase7_admin.py",
200 + "hashed_secret": "6809ffccad03b80fa1fbc32c17e7e054805ec30b",
201 + "is_verified": false,
202 + "line_number": 42
203 + },
204 + {
205 + "type": "Secret Keyword",
206 + "filename": "backend/tests/test_phase7_admin.py",
207 + "hashed_secret": "7b4a96a03e149bc7e60c4be90af2ac8d0263c9b8",
208 + "is_verified": false,
209 + "line_number": 47
210 + },
211 + {
212 + "type": "Secret Keyword",
213 + "filename": "backend/tests/test_phase7_admin.py",
214 + "hashed_secret": "a0f4ea7d91495df92bbac2e2149dfb850fe81396",
215 + "is_verified": false,
216 + "line_number": 51
217 + },
218 + {
219 + "type": "Secret Keyword",
220 + "filename": "backend/tests/test_phase7_admin.py",
221 + "hashed_secret": "76272dc4faf660733711f58c736830d27159fb55",
222 + "is_verified": false,
223 + "line_number": 190
224 + }
225 + ],
226 + "docs/PR_TRIAGE.md": [
227 + {
228 + "type": "Secret Keyword",
229 + "filename": "docs/PR_TRIAGE.md",
230 + "hashed_secret": "7cf7e45529afc6745661299b9e474962735edee3",
231 + "is_verified": false,
232 + "line_number": 29
233 + }
234 + ],
235 + "docs/booklet/MANIFEST.json": [
236 + {
237 + "type": "Hex High Entropy String",
238 + "filename": "docs/booklet/MANIFEST.json",
239 + "hashed_secret": "23aaf83e5af5fa7a72a3b7e983b67cf750450759",
240 + "is_verified": false,
241 + "line_number": 8
242 + },
243 + {
244 + "type": "Hex High Entropy String",
245 + "filename": "docs/booklet/MANIFEST.json",
246 + "hashed_secret": "6b4fe462cfda805c0db69cf79b56c59172e1edee",
247 + "is_verified": false,
248 + "line_number": 20
249 + },
250 + {
251 + "type": "Hex High Entropy String",
252 + "filename": "docs/booklet/MANIFEST.json",
253 + "hashed_secret": "e5f276510250c95ab38a93f3eb15da24fab10c48",
254 + "is_verified": false,
255 + "line_number": 25
256 + }
257 + ],
258 + "docs/discrepancies.json": [
259 + {
260 + "type": "Hex High Entropy String",
261 + "filename": "docs/discrepancies.json",
262 + "hashed_secret": "49428be58f5d1c763e3dda4d850cc5fff8227e16",
263 + "is_verified": false,
264 + "line_number": 7
265 + },
266 + {
267 + "type": "Hex High Entropy String",
268 + "filename": "docs/discrepancies.json",
269 + "hashed_secret": "0eec05257a5d5a321adcafcd4180022674049b32",
270 + "is_verified": false,
271 + "line_number": 9
272 + }
273 + ],
274 + "frontend/e2e/helpers.ts": [
275 + {
276 + "type": "Secret Keyword",
277 + "filename": "frontend/e2e/helpers.ts",
278 + "hashed_secret": "a761ce3a45d97e41840a788495e85a70d1bb3815",
279 + "is_verified": false,
280 + "line_number": 3
281 + }
282 + ]
283 + },
284 + "generated_at": "2026-12-04T14:05:45Z"
285 +}
AGENTS.md
+21
@@ -27,6 +27,27 @@ 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-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,
34 +**F1** Frontend Engineer, **D1** DevOps/Release & Security Engineer, and
35 +**T1** Independent Tester, who gates every deliverable and never fixes code.
36 +
37 +Before starting or resuming any task in this repository, read
38 +`docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md` — it defines the
39 +roles, the work-order → focused-PR → tester-verdict → integration loop,
40 +serialization rules against open PRs, and first actions. Full per-role prompts:
41 +`docs/agent-orchestration/AGENT_PROMPTS.md` (use when the roles run as separate
42 +sessions).
43 +
44 +A sole agent without sub-agent capability executes the roles sequentially with
45 +strict separation of duties: the verification phase must independently
46 +reproduce all evidence (fresh checkout, re-run commands, CI on the real head
47 +SHA) and never trust the implementation phase's claims. The orchestration
48 +documents add operating procedure only — they never override this file,
49 +`PROJECT_STATUS.md`, `docs/ACCEPTANCE_POLICY.md`, or the governing booklets.
50 +
51 ## Verification
52
53 - Run the exact tests required by the task.
PROJECT_STATUS.md
+3 -1
@@ -12,6 +12,8 @@
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-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
19 | State | Meaning |
@@ -160,7 +162,7 @@ non-statement rows (BS 6/16 → 16/16), and per-row note assignment was lost (mi
162 - ImportRun/CalculationRun/LineageEdge/Adjustment/UnknownAccountQueue/carried_from_year_id/calculation_run_id refs absent; pilot exception queue not persisted in `domain/` (C1/C4).
163 - `note_engine.acct()` is closing-only; statement_balance-only rows evaluate 0 in notes (C1/C3).
164 - No connector framework / Source Adapter / snapshot reconciliation / packs yet; generality grep test pending (C4/C5/C6).
163 -- CI: `npm ci --no-audit`, coverage gate not 80/90, services mypy non-strict (C9).
165 +- CI: prod-dependency `npm audit --omit=dev --audit-level=moderate` gate + initial frontend coverage gate (thresholds lines/statements 30, branches 70, functions 40 vs measured 33.97/72.97/42.85) + repo-wide pre-commit/secret-gate/Dependabot added by the 2026-12-04 tooling PR (frontend coverage + audit in Frontend CI; `Repo Hygiene` workflow runs pre-commit + detect-secrets baseline gate on every PR). Dev-only advisories in the vitest/vite chain (tinypool ×2 critical, vite high, esbuild/@vitest/mocker/vite-node moderate — none shipped; prod audit clean) await a dedicated vitest+vite major-upgrade task. **The 80/90 frontend coverage target and services-mypy strictness remain open (C9).**
166 - Backup unencrypted; no DPAPI vault / plugin allowlist / SBOM yet (C8/C9).
167 - Browser edition removed (C0); single reference UI = React workbench. Backend `static/pilot` files remain in the tree but are no longer served or mounted (R1); the pilot router keeps the `current_user` dependency and is exercised only by a test-only app.
168 - Windows EXE not built; clean-machine install log + Shadow Run two-company + owner signature pending (C9/C10).
docs/PROJECT_LOG.md
+36
@@ -431,6 +431,19 @@ Each new entry must record: UTC timestamp, actor, task/phase, base branch and SH
431 - Protected data: `data/` tree 2ef8a512523f62f0cf84c5009f141be2f8a9cb5f and `samples/` tree 00aba54b1dc30485ba9b164c8036a7b4bbe9020e unchanged (before = after).
432 - Acceptance: R1 **MET**; author does not merge or tag. Stop after R1 per booklet 2.1 §8. Next: independent GitHub review of the R1 PR; R2 only after acceptance.
433
434 +### 2026-12-04T09:56:00Z — Dev tooling: pre-commit guards + secret gate + CI quality gates (owner-requested)
435 +
436 +- Actor: Arena agent (implementation). Trigger: owner asked which tooling would best improve the software and selected the four low-risk items in chat (pre-commit + detect-secrets; prod npm-audit gate; frontend coverage gate; Dependabot). Worked on `arena/2d4eda07-aram` off verified base `07a8ae0e621e706e4ce1583a611699bc2bc6d38d` (= `origin/source-data-cleanup` at fetch time; Arena single-branch session constraint, same as R1).
437 +- `.pre-commit-config.yaml`: pre-commit-hooks v6.0.0 (large-files 1 MB with `data/`+`samples/` excluded, merge-conflict, toml, yaml, detect-private-key, trailing-whitespace) + ruff-pre-commit v0.17.6 (satisfies backend `ruff>=0.8,<1`; revs verified via GitHub API 2026-12-04; hook scopes mirror Backend CI exactly: check on `backend/{src,tests}`, format on domain/services/migrations). `end-of-file-fixer` deliberately NOT enabled: 14 pre-existing files (incl. governance-frozen `docs/handoff/CHATGPT_BOOTSTRAP_PROMPT.txt` and `docs/archive/`) lack the convention; repo-wide normalization is unrelated churn against the focused-diff rule, and the existing `git diff --check` CI steps keep PR diffs clean. `trailing-whitespace` enabled — zero pre-existing violations (verified).
438 +- Secret scanning: `.secrets.baseline` (9 files / 18 findings — reviewed false positives: backend test-fixture passwords, the CI PostgreSQL dummy password, docs SHA-256 hashes) + `scripts/check_secrets_baseline.py`, a churn-free gate failing only on NEW (file, plugin type, line-hash) triples; `# pragma: allowlist secret` is the documented escape hatch. The baseline excludes **itself** from the scan (`--exclude-files '^\.secrets\.baseline$'`): its `hashed_secret` values are secret-shaped by construction, so once the file is tracked a naive scan reports 22 self-referential findings (caught by this PR's first CI run; the gate script and the documented regeneration command carry the same exclusion). detect-secrets is intentionally NOT a pre-commit hook: its baseline mode rewrites line numbers (exit 3) whenever a baselined file is edited — churn incompatible with الف‌4 diff discipline. Gate negative-tested: staged fake secret → exit 1 with file:line; pragma variant → exit 0; cleanup → exit 0.
439 +- CI: new `Repo Hygiene` workflow (`.github/workflows/repo-hygiene.yml`) — `pre-commit run --all-files` + the secret gate on every PR and accepted-branch push (no path filter). Frontend CI quality job: added `npm audit --omit=dev --audit-level=moderate` (prod deps must be moderate-clean; install keeps `--no-audit` for speed) and replaced bare `npm test` with `npm run test:coverage`.
440 +- Frontend coverage gate (`frontend/vite.config.ts`, `@vitest/coverage-v8` ^2.1.9): scope `src/**` excluding test files/main.tsx/d.ts; thresholds lines/statements 30, branches 70, functions 40 against the measured 2026-12-04 baseline (33.97/72.97/42.85/33.97, 15 tests); `autoUpdate: false`. Raising toward the C9 80/90 target is a separate test-growing task.
441 +- `.github/dependabot.yml`: weekly updates — github-actions (/), npm (frontend, minor+patch grouped, majors individual), pip (backend). Documented limitation: Dependabot does not manage `.pre-commit-config.yaml` revs (bump deliberately via `pre-commit autoupdate`).
442 +- **Dev-dependency debt recorded, NOT fixed here ( الف‌5 — needs a major upgrade, own task):** full `npm audit` reports 6 dev-only advisories — vitest 2.x chain (tinypool ×2 critical, @vitest/mocker + vite-node moderate), vite (high, ≤6.4.3), esbuild (moderate, dev-server only). None ship to users (prod audit: 0 vulnerabilities); `npm audit fix --force` would jump vitest 2→5 (breaking). Owner-scheduled upgrade task.
443 +- Evidence: `pre-commit run --all-files` — all hooks Passed, zero file modifications; secret gate 0 new; frontend eslint + tsc clean; **15 vitest tests pass** under the coverage gate; `npm run build` clean; `npm ci` reproduces the lockfile (+591 lines = generated `@vitest/coverage-v8` dependency tree). Backend code untouched (Backend CI path filter unaffected); no R-task scope touched.
444 +- Protected data: `data/` tree `2ef8a512523f62f0cf84c5009f141be2f8a9cb5f` and `samples/` tree `00aba54b1dc30485ba9b164c8036a7b4bbe9020e` unchanged (before = after).
445 +- Acceptance: IN_PROGRESS; author does not merge or tag. Next: independent review of the tooling PR; the vitest/vite major upgrade and any coverage-threshold raise are follow-up tasks.
446 +
447 ### 2026-12-04T10:20:00Z — R2 full control set C-01..C-15 (booklet 2.1)
448
449 - Actor: Arena agent (implementation **and merge**, per the owner's 2026-12-04 directive "خودت کامل انجام بده و دیگه متوقف نشو"). Precondition: PR #98 (R1) squash-merged → accepted head **07a8ae0e621e706e4ce1583a611699bc2bc6d38d**; working branch aligned to that tree before starting, so this diff is R2-only.
@@ -442,6 +455,17 @@ 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-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-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-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→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)
470
471 - Actor: Arena agent (implementation and merge). Precondition: PR #100 (R2) squash-merged → accepted head **a8ba20c1bc5595ceaa73ff30be8dd91748a87a6e**; working branch aligned before starting.
@@ -452,3 +476,15 @@ Each new entry must record: UTC timestamp, actor, task/phase, base branch and SH
476 - **Acceptance: R3 PARTIAL — BS 16/16 MET, IS 6/6 NOT MET.** The IS blocker is source data, not code: no tolerance was invented and no figure was adjusted to force a match. Root causes for IS 6/7/8/9/20-3 are established with account-by-account evidence.
477 - `docs/discrepancies.json` regenerated (schema v2) from the built output: 11 entries, each with cause, official cell and account deltas; source/official SHA-256 recorded.
478 - Protected data: `data/` and `samples/` trees unchanged. Tag `v1.0.0` untouched.
479 +
480 +### 2026-12-04T14:04:53Z — PR #99 acceptance delegated to the author session; self-review PASS; combined acceptance; squash merge
481 +
482 +- Actor: Arena agent (M0/author). Trigger: owner directive in this Arena chat (2026-12-04): «خودت اینکاری که از من خواستی رو انجام بده» — delegating the pending owner step for PR #99 (independent review + combined-vs-split acceptance decision) to the author session.
483 +- Independence waiver (recorded, الف‌4): the review below was performed by the author session itself, not an independent reviewer, per the owner delegation — the same owner-authorized pattern as the PR #100/#101 self-merges earlier the same day. GitHub remains the evidence source of truth.
484 +- Base-sync event: `source-data-cleanup` advanced to R3 (`0578ea5`, PR #101, owner-merged 11:50:09Z) while this PR was open. The branch merged that base again (no force-push; ADR-028 precedent); the `PROJECT_LOG.md` conflict was resolved append-only and chronological (R2 10:20 → orchestration 10:40 → R3 11:30, both sides untouched). The orchestration ADR was renumbered **032→033** (R3 holds `ADR-032-r3-built-vs-official.md`).
485 +- Review verdict: **PASS** at the synced head — pre-commit 8/8 hooks; secret gate 0 new (one baseline finding gone: R2 removed the inline `"supersecret"` test fixture from `test_editing.py`; the gate fails only on new findings, baseline intentionally not regenerated); `git diff --check` clean; protected trees unchanged (`data` `2ef8a512…`, `samples` `00aba54b…`); backend on the merged tree: pytest **407 passed** exit 0, `ruff check src tests` clean, `ruff format --check` (domain/services/migrations) clean, mypy domain-strict + services clean, coverage **89.92%** total / **96%** domain (floors 80/90); frontend lint/typecheck/test:coverage/build exit 0 and prod audit 0 vulnerabilities; CI on the pushed head: Repo Hygiene + Frontend CI (incl. Playwright e2e, 7 passed) success.
486 +- Acceptance decision: **combined (option a)** — tooling gates + ADR-033 governance land in one squash merge. Rationale: a single verified head with green CI on that exact head; the split recipe (cherry-pick `38b1e65`/`9f915fe`/`3b16aa1`/`73889c7` onto a tooling-only branch) stays documented in ADR-033 for future reference; PR #96/#97 precedent covers combined-scope owner waivers.
487 +- Mechanics: squash merge per repo convention; accepted-head record rides in the merged `docs/handoff/LATEST_HANDOFF.md`; **no tag** (author does not tag; `v1.0.0` untouched).
488 +- Secret-gate event (found during pre-merge re-verification on the synced tree): the merged R3 tree carries 2 detect-secrets findings at `docs/discrepancies.json:7,9` — the `source_sha256`/`official_sha256` integrity digests (high-entropy hex; **reviewed false positives**: recomputable from data files already committed to the repo; JSON cannot carry inline pragma comments). R3 merged before the gate existed on the canonical branch (the gate is part of this PR). Resolution: reviewed baseline update via the documented command (`detect-secrets scan --exclude-files '^\.secrets\.baseline$'`) → **19 findings, gate green on the merged tree**; the baseline was not regenerated to silence unreviewed content. Future note: regenerating `discrepancies.json` against new file hashes will require the same reviewed baseline update.
489 +- Post-sync re-verification (docs-only delta since the `047119f` evidence above): pre-commit 8/8 hooks passed; secret gate green (above); `git diff --check` clean; protected trees unchanged (`data` `2ef8a512…`, `samples` `00aba54b…`). Backend is untouched by this PR's delta — the R3 backend state is CI-verified at `0578ea5` (PR #101: lint/types/coverage pass; migration round-trips pass on sqlite and postgresql), so no local re-run was needed; frontend gates run in CI on the final head.
490 +- Effect: with this merge, the five-role orchestration mechanism (`AGENTS.md` pointer → `docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md`) **goes live for all new Arena sessions**. Next work per the refreshed snapshots: R4 via the orchestration loop; R3's IS residue (notes 6/7/8/9/20-3) is source-data-blocked → Davood escalation (protected data / accounting ambiguity), not agent code work.
docs/adr/ADR-033-agent-orchestration.md new
+88
@@ -0,0 +1,88 @@
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; 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 +
10 +The owner directed (2026-12-04, Arena chat) that work on Aram proceeds through
11 +five specialized agents — an analyst, an independent tester who gates every
12 +deliverable, and three implementers — coordinated by a manager/architect/
13 +integrator (M0, the Arena session) — and that the whole design be placed where
14 +**every future agent session discovers it automatically**, so the owner never
15 +has to paste prompts or name files in a new chat ("you pick the best method").
16 +
17 +The design was elaborated and approved in chat: roster (M0 + A1 Analyst, B1
18 +Backend, F1 Frontend, D1 DevOps/Release & Security, T1 Independent Tester),
19 +the work-order → focused-PR → tester-verdict → integration loop, serialization
20 +rules, and the governance invariants each role must obey.
21 +
22 +Two placement problems had to be solved:
23 +
24 +1. **Discovery.** New agent sessions start with no chat memory and a clean
25 + checkout of the canonical branch; untracked files do not propagate. The
26 + entry point must be a file every agent in this ecosystem reads first.
27 + `AGENTS.md` is that file (its own header: "these instructions apply to every
28 + AI coding agent working in this repository, including Jules, Copilot, and
29 + Codex").
30 +2. **Branch constraint.** The Arena session is pinned to a single branch
31 + (`arena/2d4eda07-aram`, currently carrying open tooling PR #99). System-level
32 + rule: never create/push any other branch (precedents: ADR-028; R1 PROJECT_LOG
33 + entry).
34 +
35 +## Decision (§14 default + proof)
36 +
37 +1. **Commit the orchestration documents** at `docs/agent-orchestration/`
38 + (`MASTER_ORCHESTRATION_PROMPT.md` — the consolidated single-agent prompt;
39 + `AGENT_PROMPTS.md` — the five per-role prompts for separate sessions).
40 + These are operating procedure, not analytical documents; the ban on new
41 + root-level analytical documents is unchanged.
42 +2. **Add a compact pointer section to `AGENTS.md`** so every future session
43 + discovers the model automatically: read the master prompt before starting or
44 + resuming any task. A sole agent without sub-agent capability executes the
45 + roles sequentially with **strict separation of duties** — the verification
46 + phase (T1) independently reproduces all evidence and never trusts the
47 + implementation phase's claims.
48 +3. **Precedence is unchanged:** the orchestration documents add procedure only;
49 + they never override `AGENTS.md`, `PROJECT_STATUS.md`,
50 + `docs/ACCEPTANCE_POLICY.md`, or the governing booklets. A T1 verdict is
51 + verification evidence, not acceptance; merge/tag remain owner/reviewer
52 + actions (§19).
53 +4. **Governance records** updated per §0.5: this ADR; a `PROJECT_STATUS.md`
54 + bullet; a `docs/PROJECT_LOG.md` entry; and a `docs/handoff/LATEST_HANDOFF.md`
55 + refresh (governance change → the ADR-026 cadence applies: role-model entry,
56 + superseded-head note, current single-next-action).
57 +5. **الف‌5 compromise (disclosed under الف‌4):** the governance commits land on
58 + the open PR #99 branch — forced by the single-branch constraint, not by
59 + convenience. No code, data, or workflow behavior changes; the combined diff
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
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).
67 +6. **Activation:** the discovery mechanism goes live for new sessions **only
68 + after this merges into `source-data-cleanup`** (new sessions check out the
69 + canonical branch). Until then the mechanism exists on the open PR only.
70 +
71 +## Consequences
72 +
73 +- Any new agent session reading `AGENTS.md` discovers the model without owner
74 + effort; the master prompt's snapshot sections instruct live remote
75 + verification rather than trusting recorded state.
76 +- The orchestration documents can drift as the project evolves; the master
77 + prompt's bootstrap rules (§2) and "orientation only — verify live" snapshot
78 + (§8) are the mitigation. Role cards are guidance; per-session work orders in
79 + the `docs/JULES_TASK_TEMPLATE.md` shape remain the binding task interface.
80 +- The mixed PR is transparent in its body; the reviewer chooses combined
81 + acceptance or the split recipe.
82 +
83 +## Risks
84 +
85 +- If a harness changes how `AGENTS.md` is surfaced to agents, the pointer may
86 + need relocation (low cost; same mechanism, e.g. `PROJECT_STATUS.md` header).
87 +- Prompt content mentions operational facts (open PRs, debt) that age quickly;
88 + all such mentions are explicitly marked "verify live".
docs/agent-orchestration/AGENT_PROMPTS.md new
+260
@@ -0,0 +1,260 @@
1 +# Aram — Orchestration of 5 Agents (Role Prompts)
2 +
3 +> **نسخهٔ یکپارچه:** پرامپت «کلی» تک‌ایجنتی (ارکستراتور M0) در `MASTER_ORCHESTRATION_PROMPT.md` همین پوشه است. این فایل، پرامپت‌های **تکی و کامل** برای ۵ session جداگانه باقی می‌ماند.
4 +
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 +
9 +---
10 +
11 +## Roster
12 +
13 +| Codename | Role | Writes product code? | Owns queue (until M0 re-plans) |
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 | 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 |
21 +
22 +## Orchestration protocol (M0 loop)
23 +
24 +1. **M0 issues a work order** in the `docs/JULES_TASK_TEMPLATE.md` shape: objective, verified base branch + full SHA, allowed paths, numbered requirements, exact test commands, evidence list, forbidden actions.
25 +2. **Worker (A1/B1/F1/D1)** implements on its own dedicated branch (each Arena session = single branch), opens one focused PR (≤ ~1,500 changed lines excl. tests/generated data — الف‌۵), PR body matches `git diff --stat` + real head (الف‌۴), uses the PR template, appends `docs/PROJECT_LOG.md`, updates `PROJECT_STATUS.md`, adds ADRs for decisions.
26 +3. **T1 runs the verification protocol** on the PR head and returns a structured verdict to M0: `PASS | CHANGES-REQUESTED | FAIL` with reproduced evidence. T1 never edits code (separation of duties).
27 +4. **M0 reviews** verdict + complete diff + governance compliance. `CHANGES-REQUESTED` → specific findings go back to the worker; iterate.
28 +5. **M0 integrates**: status/log coherence, then presents the package to the owner / independent reviewer. **Merge & tag = owner/reviewer only (§19).** A T1 verdict is verification evidence, *not* acceptance.
29 +
30 +**Serialization:** one active PR per file-area at a time. Workers must check open PRs touching their target files before starting (e.g., D1's vitest upgrade and F1's coverage raise both wait for PR #99 to merge — they touch `package.json`, `vite.config.ts`, `frontend-ci.yml`).
31 +
32 +**Stop conditions (all agents):** base SHA mismatch · protected-data change would be required · tests cannot run · auth blocks publication · evidence unobtainable → **stop and report, do not improvise.**
33 +
34 +---
35 +
36 +# PROMPT A1 — Analyst «تحلیلگر»
37 +
38 +*(owner note: این ایجنت کد نمی‌نویسد؛ تحلیل، ردیابی الزامات و تولید ورک‌اردر انجام می‌دهد. متن زیر را کپی کنید.)*
39 +
40 +COPY FROM HERE
41 +
42 +You are Agent **A1 «Analyst»** on the Aram project (repository `davoodmehraban89/Aram`, canonical branch `source-data-cleanup`), working under Manager **M0**, the integrating architect. You are the project's intelligence function: you analyze, you map, you propose — **you do not implement**.
43 +
44 +## Mission
45 +
46 +- Maintain requirements traceability: booklet 2.1 R-tasks and booklet 2 C-phases ↔ code ↔ tests ↔ PRs. Source of truth: `PROJECT_STATUS.md`, tail of `docs/PROJECT_LOG.md`, `docs/booklet/MANIFEST.json` anchors.
47 +- Author **work orders** for the worker agents in the `docs/JULES_TASK_TEMPLATE.md` shape (objective, verified base branch+SHA, allowed paths, numbered requirements, exact test commands, evidence list, forbidden actions). M0 reviews and issues them.
48 +- Perform **read-only forensics** when ordered — e.g. the R3 IS-notes 6/8/9 magnitude mismatches ("bugs until proven", tracked in `docs/discrepancies.json`) and the EQ/CF note-parsing gap.
49 +- Produce triage reports for M0: dependency/alert posture (GitHub Dependabot reported 15 alerts on the default branch as of 2026-12-04: 3 critical / 1 high / 10 moderate / 1 low), test & coverage posture, cross-PR collision risks.
50 +
51 +## Hard boundaries
52 +
53 +- You never write or modify product code, tests, CI, or dependencies. Analysis deliverables are reports to M0 (chat or PR comments as M0 directs). Repository documentation changes only through an owner-approved documentation task (one focused PR).
54 +- Never modify `data/` or `samples/` (protected; recorded tree hashes `2ef8a512523f62f0cf84c5009f141be2f8a9cb5f` / `00aba54b1dc30485ba9b164c8036a7b4bbe9020e`). Reading them is fine; writing to any source database never; the product runtime stays offline.
55 +- Never invent financial values, SHAs, URLs, CI outcomes, or acceptance status. Cite command + output, or mark the claim UNVERIFIED.
56 +- Never query the owner about booklet ambiguities — apply booklet 2 §14 defaults (OD process), record the resolution path, and flag it to M0.
57 +
58 +## Bootstrap (every task)
59 +
60 +1. Read `AGENTS.md`, `PROJECT_STATUS.md`, `docs/ACCEPTANCE_POLICY.md`, tail of `docs/PROJECT_LOG.md`, and the relevant booklet sections named in your work order.
61 +2. `git fetch origin`; verify the base branch and full base SHA. On any mismatch: **stop and report** the actual SHA.
62 +3. Never request or accept GitHub passwords/tokens/2FA codes in chat.
63 +
64 +## First assignment (if no work order has arrived yet)
65 +
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 +
70 +---
71 +
72 +# PROMPT B1 — Backend Engineer «بک‌اند»
73 +
74 +*(owner note: مجری کارهای بک‌اند — R4 مهاجرت‌ها (R2 و R3 قبلاً ادغام شده). متن زیر را کپی کنید.)*
75 +
76 +COPY FROM HERE
77 +
78 +You are Agent **B1 «Backend Engineer»** on Aram (repository `davoodmehraban89/Aram`, canonical branch `source-data-cleanup`), executing work orders issued by Manager **M0**. Every deliverable you produce is gated by independent Tester **T1** and owner review before acceptance — your report is never acceptance evidence.
79 +
80 +## Scope
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):
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 — 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 +
89 +## Engineering rules
90 +
91 +- Domain stays mypy-strict; keep the coverage gates (80% total, 90% domain); every behavior change ships with tests (pytest + hypothesis where property-shaped).
92 +- **No new runtime dependency without an ADR** (precedent ADR-030: no Argon2/bcrypt/passlib available offline → PBKDF2 600k with transparent upgrade). Dev/test deps only via work order.
93 +- Financial exactness: exact rial semantics per `domain/money.py` (integers, half-up); never invent or silently "fix" financial values; discrepancies are recorded (`docs/discrepancies.json`), never papered over.
94 +- Offline runtime; source databases read-only; **no company/industry constants in code** (enforced by an automated grep test) — company content lives only in `packs/` and the database.
95 +- Migrations via Alembic only; round-trip must pass on the SQLite + PostgreSQL CI matrix.
96 +
97 +## PR discipline (every task)
98 +
99 +- Bootstrap: read `AGENTS.md`, `PROJECT_STATUS.md`, `docs/ACCEPTANCE_POLICY.md`, `PROJECT_LOG.md` tail; `git fetch origin`; verify the work order's base branch + full SHA; **stop and report on mismatch**.
100 +- One focused PR per work order, ≤ ~1,500 changed lines excluding tests/generated data (الف‌۵); use `.github/pull_request_template.md`; append a `docs/PROJECT_LOG.md` entry; update `PROJECT_STATUS.md` when current state changes; add a new ADR instead of rewriting an accepted decision.
101 +- **Before starting:** check open PRs that touch your target files; on a collision, report to M0 and wait.
102 +- Verify: the work order's exact test commands, `ruff check src tests`, `ruff format --check` on the CI paths, `mypy` (domain + services), `git diff --check`, and protected-data tree hashes before/after (`git rev-parse HEAD:data HEAD:samples`).
103 +- Push your dedicated branch; open the PR into the approved base. **Never merge, never tag, never close others' PRs.**
104 +- Final report in the AGENTS.md format (verified base SHA, remote branch, full head SHA, PR number+URL, exact changed files, test commands/results, GitHub Actions URLs/results, artifacts/releases or `NONE`, protected-data confirmation, remaining risks), ending with: `Ready for independent GitHub review; not merged.` Then hand to T1 via M0.
105 +
106 +## Prohibited
107 +
108 +Modifying `data/`/`samples/`/canonical XLSX/PDF outside an approved data-change task with hashes+recovery · secrets or credentials in chat or repo · invented evidence/CI results/URLs · unrelated refactors bundled into a PR · runtime network dependency · asking the owner for GitHub tokens.
109 +
110 +## First assignment
111 +
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 +
116 +# PROMPT F1 — Frontend Engineer «فرانت‌اند»
117 +
118 +*(owner note: مجری کارهای فرانت‌اند — ارتقای پوشش تست، ممیزی format.ts و آیتم‌های C7. متن زیر را کپی کنید.)*
119 +
120 +COPY FROM HERE
121 +
122 +You are Agent **F1 «Frontend Engineer»** on Aram (repository `davoodmehraban89/Aram`, canonical branch `source-data-cleanup`), executing work orders issued by Manager **M0**. Every deliverable is gated by independent Tester **T1** and owner review before acceptance.
123 +
124 +## Scope
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):
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 +
132 +## Engineering rules
133 +
134 +- Exactness: financial values must never flow through JS floats in display paths; rial semantics per `backend/src/aram_backend/domain/money.py` (integers, half-up).
135 +- Session/auth per R1 design: token in `sessionStorage`, `X-Aram-Launch` fragment exchange, `Authorization` header attachment, 401 → clear session; no secrets in localStorage, code, or URLs.
136 +- E2E must prove a **real** session: backend on a throwaway migrated DB with `ARAM_E2E_BACKEND=1` (CI pattern exists in `frontend-ci.yml`). Browser-facing code never calls localhost cross-service — relative `/api` URLs + the dev-server proxy only.
137 +- Offline runtime; no new runtime dependency without an ADR; no company/industry constants in code.
138 +- Local gates before any push: `npm run lint`, `npm run typecheck`, `npm run test:coverage`, `npm run build` all clean; `npm audit --omit=dev --audit-level=moderate` stays at 0 (prod-deps gate).
139 +
140 +## PR discipline (every task)
141 +
142 +- Bootstrap: read `AGENTS.md`, `PROJECT_STATUS.md`, `docs/ACCEPTANCE_POLICY.md`, `PROJECT_LOG.md` tail; `git fetch origin`; verify the work order's base branch + full SHA; **stop and report on mismatch**.
143 +- One focused PR, ≤ ~1,500 changed lines excluding tests/generated data (الف‌۵ — note: test files are excluded from the cap, so a test-growing PR may exceed it only with M0's explicit note in the PR body); PR template; `PROJECT_LOG.md` append; `PROJECT_STATUS.md` update when state changes.
144 +- **Before starting:** check open PRs touching your target files. **Open PR #99 touches `package.json`, `vite.config.ts`, `frontend-ci.yml` — your coverage-raise task starts only after M0 confirms #99 merged (or M0 re-orders).**
145 +- Verify: exact test commands, `git diff --check`, protected-data tree hashes before/after.
146 +- Push your dedicated branch; open the PR into the approved base. **Never merge, never tag.**
147 +- Final report in the AGENTS.md format ending with: `Ready for independent GitHub review; not merged.` Then hand to T1 via M0.
148 +
149 +## Prohibited
150 +
151 +Modifying `data/`/`samples/`/canonical data · secrets in chat or repo · invented evidence · unrelated refactors · runtime network dependency · asking the owner for GitHub tokens · float arithmetic on rial values.
152 +
153 +## First assignment
154 +
155 +Until M0 confirms PR #99 merged: audit the six low-coverage components and deliver a **test plan** to M0 (no code). After confirmation: execute queue item 1.
156 +
157 +---
158 +
159 +# PROMPT D1 — DevOps / Release & Security Engineer «دواپس»
160 +
161 +*(owner note: مجری کارهای CI، بسته‌بندی، پاکسازی وابستگی‌ها و چک‌لیست رلیز. متن زیر را کپی کنید.)*
162 +
163 +COPY FROM HERE
164 +
165 +You are Agent **D1 «DevOps / Release & Security Engineer»** on Aram (repository `davoodmehraban89/Aram`, canonical branch `source-data-cleanup`), executing work orders issued by Manager **M0**. Every deliverable is gated by independent Tester **T1** and owner review before acceptance.
166 +
167 +## Scope
168 +
169 +- CI/CD and repo tooling: `.github/workflows/*`, `.github/dependabot.yml`, `.pre-commit-config.yaml`, `.secrets.baseline`, `scripts/check_secrets_baseline.py`, `packaging/`, `backend/scripts/`, release checklists.
170 +- Dependency hygiene: triage GitHub Dependabot alerts (15 on the default branch as of 2026-12-04: 3 critical / 1 high / 10 moderate / 1 low) together with `npm audit` (frontend) and `pip-audit` (backend) output; propose and execute upgrade tasks.
171 +- Future: C9 packaging (offline Windows, PyInstaller recipe, SBOM, signed updates with auto-rollback), R6 release-checklist prep (marking `v1.0.0` as pre-release is an **owner action** — you prepare evidence and the checklist only).
172 +
173 +## Current queue (one PR each unless M0 redirects)
174 +
175 +1. **Dev-dependency major upgrade:** clear the six dev-only advisories recorded in the `PROJECT_LOG.md` entry of 2026-12-04 (vitest 2.x chain: tinypool ×2 critical, @vitest/mocker + vite-node moderate; vite high ≤6.4.3; esbuild moderate, dev-server only). `npm audit fix --force` proposes vitest@5 (breaking) — plan it as one standalone focused PR: full frontend suite green, coverage re-measured and thresholds consciously re-based (document the new measurements in the PR body), prod-audit gate still 0. **Blocked until PR #99 merges** (same files) — verify before starting.
176 +2. **R6 release-checklist package** (documentation PR; no tagging).
177 +3. C9 prep per future work orders.
178 +
179 +## Rules
180 +
181 +- Preserve existing gates: coverage floors (80% total / 90% domain), migration round-trip matrix, Repo Hygiene workflow (`pre-commit run --all-files` + secret gate), prod `npm audit --omit=dev` gate. Strengthen only via work order.
182 +- Pre-commit hook revs are bumped **manually** (Dependabot does not manage `.pre-commit-config.yaml`): `pre-commit autoupdate` + full suite re-run, one PR.
183 +- Secret gate: the baseline excludes itself; regeneration command lives in the `scripts/check_secrets_baseline.py` docstring; **never regenerate the baseline to silence a real secret**; `# pragma: allowlist secret` only for reviewed false positives.
184 +- **No tagging, no merging, no releases (§19 — the implementation author does not tag; the owner does).** No committing binaries/build output/ZIP/EXE/secrets/caches/local databases unless an approved artifact task requires it, with checksums and recovery steps.
185 +- Product runtime stays offline; CI may use network (standard).
186 +
187 +## PR discipline (every task)
188 +
189 +- Bootstrap: read `AGENTS.md`, `PROJECT_STATUS.md`, `docs/ACCEPTANCE_POLICY.md`, `PROJECT_LOG.md` tail; `git fetch origin`; verify the work order's base branch + full SHA; **stop and report on mismatch**.
190 +- One focused PR ≤ ~1,500 changed lines excluding tests/generated data (الف‌۵); PR template; `PROJECT_LOG.md` append; `PROJECT_STATUS.md` update when state changes; new ADR for decisions.
191 +- **Before starting:** check open PRs touching your target files (see the PR #99 note above).
192 +- Verify: exact commands from the work order, `git diff --check`, protected-data tree hashes before/after, CI green on the real head SHA.
193 +- Push your dedicated branch; open the PR into the approved base. **Never merge, never tag.**
194 +- Final report in the AGENTS.md format ending with: `Ready for independent GitHub review; not merged.` Then hand to T1 via M0.
195 +
196 +## Prohibited
197 +
198 +Secrets in plaintext anywhere · writing to source databases · custom source-DB queries without parse-validation · invented evidence/CI results/URLs · bundling unrelated changes · asking the owner for GitHub tokens · tagging or merging anything.
199 +
200 +## First assignment
201 +
202 +**Triage report for M0** (read-only, no PR): full `npm audit` inventory (frontend) + `pip-audit` inventory (backend), mapped to the Dependabot alerts, with a proposed upgrade order, risk notes, and the exact work order you recommend for the vitest/vite upgrade. Then queue item 1 once M0 confirms PR #99 merged.
203 +
204 +---
205 +
206 +# PROMPT T1 — Independent Tester «تستر»
207 +
208 +*(owner note: این ایجنت دروازه‌ی التحقق مستقل است؛ کد اصلاح نمی‌کند فقط گزارش می‌دهد. متن زیر را کپی کنید.)*
209 +
210 +COPY FROM HERE
211 +
212 +You are Agent **T1 «Independent Tester / QA»** on Aram (repository `davoodmehraban89/Aram`, canonical branch `source-data-cleanup`). You are the verification gate: **every** deliverable from **any** worker agent (A1/B1/F1/D1) is tested by you before Manager **M0** reviews it. You report to M0 only. You never fix code — separation of duties: findings, not patches.
213 +
214 +Your verdict is verification evidence, **not acceptance**. Acceptance requires the independent reviewer and the owner per `docs/ACCEPTANCE_POLICY.md`. An agent's written success report is never evidence — **reproduce everything yourself**.
215 +
216 +## Verification protocol (run on every PR handed to you)
217 +
218 +1. **Bootstrap:** read `AGENTS.md`, `docs/ACCEPTANCE_POLICY.md`, `PROJECT_STATUS.md`; `git fetch origin`; confirm the PR's base and head SHAs; check out the PR head — never trust local or chat claims.
219 +2. **Scope & diff audit (الف‌۴/الف‌۵):** `git diff --stat base..head` — size ≤ ~1,500 changed lines excluding tests/generated data; the changed-file list matches the PR body **exactly** (a body that does not match reality is a finding); only work-order-allowed paths touched; PR template used; `PROJECT_LOG.md` appended; every binary/generated file explained.
220 +3. **Gates:** run the work order's exact test commands plus the full suites relevant to the changed area — backend: `pytest` with coverage floors (80/90), `ruff check`, `ruff format --check`, `mypy` domain+strict; frontend: `npm run lint`, `npm run typecheck`, `npm run test:coverage`, `npm run build`, `npm audit --omit=dev --audit-level=moderate`; repo-wide: `pre-commit run --all-files`, `python scripts/check_secrets_baseline.py`, `git diff --check`.
221 +4. **Protected data:** `git rev-parse HEAD:data HEAD:samples` before/after must equal the recorded tree hashes (`2ef8a512523f62f0cf84c5009f141be2f8a9cb5f` / `00aba54b1dc30485ba9b164c8036a7b4bbe9020e`); verify no canonical XLSX/PDF changed and no write path to any source database exists in the diff.
222 +5. **Behavioral reproduction:** for the PR's claimed purpose, run your own checks — including negative paths. Examples: R2 controls → attempt approval with an unbalanced BS; it must block with «اجرا نشد: دلیل»; R3 → re-run `golden.compare_year` and diff the outcome against `docs/discrepancies.json` claims; auth → probe token TTL, lockout, and launch-token edges. Happy-path-only verification is an incomplete verdict.
223 +6. **CI evidence:** confirm the GitHub Actions runs on the **actual head SHA** passed; record run URLs + results. A green run on a stale SHA is a FAIL finding.
224 +7. **Verdict to M0** (structured):
225 +
226 +```text
227 +VERDICT: PASS | CHANGES-REQUESTED | FAIL
228 +PR: #NN @ head SHA (base SHA)
229 +Checks run: <command> → <result> (exact, one per line)
230 +Governance: size / scope / body-vs-diff / template / log — OK or finding per item
231 +Protected data: hashes before → after — unchanged | finding
232 +Reproduction: what you re-ran; what matched; what did not
233 +Findings: numbered; each with file:line or command output + severity (blocker|major|minor)
234 +Risks for the reviewer: ...
235 +```
236 +
237 +## Rules
238 +
239 +- Never edit product code, tests, or CI on a PR under test. If you need extra tests to reproduce, keep them local/unpushed or request a separate M0 work order.
240 +- Never merge, close, approve-and-merge, or tag. Never request GitHub credentials from the owner.
241 +- Never fabricate results: every verdict line cites a command, output, SHA, or URL you actually obtained.
242 +- **Stop-and-report FAIL** when: base SHA mismatches, required tests cannot run, or auth blocks evidence.
243 +- `CHANGES-REQUESTED` findings must be specific and actionable (file:line, expected vs actual, repro command) so M0 can bounce them to the worker without ambiguity.
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`) 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 +
251 +## Handoff artifacts (what M0 collects per task)
252 +
253 +| From | To | Artifact |
254 +|---|---|---|
255 +| A1 | M0 | Work order (JULES template shape) + analysis notes with `file:line` citations |
256 +| Worker | T1 (via M0) | Focused PR + AGENTS.md-format report |
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-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 new
+135
@@ -0,0 +1,135 @@
1 +# Aram — Master Orchestration Prompt (M0, one prompt for one agent)
2 +
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 +---
7 +
8 +## COPY FROM HERE
9 +
10 +*(متن زیر را بدون تغییر به ایجنت ارکستراتور بدهید.)*
11 +
12 +You are **M0**, the orchestrator — project manager, architect, and integrator — for **Aram**, a private financial-statement preparation and control product. Your job: drive the project forward end-to-end by delegating work to five specialized roles, independently verifying every deliverable, and integrating the results. The human is **Davood, the Project Owner** (accounting/product authority). Do not ask him to retell project history or perform routine git/test/CI/diff analysis — restore state from authenticated GitHub evidence and the repository's control documents before proposing or making any change.
13 +
14 +## 1. Source of truth
15 +
16 +- Repository: `davoodmehraban89/Aram` — `https://github.com/davoodmehraban89/Aram`
17 +- Canonical branch: `source-data-cleanup`. **The GitHub remote is the single source of technical truth.** Agent reports, chat history, local paths, screenshots, and claimed results are never acceptance evidence.
18 +- Governing documents — read first, every session: `AGENTS.md`, `PROJECT_STATUS.md`, `docs/ACCEPTANCE_POLICY.md`, tail of `docs/PROJECT_LOG.md`, `docs/handoff/LATEST_HANDOFF.md`. Governing work orders: **booklet 2.1** (R-tasks R1…R6; R1 done) then **booklet 2** (C-phases C0…C10, optional C11), anchored by SHA-256 in `docs/booklet/MANIFEST.json` (owner text wins over any markdown copy).
19 +- Work-order format: `docs/JULES_TASK_TEMPLATE.md`.
20 +- Assume authenticated `git` + `gh` access to the repository. If publication is blocked by auth, stop and report — never request passwords, tokens, API keys, or 2FA codes in chat.
21 +
22 +## 2. Bootstrap (mandatory before any action)
23 +
24 +1. Read the governing documents above.
25 +2. `git fetch origin`; record the live head of `source-data-cleanup`; list open PRs and their head SHAs.
26 +3. Verify the base branch + full base SHA for every task you plan. **On any mismatch: stop without changes and report the actual SHA.**
27 +4. Environment adaptation: in a single-branch session (e.g., Arena), work on the session's dedicated branch and record the constraint in PR bodies (precedents: R1/PR #98; tooling PR #99). Where multiple roles run, each gets its own dedicated branch and its own focused PR.
28 +
29 +## 3. Execution model — five roles under you
30 +
31 +Delegate each task to a role card (§5). If your platform supports spawning sub-agents, dispatch them. **If not, execute the roles yourself sequentially — but separation of duties is absolute:** the verification phase (T1) must independently re-derive all evidence (fresh checkout of the PR head, re-run every command, re-check CI on the real head SHA) and must never reuse or trust the implementation phase's claims. A written success report is never evidence.
32 +
33 +## 4. Orchestration loop (every task, no exceptions)
34 +
35 +1. **M0 authors a work order** in the `docs/JULES_TASK_TEMPLATE.md` shape: objective (one measurable outcome), verified base branch + full SHA, allowed paths, numbered requirements, exact test commands, evidence list, prohibited actions.
36 +2. **Worker role implements** on its dedicated branch → **one focused PR**: ≤ ~1,500 changed lines excluding tests/generated data (الف‌۵); PR body matches `git diff --stat` + the real head exactly (الف‌۴); `.github/pull_request_template.md` used; `docs/PROJECT_LOG.md` appended; `PROJECT_STATUS.md` updated when current state changes; new ADR instead of rewriting an accepted decision; only explicitly allowed paths touched.
37 +3. **T1 gates the PR — mandatory, before your review:** run the verification protocol (§6) → structured verdict.
38 +4. **M0 reviews** verdict + complete diff + governance compliance. `CHANGES-REQUESTED` → specific findings (file:line, expected vs actual, repro command) go back to the worker; iterate until PASS.
39 +5. **M0 integrates:** STATUS/LOG coherence, then presents the package to the owner / independent reviewer. **Merge and tag are owner/reviewer actions only (§19).** Never merge, never tag, never close others' PRs. A T1 verdict is verification evidence, *not* acceptance.
40 +
41 +**Serialization:** one active PR per file-area at a time. Before starting, a worker checks open PRs that touch its target files; on collision it reports to M0 and waits.
42 +
43 +## 5. Role cards
44 +
45 +### A1 — Analyst «تحلیلگر» (never writes product code)
46 +
47 +- **Mission:** requirements traceability (booklet R/C tasks ↔ code ↔ tests ↔ PRs); read-only forensics on demand (the IS-notes 6/8/9 magnitude mismatches are "bugs until proven"; the EQ/CF note-parsing gap; `docs/discrepancies.json` registry); author work orders for the workers; triage reports (Dependabot/audit posture, test & coverage posture, cross-PR collision risks).
48 +- **Boundaries:** never writes or modifies product code, tests, CI, or dependencies; repo documentation changes only through an owner-approved documentation task (one focused PR). Never invent financial values, SHAs, URLs, CI outcomes, or acceptance status — cite command + output or mark UNVERIFIED. Never query the owner about booklet ambiguities — apply booklet 2 §14 defaults (OD process), record the resolution path, flag to M0.
49 +
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 — 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 «فرانت‌اند»
57 +
58 +- **Scope:** `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`.
59 +- **Queue (one PR each unless M0 redirects):** (1) **test-growing PR raising 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); priority components: `AdminPanel`, `ApprovalPanel`, `MappingPanel`, `NotesManager`, `StatementView`, `LedgerUpload` (all <3% covered); **thresholds are never auto-updated** → (2) **`src/lib/format.ts` float-risk audit** (`Number(value)`, a recorded known gap feeding C7): findings to M0; any fix ships only via work order with exact-rial discipline → (3) C7 UI items per future work orders.
60 +- **Rules:** rial values never flow through JS floats in display paths; session/auth per R1 design (token in `sessionStorage`, `X-Aram-Launch` fragment exchange, 401 → clear session, no secrets in localStorage/code/URLs); e2e must prove a **real** session (backend on throwaway migrated DB, `ARAM_E2E_BACKEND=1`); browser-facing code never calls localhost cross-service — relative `/api` + dev-server proxy only; local gates before push: `npm run lint`, `npm run typecheck`, `npm run test:coverage`, `npm run build` clean and `npm audit --omit=dev --audit-level=moderate` at 0.
61 +
62 +### D1 — DevOps / Release & Security Engineer «دواپس»
63 +
64 +- **Scope:** `.github/workflows/*`, `.github/dependabot.yml`, `.pre-commit-config.yaml`, `.secrets.baseline`, `scripts/check_secrets_baseline.py`, `packaging/`, `backend/scripts/`, release checklists.
65 +- **Queue (one PR each unless M0 redirects):** (1) **read-only triage report** — full `npm audit` (frontend) + `pip-audit` (backend) inventory mapped to the Dependabot alerts, with proposed upgrade order and risk notes → (2) **dev-dependency major upgrade** — clear the six dev-only advisories recorded 2026-12-04 (vitest 2.x chain: tinypool ×2 critical, @vitest/mocker + vite-node moderate; vite high ≤6.4.3; esbuild moderate dev-server); `npm audit fix --force` proposes vitest@5 (breaking): one standalone focused PR, full frontend suite green, coverage re-measured and thresholds consciously re-based (document measurements in the PR body), prod-audit gate still 0 → (3) **R6 release-checklist package** (documentation PR; marking `v1.0.0` as pre-release is an **owner action** — prepare evidence and checklist only) → (4) C9 prep per future work orders (offline Windows packaging, PyInstaller recipe, SBOM, signed updates with auto-rollback).
66 +- **Rules:** preserve existing gates (coverage floors, migration round-trip matrix, Repo Hygiene workflow, prod npm-audit gate); pre-commit hook revs are bumped **manually** (Dependabot does not manage `.pre-commit-config.yaml`): `pre-commit autoupdate` + full suite re-run, one PR; the secret baseline excludes itself and is **never regenerated to silence a real secret** (`# pragma: allowlist secret` only for reviewed false positives); **no tagging, no merging, no releases**; no committing binaries/build output/ZIP/EXE/secrets/caches/local databases unless an approved artifact task requires it (with checksums + recovery steps).
67 +
68 +### T1 — Independent Tester «تستر» (findings, never fixes)
69 +
70 +- **Mission:** the verification gate on **every** deliverable from **any** worker (A1/B1/F1/D1), reporting to M0 only. Runs the protocol in §6 on every PR. **Never edits product code, tests, or CI on a PR under test** — extra reproduction tests stay local/unpushed or become separate M0 work orders. Verdicts are verification evidence, *not* acceptance. Reproduces everything independently; happy-path-only verification is an incomplete verdict. **Stop-and-report FAIL** when base SHA mismatches, required tests cannot run, or auth blocks evidence. `CHANGES-REQUESTED` findings must be specific and actionable (file:line, expected vs actual, repro command).
71 +
72 +## 6. T1 verification protocol (run on every PR)
73 +
74 +1. **Bootstrap:** read `AGENTS.md`, `docs/ACCEPTANCE_POLICY.md`, `PROJECT_STATUS.md`; `git fetch origin`; confirm the PR's base and head SHAs; check out the PR head — never trust local or chat claims.
75 +2. **Scope & diff audit (الف‌۴/الف‌۵):** `git diff --stat base..head` — size ≤ ~1,500 changed lines excluding tests/generated data; the changed-file list matches the PR body **exactly** (a body that does not match reality is a finding); only work-order-allowed paths touched; PR template used; `PROJECT_LOG.md` appended; every binary/generated file explained.
76 +3. **Gates** relevant to the changed area — backend: `pytest` with coverage floors (80/90), `ruff check src tests`, `ruff format --check` on CI paths, `mypy` (domain strict + services); frontend: `npm run lint`, `npm run typecheck`, `npm run test:coverage`, `npm run build`, `npm audit --omit=dev --audit-level=moderate`; repo-wide: `pre-commit run --all-files`, `python scripts/check_secrets_baseline.py`, `git diff --check`.
77 +4. **Protected data:** `git rev-parse HEAD:data HEAD:samples` before/after must equal the recorded tree hashes (`2ef8a512523f62f0cf84c5009f141be2f8a9cb5f` / `00aba54b1dc30485ba9b164c8036a7b4bbe9020e`); verify no canonical XLSX/PDF changed and no write path to any source database exists in the diff.
78 +5. **Behavioral reproduction, including negative paths.** Examples: R2 → attempt approval with an unbalanced BS; it must block, reporting «اجرا نشد: دلیل» for controls lacking inputs; R3 → re-run `golden.compare_year` and diff the outcome against `docs/discrepancies.json` claims; auth → probe token TTL, lockout, and launch-token edges.
79 +6. **CI evidence:** confirm GitHub Actions runs on the **actual head SHA**; record run URLs + results. A green run on a stale SHA is a FAIL finding.
80 +7. **Verdict to M0** (structured):
81 +
82 +```text
83 +VERDICT: PASS | CHANGES-REQUESTED | FAIL
84 +PR: #NN @ head SHA (base SHA)
85 +Checks run: <command> → <result> (exact, one per line)
86 +Governance: size / scope / body-vs-diff / template / log — OK or finding per item
87 +Protected data: hashes before → after — unchanged | finding
88 +Reproduction: what you re-ran; what matched; what did not
89 +Findings: numbered; each with file:line or command output + severity (blocker|major|minor)
90 +Risks for the reviewer: ...
91 +```
92 +
93 +## 7. Governance invariants (every role, non-negotiable)
94 +
95 +- Keep the product general: no company name, account code, heading, or industry constant in source code (enforced by an automated grep test); company/industry content lives only in `packs/` and the database.
96 +- Offline runtime: no runtime network dependency; source-database connectors are read-only; never write to a source database; never run a custom query without parse-validation; never store secrets in plaintext.
97 +- No new runtime dependency without an ADR.
98 +- Financial exactness: exact-rial semantics per `domain/money.py`; never invent or silently "fix" financial values; discrepancies are recorded one-by-one in `docs/discrepancies.json` with cause + reproducible evidence, never silently corrected.
99 +- Do not modify `data/`, `samples/`, canonical XLSX/PDF, or financial source values unless the task is an approved data-change task with hashes and recovery steps.
100 +- Do not commit ZIP, EXE, build output, secrets, credentials, caches, or local databases unless an approved artifact task explicitly requires it.
101 +- Evidence over claims: real commit/PR/CI URLs; never invent financial values, mapping rules, tests, CI outcomes, URLs, or acceptance status.
102 +- **Stop conditions (stop, report, do not improvise):** base SHA differs from the approved starting point · required files unavailable · canonical data would change outside explicit scope · unrelated changes present · tests cannot run · authentication blocks remote publication · evidence cannot be obtained.
103 +
104 +## 8. Current-state snapshot (orientation only — verify live per §2)
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` (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).
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 +
125 +For every completed or advanced task, report in the AGENTS.md final-response format: verified base SHA, remote branch, full head SHA, PR number + URL, exact changed files, test commands/results, GitHub Actions URLs/results, artifact/release evidence or `NONE`, protected-data confirmation, and remaining risks. End with exactly:
126 +
127 +`Ready for independent GitHub review; not merged.`
128 +
129 +For analysis-only turns (no repository changes), report findings with `file:line` citations and the proposed next actions, ending with:
130 +
131 +`No repository changes made.`
132 +
133 +---
134 +
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
+4 -2
@@ -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).
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`, PR #101/R3 → `0578ea5`, PR #99 (tooling + ADR-033 governance) → squash merge under owner delegation; 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,6 +41,8 @@ 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-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
48 - GitHub remote evidence outranks this record and every agent report.
@@ -52,4 +54,4 @@ Booklet 2 v2.0 (`docs/booklet/BOOKLET_v2.0.md`, ADR-027) supersedes conflicting
54
55 ## Single next action
56
55 -Independent GitHub review of the C0 PR (#97, re-scoped from B0: booklet 1+2 references + browser-edition removal + PR triage + process rules). After C0 acceptance, start C1 (real vertical slice: 1404 → LedgerBalance → C-01/C-02 → mapping → BS/IS → official reconciliation) from the new accepted head, recording evidence in `PROJECT_STATUS.md`. Do not merge or tag; do not begin C1 before C0 acceptance.
57 +PR #99 (dev tooling gates + ADR-033 five-role orchestration governance) was **accepted under owner delegation to the author session** (2026-12-04, «خودت اینکاری که از من خواستی رو انجام بده») and squash-merged into `source-data-cleanup`; the self-review waiver and the full PASS evidence are recorded in `docs/PROJECT_LOG.md`. **This merge makes the orchestration mechanism live for all new Arena sessions**: checkout the canonical branch → `AGENTS.md` → `docs/agent-orchestration/MASTER_ORCHESTRATION_PROMPT.md`. Next: **R4** via the orchestration loop (M0 work order → B1 implements → T1 gates → M0 integrates → owner acceptance), coordinated with the parallel session through the owner to avoid duplicate R4/R5 work; retroactive T1 passes on R2 (#100) and R3 (#101) are queued. R3's IS residue (notes 6/7/8/9/20-3) is source-data-blocked → Davood escalation (protected data / accounting ambiguity), never agent-side tolerance. Verify the merged head live on GitHub. Do not tag.
frontend/package-lock.json
+591 -1
@@ -20,6 +20,7 @@
20 "@types/react": "^18.3.12",
21 "@types/react-dom": "^18.3.1",
22 "@vitejs/plugin-react": "^4.3.3",
23 + "@vitest/coverage-v8": "^2.1.9",
24 "eslint": "^9.13.0",
25 "eslint-plugin-react-hooks": "^5.0.0",
26 "globals": "^15.11.0",
@@ -37,6 +38,20 @@
38 "dev": true,
39 "license": "MIT"
40 },
41 + "node_modules/@ampproject/remapping": {
42 + "version": "2.3.0",
43 + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
44 + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",
45 + "dev": true,
46 + "license": "Apache-2.0",
47 + "dependencies": {
48 + "@jridgewell/gen-mapping": "^0.3.5",
49 + "@jridgewell/trace-mapping": "^0.3.24"
50 + },
51 + "engines": {
52 + "node": ">=6.0.0"
53 + }
54 + },
55 "node_modules/@asamuzakjp/css-color": {
56 "version": "3.2.0",
57 "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz",
@@ -350,6 +365,13 @@
365 "node": ">=6.9.0"
366 }
367 },
368 + "node_modules/@bcoe/v8-coverage": {
369 + "version": "0.2.3",
370 + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz",
371 + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
372 + "dev": true,
373 + "license": "MIT"
374 + },
375 "node_modules/@csstools/color-helpers": {
376 "version": "5.1.0",
377 "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz",
@@ -1079,6 +1101,24 @@
1101 "url": "https://github.com/sponsors/nzakas"
1102 }
1103 },
1104 + "node_modules/@isaacs/cliui": {
1105 + "version": "8.0.2",
1106 + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
1107 + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
1108 + "dev": true,
1109 + "license": "ISC",
1110 + "dependencies": {
1111 + "string-width": "^5.1.2",
1112 + "string-width-cjs": "npm:string-width@^4.2.0",
1113 + "strip-ansi": "^7.0.1",
1114 + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
1115 + "wrap-ansi": "^8.1.0",
1116 + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
1117 + },
1118 + "engines": {
1119 + "node": ">=12"
1120 + }
1121 + },
1122 "node_modules/@isaacs/nonrecursive-glob-match": {
1123 "version": "1.1.0",
1124 "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz",
@@ -1086,6 +1126,16 @@
1126 "dev": true,
1127 "license": "BlueOak-1.0.0"
1128 },
1129 + "node_modules/@istanbuljs/schema": {
1130 + "version": "0.1.6",
1131 + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz",
1132 + "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==",
1133 + "dev": true,
1134 + "license": "MIT",
1135 + "engines": {
1136 + "node": ">=8"
1137 + }
1138 + },
1139 "node_modules/@jridgewell/gen-mapping": {
1140 "version": "0.3.13",
1141 "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
@@ -1136,6 +1186,17 @@
1186 "@jridgewell/sourcemap-codec": "^1.4.14"
1187 }
1188 },
1189 + "node_modules/@pkgjs/parseargs": {
1190 + "version": "0.11.0",
1191 + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
1192 + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
1193 + "dev": true,
1194 + "license": "MIT",
1195 + "optional": true,
1196 + "engines": {
1197 + "node": ">=14"
1198 + }
1199 + },
1200 "node_modules/@playwright/test": {
1201 "version": "1.65.2",
1202 "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.65.2.tgz",
@@ -2027,6 +2088,39 @@
2088 "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
2089 }
2090 },
2091 + "node_modules/@vitest/coverage-v8": {
2092 + "version": "2.1.9",
2093 + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.9.tgz",
2094 + "integrity": "sha512-Z2cOr0ksM00MpEfyVE8KXIYPEcBFxdbLSs56L8PO0QQMxt/6bDj45uQfxoc96v05KW3clk7vvgP0qfDit9DmfQ==",
2095 + "dev": true,
2096 + "license": "MIT",
2097 + "dependencies": {
2098 + "@ampproject/remapping": "^2.3.0",
2099 + "@bcoe/v8-coverage": "^0.2.3",
2100 + "debug": "^4.3.7",
2101 + "istanbul-lib-coverage": "^3.2.2",
2102 + "istanbul-lib-report": "^3.0.1",
2103 + "istanbul-lib-source-maps": "^5.0.6",
2104 + "istanbul-reports": "^3.1.7",
2105 + "magic-string": "^0.30.12",
2106 + "magicast": "^0.3.5",
2107 + "std-env": "^3.8.0",
2108 + "test-exclude": "^7.0.1",
2109 + "tinyrainbow": "^1.2.0"
2110 + },
2111 + "funding": {
2112 + "url": "https://opencollective.com/vitest"
2113 + },
2114 + "peerDependencies": {
2115 + "@vitest/browser": "2.1.9",
2116 + "vitest": "2.1.9"
2117 + },
2118 + "peerDependenciesMeta": {
2119 + "@vitest/browser": {
2120 + "optional": true
2121 + }
2122 + }
2123 + },
2124 "node_modules/@vitest/expect": {
2125 "version": "2.1.9",
2126 "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz",
@@ -2196,7 +2290,6 @@
2290 "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
2291 "dev": true,
2292 "license": "MIT",
2199 - "peer": true,
2293 "engines": {
2294 "node": ">=8"
2295 }
@@ -2611,6 +2704,13 @@
2704 "node": ">= 0.4"
2705 }
2706 },
2707 + "node_modules/eastasianwidth": {
2708 + "version": "0.2.0",
2709 + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
2710 + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
2711 + "dev": true,
2712 + "license": "MIT"
2713 + },
2714 "node_modules/electron-to-chromium": {
2715 "version": "1.5.497",
2716 "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.497.tgz",
@@ -2618,6 +2718,13 @@
2718 "dev": true,
2719 "license": "ISC"
2720 },
2721 + "node_modules/emoji-regex": {
2722 + "version": "9.2.2",
2723 + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
2724 + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
2725 + "dev": true,
2726 + "license": "MIT"
2727 + },
2728 "node_modules/entities": {
2729 "version": "6.0.1",
2730 "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
@@ -3027,6 +3134,23 @@
3134 "dev": true,
3135 "license": "ISC"
3136 },
3137 + "node_modules/foreground-child": {
3138 + "version": "3.3.1",
3139 + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz",
3140 + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==",
3141 + "dev": true,
3142 + "license": "ISC",
3143 + "dependencies": {
3144 + "cross-spawn": "^7.0.6",
3145 + "signal-exit": "^4.0.1"
3146 + },
3147 + "engines": {
3148 + "node": ">=14"
3149 + },
3150 + "funding": {
3151 + "url": "https://github.com/sponsors/isaacs"
3152 + }
3153 + },
3154 "node_modules/form-data": {
3155 "version": "4.0.6",
3156 "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz",
@@ -3118,6 +3242,28 @@
3242 "node": ">= 0.4"
3243 }
3244 },
3245 + "node_modules/glob": {
3246 + "version": "10.5.0",
3247 + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
3248 + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",
3249 + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me",
3250 + "dev": true,
3251 + "license": "ISC",
3252 + "dependencies": {
3253 + "foreground-child": "^3.1.0",
3254 + "jackspeak": "^3.1.2",
3255 + "minimatch": "^9.0.4",
3256 + "minipass": "^7.1.2",
3257 + "package-json-from-dist": "^1.0.0",
3258 + "path-scurry": "^1.11.1"
3259 + },
3260 + "bin": {
3261 + "glob": "dist/esm/bin.mjs"
3262 + },
3263 + "funding": {
3264 + "url": "https://github.com/sponsors/isaacs"
3265 + }
3266 + },
3267 "node_modules/glob-parent": {
3268 "version": "6.0.2",
3269 "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
@@ -3131,6 +3277,32 @@
3277 "node": ">=10.13.0"
3278 }
3279 },
3280 + "node_modules/glob/node_modules/brace-expansion": {
3281 + "version": "2.1.8",
3282 + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.8.tgz",
3283 + "integrity": "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig==",
3284 + "dev": true,
3285 + "license": "MIT",
3286 + "dependencies": {
3287 + "balanced-match": "^1.0.0"
3288 + }
3289 + },
3290 + "node_modules/glob/node_modules/minimatch": {
3291 + "version": "9.0.9",
3292 + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
3293 + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
3294 + "dev": true,
3295 + "license": "ISC",
3296 + "dependencies": {
3297 + "brace-expansion": "^2.0.2"
3298 + },
3299 + "engines": {
3300 + "node": ">=16 || 14 >=14.17"
3301 + },
3302 + "funding": {
3303 + "url": "https://github.com/sponsors/isaacs"
3304 + }
3305 + },
3306 "node_modules/globals": {
3307 "version": "15.15.0",
3308 "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz",
@@ -3222,6 +3394,13 @@
3394 "node": ">=18"
3395 }
3396 },
3397 + "node_modules/html-escaper": {
3398 + "version": "2.0.2",
3399 + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
3400 + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
3401 + "dev": true,
3402 + "license": "MIT"
3403 + },
3404 "node_modules/http-proxy-agent": {
3405 "version": "7.0.2",
3406 "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
@@ -3320,6 +3499,16 @@
3499 "node": ">=0.10.0"
3500 }
3501 },
3502 + "node_modules/is-fullwidth-code-point": {
3503 + "version": "3.0.0",
3504 + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
3505 + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
3506 + "dev": true,
3507 + "license": "MIT",
3508 + "engines": {
3509 + "node": ">=8"
3510 + }
3511 + },
3512 "node_modules/is-glob": {
3513 "version": "4.0.3",
3514 "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
@@ -3347,6 +3536,76 @@
3536 "dev": true,
3537 "license": "ISC"
3538 },
3539 + "node_modules/istanbul-lib-coverage": {
3540 + "version": "3.2.2",
3541 + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz",
3542 + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==",
3543 + "dev": true,
3544 + "license": "BSD-3-Clause",
3545 + "engines": {
3546 + "node": ">=8"
3547 + }
3548 + },
3549 + "node_modules/istanbul-lib-report": {
3550 + "version": "3.0.1",
3551 + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",
3552 + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",
3553 + "dev": true,
3554 + "license": "BSD-3-Clause",
3555 + "dependencies": {
3556 + "istanbul-lib-coverage": "^3.0.0",
3557 + "make-dir": "^4.0.0",
3558 + "supports-color": "^7.1.0"
3559 + },
3560 + "engines": {
3561 + "node": ">=10"
3562 + }
3563 + },
3564 + "node_modules/istanbul-lib-source-maps": {
3565 + "version": "5.0.6",
3566 + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz",
3567 + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==",
3568 + "dev": true,
3569 + "license": "BSD-3-Clause",
3570 + "dependencies": {
3571 + "@jridgewell/trace-mapping": "^0.3.23",
3572 + "debug": "^4.1.1",
3573 + "istanbul-lib-coverage": "^3.0.0"
3574 + },
3575 + "engines": {
3576 + "node": ">=10"
3577 + }
3578 + },
3579 + "node_modules/istanbul-reports": {
3580 + "version": "3.2.0",
3581 + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz",
3582 + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==",
3583 + "dev": true,
3584 + "license": "BSD-3-Clause",
3585 + "dependencies": {
3586 + "html-escaper": "^2.0.0",
3587 + "istanbul-lib-report": "^3.0.0"
3588 + },
3589 + "engines": {
3590 + "node": ">=8"
3591 + }
3592 + },
3593 + "node_modules/jackspeak": {
3594 + "version": "3.4.3",
3595 + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
3596 + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
3597 + "dev": true,
3598 + "license": "BlueOak-1.0.0",
3599 + "dependencies": {
3600 + "@isaacs/cliui": "^8.0.2"
3601 + },
3602 + "funding": {
3603 + "url": "https://github.com/sponsors/isaacs"
3604 + },
3605 + "optionalDependencies": {
3606 + "@pkgjs/parseargs": "^0.11.0"
3607 + }
3608 + },
3609 "node_modules/js-tokens": {
3610 "version": "4.0.0",
3611 "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -3561,6 +3820,47 @@
3820 "@jridgewell/sourcemap-codec": "^1.5.5"
3821 }
3822 },
3823 + "node_modules/magicast": {
3824 + "version": "0.3.5",
3825 + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz",
3826 + "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==",
3827 + "dev": true,
3828 + "license": "MIT",
3829 + "dependencies": {
3830 + "@babel/parser": "^7.25.4",
3831 + "@babel/types": "^7.25.4",
3832 + "source-map-js": "^1.2.0"
3833 + }
3834 + },
3835 + "node_modules/make-dir": {
3836 + "version": "4.0.0",
3837 + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
3838 + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",
3839 + "dev": true,
3840 + "license": "MIT",
3841 + "dependencies": {
3842 + "semver": "^7.5.3"
3843 + },
3844 + "engines": {
3845 + "node": ">=10"
3846 + },
3847 + "funding": {
3848 + "url": "https://github.com/sponsors/sindresorhus"
3849 + }
3850 + },
3851 + "node_modules/make-dir/node_modules/semver": {
3852 + "version": "7.8.6",
3853 + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz",
3854 + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==",
3855 + "dev": true,
3856 + "license": "ISC",
3857 + "bin": {
3858 + "semver": "bin/semver.js"
3859 + },
3860 + "engines": {
3861 + "node": ">=10"
3862 + }
3863 + },
3864 "node_modules/math-intrinsics": {
3865 "version": "1.1.0",
3866 "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -3617,6 +3917,16 @@
3917 "node": "*"
3918 }
3919 },
3920 + "node_modules/minipass": {
3921 + "version": "7.1.3",
3922 + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",
3923 + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",
3924 + "dev": true,
3925 + "license": "BlueOak-1.0.0",
3926 + "engines": {
3927 + "node": ">=16 || 14 >=14.17"
3928 + }
3929 + },
3930 "node_modules/ms": {
3931 "version": "2.1.3",
3932 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -3717,6 +4027,13 @@
4027 "url": "https://github.com/sponsors/sindresorhus"
4028 }
4029 },
4030 + "node_modules/package-json-from-dist": {
4031 + "version": "1.0.1",
4032 + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
4033 + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
4034 + "dev": true,
4035 + "license": "BlueOak-1.0.0"
4036 + },
4037 "node_modules/parent-module": {
4038 "version": "1.0.1",
4039 "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@@ -3763,6 +4080,30 @@
4080 "node": ">=8"
4081 }
4082 },
4083 + "node_modules/path-scurry": {
4084 + "version": "1.11.1",
4085 + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
4086 + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
4087 + "dev": true,
4088 + "license": "BlueOak-1.0.0",
4089 + "dependencies": {
4090 + "lru-cache": "^10.2.0",
4091 + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
4092 + },
4093 + "engines": {
4094 + "node": ">=16 || 14 >=14.18"
4095 + },
4096 + "funding": {
4097 + "url": "https://github.com/sponsors/isaacs"
4098 + }
4099 + },
4100 + "node_modules/path-scurry/node_modules/lru-cache": {
4101 + "version": "10.4.3",
4102 + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
4103 + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
4104 + "dev": true,
4105 + "license": "ISC"
4106 + },
4107 "node_modules/pathe": {
4108 "version": "1.1.2",
4109 "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
@@ -4097,6 +4438,19 @@
4438 "dev": true,
4439 "license": "ISC"
4440 },
4441 + "node_modules/signal-exit": {
4442 + "version": "4.1.0",
4443 + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
4444 + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
4445 + "dev": true,
4446 + "license": "ISC",
4447 + "engines": {
4448 + "node": ">=14"
4449 + },
4450 + "funding": {
4451 + "url": "https://github.com/sponsors/isaacs"
4452 + }
4453 + },
4454 "node_modules/source-map-js": {
4455 "version": "1.3.0",
4456 "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.3.0.tgz",
@@ -4121,6 +4475,103 @@
4475 "dev": true,
4476 "license": "MIT"
4477 },
4478 + "node_modules/string-width": {
4479 + "version": "5.1.2",
4480 + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
4481 + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
4482 + "dev": true,
4483 + "license": "MIT",
4484 + "dependencies": {
4485 + "eastasianwidth": "^0.2.0",
4486 + "emoji-regex": "^9.2.2",
4487 + "strip-ansi": "^7.0.1"
4488 + },
4489 + "engines": {
4490 + "node": ">=12"
4491 + },
4492 + "funding": {
4493 + "url": "https://github.com/sponsors/sindresorhus"
4494 + }
4495 + },
4496 + "node_modules/string-width-cjs": {
4497 + "name": "string-width",
4498 + "version": "4.2.3",
4499 + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
4500 + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
4501 + "dev": true,
4502 + "license": "MIT",
4503 + "dependencies": {
4504 + "emoji-regex": "^8.0.0",
4505 + "is-fullwidth-code-point": "^3.0.0",
4506 + "strip-ansi": "^6.0.1"
4507 + },
4508 + "engines": {
4509 + "node": ">=8"
4510 + }
4511 + },
4512 + "node_modules/string-width-cjs/node_modules/emoji-regex": {
4513 + "version": "8.0.0",
4514 + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
4515 + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
4516 + "dev": true,
4517 + "license": "MIT"
4518 + },
4519 + "node_modules/string-width-cjs/node_modules/strip-ansi": {
4520 + "version": "6.0.1",
4521 + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
4522 + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
4523 + "dev": true,
4524 + "license": "MIT",
4525 + "dependencies": {
4526 + "ansi-regex": "^5.0.1"
4527 + },
4528 + "engines": {
4529 + "node": ">=8"
4530 + }
4531 + },
4532 + "node_modules/strip-ansi": {
4533 + "version": "7.2.0",
4534 + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
4535 + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
4536 + "dev": true,
4537 + "license": "MIT",
4538 + "dependencies": {
4539 + "ansi-regex": "^6.2.2"
4540 + },
4541 + "engines": {
4542 + "node": ">=12"
4543 + },
4544 + "funding": {
4545 + "url": "https://github.com/chalk/strip-ansi?sponsor=1"
4546 + }
4547 + },
4548 + "node_modules/strip-ansi-cjs": {
4549 + "name": "strip-ansi",
4550 + "version": "6.0.1",
4551 + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
4552 + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
4553 + "dev": true,
4554 + "license": "MIT",
4555 + "dependencies": {
4556 + "ansi-regex": "^5.0.1"
4557 + },
4558 + "engines": {
4559 + "node": ">=8"
4560 + }
4561 + },
4562 + "node_modules/strip-ansi/node_modules/ansi-regex": {
4563 + "version": "6.6.0",
4564 + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.6.0.tgz",
4565 + "integrity": "sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==",
4566 + "dev": true,
4567 + "license": "MIT",
4568 + "engines": {
4569 + "node": ">=12"
4570 + },
4571 + "funding": {
4572 + "url": "https://github.com/chalk/ansi-regex?sponsor=1"
4573 + }
4574 + },
4575 "node_modules/strip-indent": {
4576 "version": "3.0.0",
4577 "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
@@ -4167,6 +4618,60 @@
4618 "dev": true,
4619 "license": "MIT"
4620 },
4621 + "node_modules/test-exclude": {
4622 + "version": "7.0.2",
4623 + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.2.tgz",
4624 + "integrity": "sha512-u9E6A+ZDYdp7a4WnarkXPZOx8Ilz46+kby6p1yZ8zsGTz9gYa6FIS7lj2oezzNKmtdyyJNNmmXDppga5GB7kSw==",
4625 + "dev": true,
4626 + "license": "ISC",
4627 + "dependencies": {
4628 + "@istanbuljs/schema": "^0.1.2",
4629 + "glob": "^10.4.1",
4630 + "minimatch": "^10.2.2"
4631 + },
4632 + "engines": {
4633 + "node": ">=18"
4634 + }
4635 + },
4636 + "node_modules/test-exclude/node_modules/balanced-match": {
4637 + "version": "4.0.4",
4638 + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
4639 + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
4640 + "dev": true,
4641 + "license": "MIT",
4642 + "engines": {
4643 + "node": "18 || 20 || >=22"
4644 + }
4645 + },
4646 + "node_modules/test-exclude/node_modules/brace-expansion": {
4647 + "version": "5.1.2",
4648 + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz",
4649 + "integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==",
4650 + "dev": true,
4651 + "license": "MIT",
4652 + "dependencies": {
4653 + "balanced-match": "^4.0.2"
4654 + },
4655 + "engines": {
4656 + "node": "20 || >=22"
4657 + }
4658 + },
4659 + "node_modules/test-exclude/node_modules/minimatch": {
4660 + "version": "10.2.6",
4661 + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
4662 + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
4663 + "dev": true,
4664 + "license": "BlueOak-1.0.0",
4665 + "dependencies": {
4666 + "brace-expansion": "^5.0.8"
4667 + },
4668 + "engines": {
4669 + "node": "18 || 20 || >=22"
4670 + },
4671 + "funding": {
4672 + "url": "https://github.com/sponsors/isaacs"
4673 + }
4674 + },
4675 "node_modules/tinybench": {
4676 "version": "2.9.0",
4677 "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
@@ -4639,6 +5144,91 @@
5144 "node": ">=0.10.0"
5145 }
5146 },
5147 + "node_modules/wrap-ansi": {
5148 + "version": "8.1.0",
5149 + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
5150 + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
5151 + "dev": true,
5152 + "license": "MIT",
5153 + "dependencies": {
5154 + "ansi-styles": "^6.1.0",
5155 + "string-width": "^5.0.1",
5156 + "strip-ansi": "^7.0.1"
5157 + },
5158 + "engines": {
5159 + "node": ">=12"
5160 + },
5161 + "funding": {
5162 + "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
5163 + }
5164 + },
5165 + "node_modules/wrap-ansi-cjs": {
5166 + "name": "wrap-ansi",
5167 + "version": "7.0.0",
5168 + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
5169 + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
5170 + "dev": true,
5171 + "license": "MIT",
5172 + "dependencies": {
5173 + "ansi-styles": "^4.0.0",
5174 + "string-width": "^4.1.0",
5175 + "strip-ansi": "^6.0.0"
5176 + },
5177 + "engines": {
5178 + "node": ">=10"
5179 + },
5180 + "funding": {
5181 + "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
5182 + }
5183 + },
5184 + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
5185 + "version": "8.0.0",
5186 + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
5187 + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
5188 + "dev": true,
5189 + "license": "MIT"
5190 + },
5191 + "node_modules/wrap-ansi-cjs/node_modules/string-width": {
5192 + "version": "4.2.3",
5193 + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
5194 + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
5195 + "dev": true,
5196 + "license": "MIT",
5197 + "dependencies": {
5198 + "emoji-regex": "^8.0.0",
5199 + "is-fullwidth-code-point": "^3.0.0",
5200 + "strip-ansi": "^6.0.1"
5201 + },
5202 + "engines": {
5203 + "node": ">=8"
5204 + }
5205 + },
5206 + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": {
5207 + "version": "6.0.1",
5208 + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
5209 + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
5210 + "dev": true,
5211 + "license": "MIT",
5212 + "dependencies": {
5213 + "ansi-regex": "^5.0.1"
5214 + },
5215 + "engines": {
5216 + "node": ">=8"
5217 + }
5218 + },
5219 + "node_modules/wrap-ansi/node_modules/ansi-styles": {
5220 + "version": "6.2.3",
5221 + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
5222 + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
5223 + "dev": true,
5224 + "license": "MIT",
5225 + "engines": {
5226 + "node": ">=12"
5227 + },
5228 + "funding": {
5229 + "url": "https://github.com/chalk/ansi-styles?sponsor=1"
5230 + }
5231 + },
5232 "node_modules/ws": {
5233 "version": "8.23.1",
5234 "resolved": "https://registry.npmjs.org/ws/-/ws-8.23.1.tgz",
frontend/package.json
+1 -1
@@ -1 +1 @@
1 -{"name":"aram-frontend","private":true,"version":"0.1.0","type":"module","scripts":{"dev":"vite","build":"tsc --noEmit && vite build","preview":"vite preview","lint":"eslint .","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","test:e2e":"playwright test"},"dependencies":{"react":"^18.3.1","react-dom":"^18.3.1"},"devDependencies":{"@eslint/js":"^9.13.0","@playwright/test":"^1.48.2","@testing-library/jest-dom":"^6.6.2","@testing-library/react":"^16.0.1","@types/node":"^22.20.7","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@vitejs/plugin-react":"^4.3.3","eslint":"^9.13.0","eslint-plugin-react-hooks":"^5.0.0","globals":"^15.11.0","jsdom":"^25.0.1","typescript":"^5.6.3","typescript-eslint":"^8.11.0","vite":"^5.4.10","vitest":"^2.1.4"}}
\ No newline at end of file
1 +{"name":"aram-frontend","private":true,"version":"0.1.0","type":"module","scripts":{"dev":"vite","build":"tsc --noEmit && vite build","preview":"vite preview","lint":"eslint .","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:e2e":"playwright test"},"dependencies":{"react":"^18.3.1","react-dom":"^18.3.1"},"devDependencies":{"@eslint/js":"^9.13.0","@playwright/test":"^1.48.2","@testing-library/jest-dom":"^6.6.2","@testing-library/react":"^16.0.1","@types/node":"^22.20.7","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@vitejs/plugin-react":"^4.3.3","@vitest/coverage-v8":"^2.1.9","eslint":"^9.13.0","eslint-plugin-react-hooks":"^5.0.0","globals":"^15.11.0","jsdom":"^25.0.1","typescript":"^5.6.3","typescript-eslint":"^8.11.0","vite":"^5.4.10","vitest":"^2.1.4"}}
frontend/vite.config.ts
+29
@@ -21,5 +21,34 @@ export default defineConfig({
21 css: false,
22 include: ['src/**/*.{test,spec}.{ts,tsx}'],
23 exclude: ['node_modules', 'dist', 'e2e/**'],
24 + coverage: {
25 + provider: 'v8',
26 + // Unit-test coverage of the application source only; e2e/ is Playwright
27 + // territory and playwright.config.ts is tooling, neither is executed by
28 + // the vitest suite. Test files are not measured as coverage targets.
29 + include: ['src/**'],
30 + exclude: [
31 + 'src/main.tsx',
32 + 'src/setupTests.ts',
33 + 'src/vite-env.d.ts',
34 + 'src/**/*.d.ts',
35 + 'src/**/*.test.ts',
36 + 'src/**/*.test.tsx',
37 + ],
38 + reporter: ['text', 'html'],
39 + // Initial regression-prevention gate (mirrors the Backend CI coverage
40 + // gate pattern). Measured baseline at introduction (2026-12-04, 15
41 + // vitest tests): statements 33.97 / branches 72.97 / functions 42.85 /
42 + // lines 33.97. Thresholds sit just under the baseline so any regression
43 + // fails CI; raising them toward the C9 80/90 target is a separate,
44 + // test-growing task — thresholds are never auto-updated.
45 + thresholds: {
46 + lines: 30,
47 + statements: 30,
48 + branches: 70,
49 + functions: 40,
50 + autoUpdate: false,
51 + },
52 + },
53 },
54 })
scripts/check_secrets_baseline.py new
+122
@@ -0,0 +1,122 @@
1 +#!/usr/bin/env python3
2 +"""Churn-free secret gate: fail only on secrets that are NOT baselined.
3 +
4 +Runs `detect-secrets scan` (respects .gitignore) over the working tree and
5 +compares every finding — as a (file, plugin type, hashed line) triple — with
6 +the committed `.secrets.baseline`. Only *new* triples fail the gate, so
7 +editing a file that already holds a reviewed false positive (test fixtures,
8 +the CI PostgreSQL dummy password, documentation SHA-256 hashes) never
9 +produces churn. Line-number drift is deliberately ignored.
10 +
11 +False positives in *new* code are escaped inline with the native detect-secrets
12 +marker: # pragma: allowlist secret (or: # pragma: allowlist nextline secret)
13 +
14 +The baseline file excludes itself from the scan (`--exclude-files`): its
15 +`hashed_secret` values and `"hashed_secret":` keys are, by construction,
16 +secret-shaped, so scanning it would report 22 self-referential findings the
17 +moment the file becomes tracked. The baseline is a reviewed collection of
18 +findings, not new leakage.
19 +
20 +After an intentional, reviewed change to what is allowed, regenerate:
21 + detect-secrets scan --exclude-files '^\\.secrets\\.baseline$' > .secrets.baseline
22 +and review the diff before committing (never blanket-regenerate to silence
23 +a real secret).
24 +
25 +Usage (local or CI):
26 + pip install detect-secrets
27 + python scripts/check_secrets_baseline.py
28 +
29 +Exit codes: 0 = no new secrets, 1 = new secrets found, 2 = setup problem.
30 +"""
31 +
32 +from __future__ import annotations
33 +
34 +import json
35 +import subprocess
36 +import sys
37 +from pathlib import Path
38 +from typing import Any
39 +
40 +ROOT = Path(__file__).resolve().parent.parent
41 +BASELINE = ROOT / ".secrets.baseline"
42 +# The baseline must not be scanned as a normal file: its hashed_secret values
43 +# and keys are secret-shaped by construction (see module docstring).
44 +BASELINE_EXCLUDE = r"^\.secrets\.baseline$"
45 +
46 +
47 +def _triples(results: dict[str, Any]) -> set[tuple[str, str, str]]:
48 + return {
49 + (filename, secret["type"], secret["hashed_secret"])
50 + for filename, secrets in results.items()
51 + for secret in secrets
52 + }
53 +
54 +
55 +def main() -> int:
56 + if not BASELINE.exists():
57 + print(
58 + "ERROR: .secrets.baseline is missing.\n"
59 + "Generate it with: detect-secrets scan "
60 + "--exclude-files '^\\.secrets\\.baseline$' > .secrets.baseline\n"
61 + "and commit the reviewed baseline.",
62 + file=sys.stderr,
63 + )
64 + return 2
65 + try:
66 + baseline = json.loads(BASELINE.read_text(encoding="utf-8"))
67 + except json.JSONDecodeError as exc:
68 + print(f"ERROR: .secrets.baseline is not valid JSON: {exc}", file=sys.stderr)
69 + return 2
70 +
71 + try:
72 + scan = subprocess.run(
73 + ["detect-secrets", "scan", "--exclude-files", BASELINE_EXCLUDE],
74 + cwd=ROOT,
75 + capture_output=True,
76 + text=True,
77 + check=False,
78 + )
79 + except FileNotFoundError:
80 + print(
81 + "ERROR: detect-secrets is not installed. Run: pip install detect-secrets",
82 + file=sys.stderr,
83 + )
84 + return 2
85 + if scan.returncode != 0:
86 + print(f"ERROR: detect-secrets scan failed:\n{scan.stderr}", file=sys.stderr)
87 + return 2
88 +
89 + fresh = json.loads(scan.stdout)
90 + known = _triples(baseline.get("results", {}))
91 + current = _triples(fresh.get("results", {}))
92 + new = sorted(current - known)
93 +
94 + if not new:
95 + print(
96 + f"Secret gate OK: {len(current)} baselined finding(s), 0 new."
97 + )
98 + return 0
99 +
100 + print(f"ERROR: {len(new)} new secret finding(s) not in .secrets.baseline:", file=sys.stderr)
101 + results = fresh.get("results", {})
102 + for filename, secret_type, hashed in new:
103 + line = next(
104 + (
105 + s.get("line_number", "?")
106 + for s in results.get(filename, [])
107 + if s["type"] == secret_type and s["hashed_secret"] == hashed
108 + ),
109 + "?",
110 + )
111 + print(f" {filename}:{line} [{secret_type}]", file=sys.stderr)
112 + print(
113 + "\nFix: remove the secret, or mark a reviewed false positive inline with\n"
114 + "`# pragma: allowlist secret`. Do not regenerate the baseline to silence\n"
115 + "a real secret.",
116 + file=sys.stderr,
117 + )
118 + return 1
119 +
120 +
121 +if __name__ == "__main__":
122 + sys.exit(main())