@davoodmehraban89 / Factor-easy / commits / 8537d80
Fork 0

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

Reconcile live checkpoint and record owner approval boundaries

davoodmehraban89 committed Oct 1, 2026 at 09:52 UTC 8537d8031be3dea6523c06fa5a41f8ea9c2c00c7
1 file changed +13 -3
PROJECT_STATE.md
+13 -3
@@ -7,11 +7,12 @@
7 Read `AGENTS.md` first, then this file. Latest user chat is the only source of new instructions; repo files are continuity/context. Detailed older history remains available in Git history.
8
9 ## Protocol / authority
10 -Verify live GitHub + Supabase before acting; implement/test/fix/retest/commit/verify in vertical slices; update this file with durable implementation state; archive exact production SQL; never call unrun work verified. Owner granted standing authority on 2026-09-30 for in-scope GitHub/Supabase engineering, excluding platform-required confirmations, paid/public/external actions and unsafe destructive financial-history changes. Owner explicitly directed that implementation continue autonomously without waiting for routine confirmations; progress messages/questions must not stop executable work unless the owner explicitly says stop or a real safety/tool blocker requires input.
10 +Verify live GitHub + Supabase before acting; implement/test/fix/retest/commit/verify in vertical slices; update this file with durable implementation state; archive exact production SQL; never call unrun work verified. Historical standing authority from 2026-09-30 is narrowed by the latest 2026-10-01 user instruction: ask before any schema, RLS, auth, role changes or destructive data operations. Routine in-scope non-sensitive engineering may continue; no earlier repository directive overrides this approval gate. Owner explicitly directed that implementation continue autonomously without waiting for routine confirmations; progress messages/questions must not stop executable work unless the owner explicitly says stop or a real safety/tool blocker requires input.
11
12 ## Current change ledger
13 | Date | Request / decision | Status | Evidence / next action |
14 |---|---|---|---|
15 +| 2026-10-01 | Owner requested live main/CI/Supabase reconciliation, request recording before implementation, verified vertical slices, same-commit state updates, SQL migration archival, explicit approval before schema/RLS/auth/role/destructive changes; subsequently said «ادامه بده». | **AUDIT RECORDED / C8 SENSITIVE CHANGES AWAIT APPROVAL** | Read AGENTS.md then this file in full. Audited main `63fd08f500f31b41877a50020ce023d6ec46f812`; reviewed actual Quality job logs, migration inventory and public RLS catalog. No product, database, auth or role change performed. Details below. |
16 | 2026-10-01 | Continue Office Slice C autonomously from the current checkpoint. | **IN PROGRESS** | C1-C7 are closed with evidence; C8 workflow policy is the next slice. |
17 | 2026-09-30 | Office Slice C4: tenant-safe registration repair + versioned correspondence templates + controlled draft application. | **IMPLEMENTED / PRODUCTION + ADVERSARIAL + REAL-DOM + SECURITY VERIFIED** | Production migrations `20260930202526_office_registration_tenant_repair`, `20260930202701_office_slice_c4_versioned_templates`; verified runtime/test head `481f9fed434f127eaa32ccf8d69c649e783b5cad`; Quality `36773156535` PASS including C4 + Real-DOM; Security `36773156559` CodeQL PASS; Pages `36773155535` PASS. Removed ambiguous legacy registration overload, bound registration to organization, added private append-only template versions, server provenance validation and template UI. Evidence: `docs/OFFICE_SLICE_C4_VERIFICATION.md`. |
18 | 2026-10-01 | Office Slice C5: internal approval/attestation lifecycle. | **IMPLEMENTED / PRODUCTION + ADVERSARIAL + REAL-DOM + SECURITY VERIFIED** | Production migrations `20260930203456`, `20260930203620`, `20260930203709`; content-bound SHA-256 approval evidence, explicit approver authorization, reject/rework/new-request semantics, stale-content rejection and AAL metadata. Runtime head `02f76f18c7685a4da88de68972113d32b30a21fb`; Quality `36774255459` PASS; Security `36774255463` CodeQL PASS; Pages `36774253349` PASS. Evidence: `docs/OFFICE_SLICE_C5_VERIFICATION.md`. Not a qualified digital signature. |
@@ -29,7 +30,16 @@ Verify live GitHub + Supabase before acting; implement/test/fix/retest/commit/ve
30 | 2026-09-30 | Modular organization-wide ERP + office automation/request foundation. | **SLICE A IMPLEMENTED / VERIFIED** | Product head `df82067ecb1fda9007eb11a30d0a9d7cc1b113cd` passed Quality/Security/Pages. |
31 | 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. |
32
32 -## Current production state — 2026-09-30
33 +## Live reconciliation — 2026-10-01
34 +- Observed main head: `63fd08f500f31b41877a50020ce023d6ec46f812`. Recent ancestors: `2ba56f885ab7aee4569002f91d7a9e39f0a64ff1`, `3d2938eded49a48aa90f5edb8f1252ff6ee3dc4b`, runtime `b1c800c540e1181ffbe3efc32998c77e0c8f9fd1`.
35 +- Baseline Quality run `36777282033`, Security `36777281994`, Pages `36777282608`: success. Quality job `110098377680` steps and actual logs inspected: accounting/Golden checks succeeded; Chromium real-DOM suite reports `16 passed (11.8s)`. This is inspection of existing execution evidence, NOT a fresh local run, full production E2E, or completion of C8.
36 +- Supabase `hcsixhqbyuhpshfwqpjx`: ACTIVE_HEALTHY; 53 live migrations through `20260930205919`. Repository has 56 SQL files: extra versions `20260929222000`, `20260930222500`, `20260930223000` were read and are comment-only superseded NO-OP placeholders, not pending production DDL. No migration history repair or replay was performed. Full SQL-content equivalence of all 53 migrations remains NOT VERIFIED in this audit.
37 +- Read-only public catalog inspection: all 13 public ordinary/partitioned tables have RLS enabled and at least one policy; FORCE RLS is false. Enabled RLS alone does not prove effective tenant isolation. Fresh adversarial RLS execution and private/storage policy review remain NOT VERIFIED.
38 +- Security advisor still reports 20 authenticated-callable SECURITY DEFINER warnings and disabled leaked-password protection. No security/auth setting was changed. Previous production-membership and performance claims below are historical and were not re-run in this audit.
39 +- No feature is newly marked COMPLETED. Fresh local accounting tests, real-DOM smoke and persistent two-user production E2E: NOT VERIFIED this session. This change only reconciles documentation and records the owner request before implementation.
40 +- Approval boundary: before C8 database implementation, obtain owner approval for additive versioned workflow policy/stage/transition storage, immutable transition evidence and tenant-scoped RLS/RPC authorization. No destructive data operations, commercial-role expansion or auth-provider changes are included in that proposed scope.
41 +
42 +## Current production state — 2026-09-30 (historical checkpoint; live checks above)
43 - Supabase project `hcsixhqbyuhpshfwqpjx`: `ACTIVE_HEALTHY`, PostgreSQL `17.6.1.166`, **53 migrations through `20260930205919 office_c7_bind_ocr_source_attachment`**.
44 - Continuity repair: live migration `20260930203839 office_c5_content_digest_hardening` was found live but absent from Git; its exact SQL was recovered from Supabase migration history and archived before C6.
45 - Four organization-linked licenses with server-enforced `max_companies`, `max_users`, modules and future-safe `limits`; no license is below current active seat/company usage.
@@ -68,7 +78,7 @@ Posted accounting history is immutable and balanced; tenant isolation is enforce
78 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; qualified digital signature; physical printer; live external adapters; GitHub Dependency graph; leaked-password protection; PostgreSQL 17.11 upgrade; CodeQL v4 migration.
79
80 ## Exact next executable work
71 -1. Start Office Slice C8 as the next bounded internal-office vertical slice: mature correspondence workflow policy (configurable workflow stages, authorized transition rules and immutable transition evidence) without claiming external BPM/provider integration; preserve all C1-C7/accounting/Golden/ELI gates.
81 +1. Obtain explicit owner approval for C8 schema/RLS/authorization changes before implementing that sensitive scope. Then start Office Slice C8 as the next bounded internal-office vertical slice: mature correspondence workflow policy (configurable workflow stages, authorized transition rules and immutable transition evidence) without claiming external BPM/provider integration; preserve all C1-C7/accounting/Golden/ELI gates.
82 2. Keep qualified digital signature and external delivery adapters explicitly outside verified scope until real providers are connected and tested.
83 3. Authenticated two-real-user production browser verification remains blocked until a legitimate persistent non-owner principal is intentionally available; do not fabricate or permanently cross-add one.
84 4. External invitation email delivery remains an adapter boundary; do not claim it until a real provider is connected and tested.