سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 15:45 UTC
docs: close verified D3c request operations slice
davoodmehraban89 committed
Oct 1, 2026 at 23:27 UTC
b5d97ec48efcd4e8e88c5657fbdd3f9336709f9c
2 files changed
+77
-31
PROJECT_STATE.md
+30
-31
@@ -14,52 +14,51 @@ 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-01 | Owner said «ادامه بده» after verified D3a handoff. | **D3B VERIFIED; CONTINUE D3C** | D3b visual workflow editor, bounded condition DSL and read-only timeline are production + disposable-DB + real-DOM verified. Continue with D3c SLA/escalation evidence, delegation/substitution and transactional cross-module outbox actions. |
18
-| 2026-10-01 | Slice D3b — visual workflow editor + conditions + timeline. | **IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + CI VERIFIED** | `js/request-workflow-d3b.js`; migration `20261001233000`; bounded predicate DSL, skipped-step evidence and authorized timeline RPC. Quality run `36915696611`: all three jobs SUCCESS, including 33 Real DOM tests. Evidence: `docs/REQUEST_WORKFLOW_D3B_VERIFICATION.md`. |
19
-| 2026-10-01 | Slice D3a — sequential/parallel request workflow runtime. | **IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + CI VERIFIED** | Migrations `20261001230000`, `20261001230500`; private step/vote runtime, schema-v2 validation, quorum semantics, capability checks, idempotent decisions and immutable event evidence. Quality run `36913565943`: all three jobs SUCCESS. Evidence: `docs/REQUEST_WORKFLOW_D3A_VERIFICATION.md`. |
20
-| 2026-10-01 | Slice D2 — request UI/read-model + legacy cutover. | **IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + CI VERIFIED** | `js/request-workflow-d2.js`; migrations `20261001223500`, `20261001224500`; Quality run `36912668369` all three jobs SUCCESS. Legacy source records remain preserved and imported rows remain traceable. |
21
-| 2026-10-01 | Slice D1 — requests/BPMS-lite server foundation. | **IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + CI VERIFIED** | Migrations `20261001204500`, `20261001205500`, `20261001210500`, `20261001211500`; production RLS/RPC/security verified. Quality run `36910187257` all three jobs SUCCESS. |
22
-| 2026-10-01 | Office Slice C8: versioned correspondence workflow policy + runtime. | **IMPLEMENTED / PRODUCTION + ADVERSARIAL + CONCURRENCY + REAL-DOM + SECURITY VERIFIED** | Production migrations `20261001173917`, `20261001180610`, `20261001180949`; immutable workflow evidence, pinned policy versions, capability-gated transitions, optimistic revision checks, idempotent request IDs, private runtime tables, SECURITY INVOKER public wrappers and two-session race test. |
23
-| 2026-10-01 | Owner reconfirmed autonomous GitHub + Supabase execution and five-specialist operating model. | **ACTIVE OPERATING DIRECTIVE** | No repeated routine approval requests. Preserve the safety/cost boundaries above. |
24
-| 2026-10-01 | Free-tier-only development/verification. | **ACTIVE OPERATING DIRECTIVE** | No paid Supabase branch or other billable development resource. |
25
-| 2026-10-01 | Live QA: commerce/tax IDs/request builder/personnel/license/floating-detail coding. | **PARTIALLY IMPLEMENTED / FOLLOW-UPS OPEN** | Kardex/tax-ID/request/profile/license/floating-code work landed. Exact Taxpayer-System print layout still waits for owner reference images. Legacy request records remain preserved only for rollback/audit. |
26
-| 2026-09-30—2026-10-01 | Office C1–C7, ELI-1–ELI-4, Slice A/B and accounting phases 1–6. | **VERIFIED WITH DOCUMENTED BOUNDARIES** | See required evidence below; do not redo completed phases without verified regression evidence. |
17
+| 2026-10-01 | Owner said «ادامه بده» after D3a handoff. | **D3B + D3C VERIFIED** | D3b visual editor/conditions/timeline and D3c SLA/delegation/outbox are production + disposable-DB + real-DOM verified. Continue with D4 approver/delegate work queue and bounded outbox-consumer contracts; do not claim external delivery until a real adapter exists. |
18
+| 2026-10-01 | Slice D3c — SLA/escalation, delegation/substitution, transactional outbox. | **IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + CI VERIFIED** | `js/request-workflow-d3c.js`; migrations `20261001235500`, `20261002000500`, `20261002001000`; Quality run `36917772952` all three jobs SUCCESS. Evidence: `docs/REQUEST_WORKFLOW_D3C_VERIFICATION.md`. |
19
+| 2026-10-01 | Slice D3b — visual workflow editor + conditions + timeline. | **IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + CI VERIFIED** | `js/request-workflow-d3b.js`; migration `20261001233000`; bounded predicate DSL, skipped-step evidence and authorized timeline RPC. Quality run `36915696611` all three jobs SUCCESS. Evidence: `docs/REQUEST_WORKFLOW_D3B_VERIFICATION.md`. |
20
+| 2026-10-01 | Slice D3a — sequential/parallel request workflow runtime. | **IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + CI VERIFIED** | Migrations `20261001230000`, `20261001230500`; private step/vote runtime, quorum semantics, capability checks, idempotent decisions and immutable evidence. Quality run `36913565943` all three jobs SUCCESS. |
21
+| 2026-10-01 | Slice D2 — request UI/read-model + legacy cutover. | **IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + CI VERIFIED** | `js/request-workflow-d2.js`; migrations `20261001223500`, `20261001224500`; Quality run `36912668369` all three jobs SUCCESS. Legacy source records remain preserved and imported rows traceable. |
22
+| 2026-10-01 | Slice D1 — requests/BPMS-lite server foundation. | **IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + CI VERIFIED** | Migrations `20261001204500`, `20261001205500`, `20261001210500`, `20261001211500`; Quality run `36910187257` all three jobs SUCCESS. |
23
+| 2026-10-01 | Office Slice C8 workflow policy/runtime. | **IMPLEMENTED / PRODUCTION + ADVERSARIAL + CONCURRENCY + REAL-DOM + SECURITY VERIFIED** | Immutable workflow evidence, pinned policy versions, capability-gated transitions, optimistic revision checks, idempotency, private runtime tables and SECURITY INVOKER public wrappers. |
24
+| 2026-10-01 | Owner reconfirmed autonomous GitHub + Supabase execution and free-tier-only development. | **ACTIVE OPERATING DIRECTIVE** | No repeated routine approval requests; no paid development resource. Preserve safety/cost boundaries. |
25
+| 2026-10-01 | Live QA: commerce/tax IDs/request builder/personnel/license/floating-detail coding. | **PARTIALLY IMPLEMENTED / FOLLOW-UPS OPEN** | Kardex/tax-ID/request/profile/license/floating-code work landed. Exact Taxpayer-System print layout still waits for owner reference images. |
26
+| 2026-09-30—2026-10-01 | Office C1–C7, ELI-1–ELI-4, Slice A/B and accounting phases 1–6. | **VERIFIED WITH DOCUMENTED BOUNDARIES** | See required evidence; do not redo completed phases without verified regression evidence. |
27
| 2026-09-30 | Iran-first high-assurance ERP expansion. | **IN PROGRESS — BROADER ROADMAP** | `docs/IRAN_COMPLIANCE_MATRIX_V1.md`; do not claim statutory consolidation/full tax submission/full HR/CRM until lifecycle/accounting/permissions/tests exist. |
28
29
-## Live reconciliation — 2026-10-01 after D3b verification
30
-- D3b final code commit: `eb04c5a2cc2160d6f1abab22104336ff522b89de`; Quality run `36915696611`: `static-quality`, `c8-policy-database`, and `d1-request-database` all SUCCESS. Real DOM smoke passed all 33 tests including D3b publish/remount and timeline behavior.
31
-- D3b followed test-first evidence: red contract commit `8371918f8a0792a2c156161820ed622117d0006c`; implementation `175c00529e4005c15cea352f7c5e9fb11867e96e`; regression test `ca1fe68dc8c8624281824e43f16d4a20d7f49030` exposed editor loss after publish; `eb04c5a...` fixed it.
32
-- Production Supabase `hcsixhqbyuhpshfwqpjx`: D3b migration applied; private step instances retain `condition_json` + `condition_matched`; false conditions persist as `skipped`; public timeline RPC is SECURITY INVOKER, authenticated-only, and rechecks tenant/module/request visibility in its private implementation.
33
-- Production condition checks verified numeric-string comparison semantics (`1200 >= 1000` true, `500 >= 1000` false). Unsafe field/operator forms are rejected by disposable PostgreSQL behavioral tests.
34
-- Production security advisor after D3b: no new request-workflow warning; pre-existing 20 public SECURITY DEFINER warnings, C8 private RLS informational notices and leaked-password protection warning remain open.
35
-- Production performance advisor after D3b: no unindexed-foreign-key finding; only expected unused-index informational findings remain.
36
-- D2 legacy source records remain intact and traceable; D3b did not mutate legacy source data.
37
-- C8 correspondence workflow remains separate from Requests; request workflow state does not replace C1 registration or C5 approval evidence.
29
+## Live reconciliation — 2026-10-01 after D3c verification
30
+- D3c latest verified code/migration head before documentation: `be4f85b21ba3c608fcba0d0812182d0e063d6391`; Quality run `36917772952`: `static-quality`, `d1-request-database`, and `c8-policy-database` all SUCCESS, including D3c Real DOM and disposable PostgreSQL assertions.
31
+- D3c used test-first evidence. Red contract commit `d7f5972476cabde22b340bbcfa94ac2aa7e57093`; implementation `8e93dcb67534e6b1b302fd435c714f392eb0ca6a`; disposable-bootstrap regression fixed by `cba9fec2be2b469d4ccfa8bea9a260b8c0ee73e5`; escalation conflict target fixed by migration `20261002000500`; production FK advisor finding fixed by `20261002001000` / commit `be4f85b...`.
32
+- Production Supabase `hcsixhqbyuhpshfwqpjx`: D3b + D3c migrations applied. Private request step instances retain condition and SLA/deadline/escalation evidence; delegated votes retain the real actor plus `delegated_from_user_id`; private transactional outbox exists with no direct authenticated table grants.
33
+- D3c public delegation/list/revoke/escalation/outbox/timeline wrappers are SECURITY INVOKER. Authenticated execution is granted only through controlled RPCs; anon execution is denied for mutation/operations RPCs.
34
+- Production security advisor after D3c: no new request-workflow public SECURITY DEFINER warning; the pre-existing 20 public warnings, C8 private-RLS informational notices and leaked-password protection warning remain open.
35
+- Production performance advisor after D3c FK hardening: no unindexed-foreign-key finding; only expected unused-index informational findings remain on the low-traffic dataset.
36
+- D2 legacy source records remain intact and traceable. C8 correspondence workflow remains separate from Requests.
37
38
## Implemented foundations
39
- Accounting phases 1–6: accepted high-assurance accounting foundation; posted history remains immutable and balanced.
40
- Slice A/B + ELI-1–4: modular entitlements, tenant/RBAC, seats, delegated admin, reusable roles, secure invitations and organization UX.
41
- Office C1–C8: registration/read evidence, referrals, archive/classification, numbering/templates, approvals/SLA, OCR provenance boundary and versioned correspondence workflow runtime.
43
-- Requests D1: independent versioned request definition/form/workflow foundation, pinned versions, idempotent create, expected-revision transition, immutable evidence and server authorization.
44
-- Requests D2: server-backed request builder/runtime UI, immutable version publishing, retry-safe create, stale-revision recovery, capability-gated configure UI, non-destructive legacy import and traceability.
45
-- Requests D3a: validated workflow schema v2, ordered sequential/parallel approval steps, quorum voting, per-step capability authorization, idempotent decisions and private runtime state.
46
-- Requests D3b: visual ordered-step editor, immutable combined form/workflow publication, bounded condition predicates, persisted skipped-step evidence and authorized read-only runtime timeline.
42
+- Requests D1/D2: independent versioned request definitions/forms/workflows, pinned versions, idempotent create/transition, immutable evidence, server authorization, server-backed UI/read model and non-destructive legacy cutover.
43
+- Requests D3a: ordered sequential/parallel approval steps, quorum voting, per-step capability authorization and private runtime state.
44
+- Requests D3b: visual ordered-step editor, bounded server condition predicates, skipped-step evidence and authorized runtime timeline.
45
+- Requests D3c: step SLA/deadline/escalation evidence, explicit time-bounded delegation with provenance, and transactional approved-request outbox intents.
46
47
## Invariants
49
-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; referral targets must already be authorized to read the source correspondence; OCR provenance must reference a real attachment belonging to the same organization/correspondence; C8 workflow policy is pinned per correspondence instance and its evidence is append-only. 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 step votes require distinct actors for parallel quorum and active-step capability authorization. D3b conditions are bounded server-validated predicates only; skipped condition results remain evidence and timeline reads are authorization-checked. Request workflow state never replaces C1 registration status or C5 correspondence approval evidence.
48
+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.
49
50
## Required evidence
52
-`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/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`.
51
+`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`.
52
53
## NOT VERIFIED / external boundary
55
-D3c SLA/escalation, delegation/substitution and transactional cross-module outbox actions are not yet implemented. 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.
54
+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.
55
56
## Exact next executable work
58
-1. D3c: add request SLA/deadline evidence and escalation state without mutating historical events.
59
-2. Add delegation/substitution with explicit effective windows, tenant/capability checks and immutable evidence; do not silently impersonate approvers.
60
-3. Add a transactional cross-module outbox for approved request side effects; delivery must be idempotent and retry-safe and must not directly mutate posted accounting history.
61
-4. Add disposable PostgreSQL, real-DOM and failure/retry tests before production application.
62
-5. Keep qualified digital signature, external delivery/BPM adapters and real OCR provider outside verified scope until real providers are connected and tested.
57
+1. D4a: add a server-authorized approver/delegate work queue so direct and delegated active tasks are discoverable without weakening request-instance RLS.
58
+2. D4b: add notification/escalation scheduling contracts around existing SLA evidence, but keep actual external email/SMS delivery outside verified scope until a real provider is connected.
59
+3. D4c: define idempotent per-module outbox consumer contracts with draft-only effects and explicit failure/retry evidence; do not allow a request workflow to directly post accounting entries.
60
+4. Add disposable PostgreSQL, real-DOM and retry/concurrency tests before any production cutover.
61
+5. Continue compliance/accounting roadmap only with sourced legal/tax/accounting evidence and controlled cutover safeguards.
62
63
## Live QA open items
64
- Exact Taxpayer-System print redesign: waiting for the two owner reference images; do not guess the official visual form.
docs/REQUEST_WORKFLOW_D3C_VERIFICATION.md
new
+47
@@ -0,0 +1,47 @@
1
+# Request Workflow D3c Verification
2
+
3
+Date: 2026-10-01
4
+
5
+## Scope
6
+D3c completes the bounded request-workflow roadmap slice with step SLA/deadline evidence, explicit time-bounded delegation/substitution, and a transactional cross-module outbox. It does not dispatch external/module side effects directly and it does not mutate posted accounting history.
7
+
8
+## Implementation
9
+- UI: `js/request-workflow-d3c.js`, loaded after D3b.
10
+- Main migration: `supabase/migrations/20261001235500_request_workflow_d3c_operations.sql`.
11
+- Escalation idempotency follow-up: `supabase/migrations/20261002000500_request_workflow_d3c_escalation_conflict_fix.sql`.
12
+- Delegation FK index: `supabase/migrations/20261002001000_request_delegation_to_user_fk_index.sql`.
13
+- Static contract: `scripts/request-workflow-d3c-check.mjs`.
14
+- Real DOM: `scripts/request-workflow-d3c.spec.js`.
15
+- Disposable PostgreSQL: `supabase/tests/request_d3c_operations.sql`.
16
+
17
+## SLA and escalation
18
+Workflow schema v2 accepts optional `slaHours` per step, server-validated to 1..8760. Runtime step instances materialize `sla_hours` and `due_at` when a step becomes active. `request_escalate_overdue` is configure-capability gated, marks overdue active steps once, increments explicit escalation evidence and appends immutable `step_escalated:<step>` events. The UI exposes SLA configuration, timeline evidence and a controlled overdue scan action. No background scheduler was invented; automatic scheduling remains an operations boundary.
19
+
20
+## Delegation/substitution
21
+Delegations are private, explicit, time-bounded (maximum 90 days), organization-scoped and capability-specific. A user can delegate only a workflow capability they currently hold to another active member. Decision authorization revalidates that the source user still holds the delegated capability. Delegated votes retain `delegated_from_user_id`; the actor is never impersonated. Create/revoke operations are organization-audited and public RPC wrappers are SECURITY INVOKER.
22
+
23
+## Transactional outbox
24
+A workflow may declare at most 10 `onApproved` actions. Target modules are allowlisted, action keys are restricted identifiers and payload configuration must be a bounded JSON object. Final approval and outbox insertion occur in the same database transaction. The outbox stores pending intent only; no dispatcher in D3c directly calls another module or external provider. Unique request/revision/module/action keys make enqueue retry-safe.
25
+
26
+## TDD / defect evidence
27
+- Red contract commit `d7f5972476cabde22b340bbcfa94ac2aa7e57093` added D3c static/DOM/database expectations before production implementation; static quality failed because D3c production files did not exist.
28
+- Implementation commit `8e93dcb67534e6b1b302fd435c714f392eb0ca6a` added D3c UI/database behavior.
29
+- The first disposable DB run exposed a test-bootstrap compatibility regression (`organizations.name` lacked a default); commit `cba9fec2be2b469d4ccfa8bea9a260b8c0ee73e5` repaired the disposable bootstrap without weakening production schema.
30
+- The next D3c behavior run exposed an incorrect escalation `ON CONFLICT` target. Migration `20261002000500` corrected it to the real `(organization_id,idempotency_key)` uniqueness boundary.
31
+- Production performance advisor then found the delegation target FK lacked a leading index; migration `20261002001000` added `request_delegations_to_user_idx` and a fresh advisor run removed all unindexed-FK findings.
32
+
33
+## Verification
34
+Quality run `36917772952` on commit `be4f85b21ba3c608fcba0d0812182d0e063d6391` completed with all three jobs SUCCESS:
35
+- `static-quality`: D3c static invariants and full Real DOM smoke SUCCESS.
36
+- `d1-request-database`: D1/D2/D3a/D3b regressions plus D3c SLA, delegated approval provenance, transactional outbox, escalation evidence, invalid SLA and unsafe action-key rejection all SUCCESS.
37
+- `c8-policy-database`: C8 correspondence workflow regression suite SUCCESS.
38
+
39
+Production Supabase `hcsixhqbyuhpshfwqpjx` received D3c main/follow-up/index migrations. Production reconciliation confirmed private delegation/outbox tables, SLA/delegation columns, authenticated-only public RPC execution, SECURITY INVOKER public wrappers and no direct authenticated grants on private D3c tables. Security advisor shows no new D3c public SECURITY DEFINER warning. Performance advisor shows no unindexed foreign key after the target-user index fix; only expected unused-index informational findings remain on the low-traffic dataset.
40
+
41
+## Preserved boundaries
42
+- Requests remain independent from C8 correspondence workflow state.
43
+- Legacy D2 request source records remain preserved for rollback/audit.
44
+- Outbox delivery/dispatch is intentionally not claimed verified; no downstream module adapter is executed by D3c.
45
+- Automatic scheduled escalation is not claimed verified; D3c provides deterministic server-side escalation evidence and a controlled trigger.
46
+- Two-real-user production browser E2E with a persistent legitimate non-owner member remains outside verified scope; delegated multi-user behavior is verified in disposable PostgreSQL with distinct authenticated identities.
47
+- Qualified digital signature, external BPM/delivery providers and real OCR provider remain external boundaries.