@davoodmehraban89 / Factor-easy / commits / 42331fe
Fork 0

سامانه صدور فاکتور و حسابداری

Docs: close D4a with verified evidence

* Docs: record verified D4a work queue evidence * State: close D4a with production evidence

davoodmehraban89 committed Oct 2, 2026 at 07:17 UTC 42331fe78fc7807386b7c1031956ed788b34ff81
2 files changed +31 -2
PROJECT_STATE.md
+2 -2
@@ -14,7 +14,7 @@ This is high-assurance accounting/ERP software. Posted financial history, tenant
14 ## Current change ledger
15 | Date | Request / decision | Status | Evidence / next action |
16 |---|---|---|---|
17 -| 2026-10-02 | Owner directed immediate continuation after observing execution delay. | **D4A IMPLEMENTED ON FEATURE BRANCH / VERIFICATION PENDING** | Authorized approver/delegate work queue RPC + actionable UI + revision/idempotency guarded decisions + disposable-DB and real-DOM coverage are on `feat/d4a-request-work-queue`. Do not mark complete until protected PR checks and production reconciliation pass. |\n| 2026-10-02 | Owner switched GitHub Pages source to **GitHub Actions** after the gated Pages workflow was installed. | **WAVE 0 COMPLETED / POSITIVE + NEGATIVE CONTROLS VERIFIED** | Negative control: failing SHA `03561a3369130a7aaba689474d92aa3e93137404` on PR #15 failed required `static-quality`, could not merge, and produced no Release gate / gated Pages deployment. Positive control: protected-main SHA `150ff54d938a45b9a9b476f3a4a8fdabbb45d065` passed Quality `36932956964`, Security `36932956877`, exact-SHA Release gate `36933115365`, then gated Pages deploy `36933151878`; no legacy dynamic branch Pages deployment appeared. F-402/F-403/F-406/F-407/F-423/F-424 are closed at the verified GitHub/repository boundary. |
17 +| 2026-10-02 | Owner directed immediate continuation after observing execution delay. | **D4A IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + ACCOUNTING + SECURITY VERIFIED** | PR #21 merged as `4583703396a7ddb00bdad76b52c22932d634cbef`. Main Quality `36961361891` SUCCESS (38/38 real-DOM, accounting phases 2–6 + Golden, D1/C8 DB); Security `36961361897` SUCCESS; Release gate `36961459328` SUCCESS; gated Pages `36961492170` SUCCESS. Production migration `20261002034311 request_workflow_d4a_work_queue` reconciled. Evidence: `docs/REQUEST_WORKFLOW_D4A_VERIFICATION.md`. |\n| 2026-10-02 | Owner switched GitHub Pages source to **GitHub Actions** after the gated Pages workflow was installed. | **WAVE 0 COMPLETED / POSITIVE + NEGATIVE CONTROLS VERIFIED** | Negative control: failing SHA `03561a3369130a7aaba689474d92aa3e93137404` on PR #15 failed required `static-quality`, could not merge, and produced no Release gate / gated Pages deployment. Positive control: protected-main SHA `150ff54d938a45b9a9b476f3a4a8fdabbb45d065` passed Quality `36932956964`, Security `36932956877`, exact-SHA Release gate `36933115365`, then gated Pages deploy `36933151878`; no legacy dynamic branch Pages deployment appeared. F-402/F-403/F-406/F-407/F-423/F-424 are closed at the verified GitHub/repository boundary. |
18 | 2026-10-02 | Wave 2 request integrity remediation F-411/F-413/F-414/F-417/F-418. | **IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + ACCOUNTING + SECURITY VERIFIED** | Squash merge `7346910638b6ef9555d4adb5952dd62c8f4c130d` from PR #19. PR Quality `36937247798`: DB jobs SUCCESS and 37/37 real-DOM tests passed; accounting phases + Golden journey passed. PR Security `36937247803`: required Release/QA invariants + CodeQL SUCCESS (Dependency review remains the documented external graph boundary). Main Quality `36937448157` SUCCESS; Security `36937448101` SUCCESS; exact-SHA Release gate `36937598497` SUCCESS; gated Pages `36937616201` SUCCESS. Production migration recorded as `20261001225044 request_wave2_integrity_hardening`; live validator negative controls and function-contract checks passed. |
19 | 2026-10-02 | Live Supabase target `hcsixhqbyuhpshfwqpjx` became available to the connector; owner directed immediate continuation. | **WAVE 1 PRODUCTION RECONCILED / WAVE 2 STARTED** | Production migration history and live `request_transition_instance` definitions were inspected read-only. F-409/F-410 guard is present in production; next slice is F-411/F-413/F-414/F-417/F-418 with server validation, form-runtime fidelity, idempotency binding, active/latest-version enforcement and schema-bound conditions. |
20 | 2026-10-02 | Owner completed the GitHub `Protect main` ruleset and directed autonomous continuation to fully remediate the audited defects. | **ACTIVE — REMEDIATION CONTINUATION** | Ruleset `24334764` verified ACTIVE on default branch with deletion + non-fast-forward protection, PR-only updates, strict required checks `static-quality`, `Release and QA safety invariants`, and `CodeQL JavaScript`; bypass list empty. Continue Wave 1/2 request integrity work. |
@@ -54,7 +54,7 @@ This is high-assurance accounting/ERP software. Posted financial history, tenant
54 Posted accounting history is immutable and balanced; tenant isolation is enforced at the data boundary; commercial entitlement and member authorization are independent; UI hiding is never security; expired licenses are read-only; office numbering is server-atomic; private scans remain private; seat/company limits are server-enforced; delegated customer admins cannot mutate commercial license entitlements; invitation acceptance is authenticated/email-bound/seat-safe; raw invitation tokens are never persisted or audited; organization-unit parents cannot cross tenants or form cycles. Request type/workflow versions are immutable snapshots; request instances pin both versions; runtime mutation is server-authorized, idempotency/revision guarded and append-only evidence is retained. D2 legacy import is non-destructive/idempotent/traceable. D3a votes require distinct actors for parallel quorum. D3b conditions are bounded server-validated predicates and skipped results remain evidence. D3c delegation never impersonates the source actor, source capability is revalidated, SLA escalation appends evidence, and approved cross-module effects are queued transactionally rather than directly executed. Request workflow state never replaces C1 registration or C5 correspondence approval evidence.
55
56 ## Required evidence
57 -`docs/PHASE_1_REDESIGN_VERIFICATION.md` through `docs/PHASE_6_VERIFICATION.md` · `docs/PHASE_6_CUTOVER_MANIFEST.md` · `docs/PRODUCTION_ACCOUNTING_CUTOVER_READINESS_2026-09-30.md` · `docs/IRAN_COMPLIANCE_MATRIX_V1.md` · `docs/FINORA_ERP_EXPANSION_ROADMAP_V4.md` · `docs/FINORA_UX_ACCOUNTING_BENCHMARK_V3.md` · `docs/FINORA_MODULAR_ERP_OFFICE_AUTOMATION_V1.md` · `docs/SLICE_B_TENANT_RBAC_VERIFICATION.md` · `docs/SECURITY_DEFINER_HARDENING_2026-09-30.md` · `docs/CURRENT_STAGE_GAP_REGISTER_2026-09-30.md` · `docs/ELI_1_ENTERPRISE_LICENSE_VERIFICATION.md` through `docs/ELI_4_ENTERPRISE_ORGANIZATION_UX_VERIFICATION.md` · `docs/OFFICE_SLICE_C1_VERIFICATION.md` through `docs/OFFICE_SLICE_C8_RUNTIME_UI_VERIFICATION.md` · `docs/REQUEST_WORKFLOW_D2_CUTOVER_VERIFICATION.md` · `docs/REQUEST_WORKFLOW_D3A_VERIFICATION.md` · `docs/REQUEST_WORKFLOW_D3B_VERIFICATION.md` · `docs/REQUEST_WORKFLOW_D3C_VERIFICATION.md` · `docs/PRODUCTION_RUNBOOK.md` · `supabase/migrations/` · `supabase/tests/request_d1_behavior.sql` · `supabase/tests/request_d2_legacy_behavior.sql` · `supabase/tests/request_d3a_workflow_behavior.sql` · `supabase/tests/request_d3b_condition_timeline.sql` · `supabase/tests/request_d3c_operations.sql`.
57 +`docs/PHASE_1_REDESIGN_VERIFICATION.md` through `docs/PHASE_6_VERIFICATION.md` · `docs/PHASE_6_CUTOVER_MANIFEST.md` · `docs/PRODUCTION_ACCOUNTING_CUTOVER_READINESS_2026-09-30.md` · `docs/IRAN_COMPLIANCE_MATRIX_V1.md` · `docs/FINORA_ERP_EXPANSION_ROADMAP_V4.md` · `docs/FINORA_UX_ACCOUNTING_BENCHMARK_V3.md` · `docs/FINORA_MODULAR_ERP_OFFICE_AUTOMATION_V1.md` · `docs/SLICE_B_TENANT_RBAC_VERIFICATION.md` · `docs/SECURITY_DEFINER_HARDENING_2026-09-30.md` · `docs/CURRENT_STAGE_GAP_REGISTER_2026-09-30.md` · `docs/ELI_1_ENTERPRISE_LICENSE_VERIFICATION.md` through `docs/ELI_4_ENTERPRISE_ORGANIZATION_UX_VERIFICATION.md` · `docs/OFFICE_SLICE_C1_VERIFICATION.md` through `docs/OFFICE_SLICE_C8_RUNTIME_UI_VERIFICATION.md` · `docs/REQUEST_WORKFLOW_D2_CUTOVER_VERIFICATION.md` · `docs/REQUEST_WORKFLOW_D3A_VERIFICATION.md` · `docs/REQUEST_WORKFLOW_D3B_VERIFICATION.md` · `docs/REQUEST_WORKFLOW_D3C_VERIFICATION.md` · `docs/REQUEST_WORKFLOW_D4A_VERIFICATION.md` · `docs/PRODUCTION_RUNBOOK.md` · `supabase/migrations/` · `supabase/tests/request_d1_behavior.sql` · `supabase/tests/request_d2_legacy_behavior.sql` · `supabase/tests/request_d3a_workflow_behavior.sql` · `supabase/tests/request_d3b_condition_timeline.sql` · `supabase/tests/request_d3c_operations.sql`.
58
59 ## NOT VERIFIED / external boundary
60 Automatic background scheduling for SLA scans; delivery/dispatch consumers for D3c outbox intents; authenticated two-real-user production browser E2E with a persistent legitimate non-owner member; automatic external invitation email delivery; owner-approved accounting cutover; real Persian OCR accuracy/provider; qualified digital signature; physical printer; live external adapters; GitHub Dependency graph/enforceable dependency review; leaked-password protection; PostgreSQL upgrade; CodeQL v4 migration; external BPM/provider integration remain outside verified scope.
docs/REQUEST_WORKFLOW_D4A_VERIFICATION.md new
+29
@@ -0,0 +1,29 @@
1 +# Request Workflow D4a Verification
2 +
3 +Date: 2026-10-02
4 +
5 +## Scope
6 +D4a adds an actionable request work queue for direct approvers and valid time-bounded delegates. It does not dispatch outbox effects and does not alter posted accounting history.
7 +
8 +## Implementation
9 +- UI: `js/request-workflow-d4a.js`, loaded after D3c.
10 +- Migration: `supabase/migrations/20261002033000_request_workflow_d4a_work_queue.sql`.
11 +- Disposable DB assertions: `supabase/tests/request_d4a_work_queue.sql`.
12 +- Static contract: `scripts/request-workflow-d4a-check.mjs`.
13 +- Real DOM: `scripts/request-workflow-d4a.spec.js`.
14 +- Menu task: `workqueue` under Requests → My work.
15 +
16 +## Security and behavior
17 +The queue is organization-scoped and entitlement-gated. An active step is returned only when the caller has its required capability or a currently valid delegation for that exact capability. Actors who already voted on the active step are excluded. Delegation provenance is projected to the UI. Decisions reuse the existing server-authorized `request_step_decide` path with expected revision and stable retry idempotency keys; D4a does not add a second mutation path.
18 +
19 +## Verification
20 +PR #21 head `328c7079ebdf7bb030fc8c058ffabcd4772ab93e` passed required Quality/Security checks. The disposable request database verified direct approver visibility, delegated visibility/provenance, post-decision removal and read-only unauthorized denial. Real-DOM smoke passed after correcting the production/test Supabase-client resolution and a strict locator ambiguity.
21 +
22 +Squash merge: `4583703396a7ddb00bdad76b52c22932d634cbef`.
23 +Main Quality run `36961361891`: SUCCESS. Static-quality job `110695556210` passed accounting phases 2–6, Golden accounting journey, D4a static invariants and 38/38 real-DOM tests. D1 request DB job `110695556278`: SUCCESS. C8 DB job `110695556042`: SUCCESS.
24 +Main Security run `36961361897`: SUCCESS. Exact-SHA Release gate `36961459328`: SUCCESS. Gated Pages `36961492170`: SUCCESS.
25 +
26 +Production Supabase `hcsixhqbyuhpshfwqpjx` recorded migration `20261002034311 request_workflow_d4a_work_queue`. Reconciliation confirmed the private implementation is SECURITY DEFINER with authenticated-only execution and contains both valid-delegation and prior-vote guards; the public wrapper is SECURITY INVOKER.
27 +
28 +## Preserved boundaries
29 +D4a is an inbox/decision slice only. D3c outbox delivery remains pending intent. External/destination consumers remain disabled until destination idempotency, retries/dead-letter handling and authorization are separately implemented and adversarially verified. Dependency review remains blocked by the repository Dependency graph boundary already documented in PROJECT_STATE.