سامانه صدور فاکتور و حسابداری
Document verified Office Slice C1 evidence
davoodmehraban89 committed
Sep 30, 2026 at 18:50 UTC
191a00d5d9ec7230f6c0b6cc03df39679cfc76f8
1 file changed
+62
docs/OFFICE_SLICE_C1_VERIFICATION.md
new
+62
@@ -0,0 +1,62 @@
1
+# Office Slice C1 — Registered History + Read Evidence Verification
2
+
3
+Date: 2026-09-30
4
+Project: `hcsixhqbyuhpshfwqpjx`
5
+
6
+## Delivered
7
+- Registered correspondence can no longer be deleted after registration.
8
+- Registration identity (`organization_id`, owner, collection/id, `registryId`, `registerNumber`, `registeredAt`) is immutable after registration.
9
+- Registered correspondence status is monotonic across `registered -> submitted -> closed`; backward transitions are rejected.
10
+- Registered correspondence mutations emit organization audit evidence.
11
+- Read evidence is append-only and records the authenticated reader server-side through `office_mark_correspondence_read`.
12
+- The correspondence open flow records read evidence before showing a non-draft letter; if evidence creation fails, display is stopped rather than silently losing the audit event.
13
+
14
+## Production migration
15
+`20260930054352 office_registered_history_read_evidence`
16
+
17
+The archived repository migration is:
18
+`supabase/migrations/20260930054352_office_registered_history_read_evidence.sql`.
19
+
20
+## TDD / implementation evidence
21
+- Plan: `59ebb658a4f284b3d0137bb2289ab8829a4bd381`.
22
+- Server hardening: `20790d5998ef06105d5715864fb4ce2453dc470e`.
23
+- Failing Real-DOM coverage first: `fe7ffd102d9ed03f0d5967447bcecef64485741e`.
24
+- Runtime integration: `15b32367ff9a8154729da27cd581930871b5fb5b`.
25
+
26
+## Transactional production adversarial verification
27
+All fixtures and evidence were created inside a transaction and rolled back. Post-test residue counts were zero.
28
+
29
+PASS:
30
+1. Protected registration-number mutation is rejected.
31
+2. Registered correspondence cannot move backward to draft.
32
+3. Registered correspondence delete is rejected.
33
+4. Authorized organization owner can create read evidence.
34
+5. Read evidence stores the authenticated principal as `readerUserId`; the caller cannot supply a forged reader.
35
+6. Read evidence update is rejected.
36
+7. Read evidence delete is rejected.
37
+8. A principal from another organization cannot create read evidence for the letter.
38
+9. Registered correspondence mutation produced organization-audit evidence inside the transaction.
39
+10. Rollback left zero correspondence fixture, read-evidence or organization-audit residue.
40
+
41
+## GitHub evidence
42
+Verified product head for the C1 runtime: `15b32367ff9a8154729da27cd581930871b5fb5b`.
43
+- Quality run `36674993838`: PASS, including all accounting/Golden, ELI-1/2/3/4, Office C1 invariants and Real-DOM.
44
+- Security run `36674993881`: CodeQL JavaScript PASS. Dependency Review remains skipped because the repository dependency-graph boundary is unchanged.
45
+- Pages run `36674993095`: build/deploy/report PASS.
46
+
47
+## Supabase advisor status
48
+- Security advisor still reports authenticated-callable SECURITY DEFINER RPC warnings, including the intentionally exposed `office_mark_correspondence_read`; its negative cross-tenant authorization test passed. This warning remains a review/disposition item rather than being treated as proof of an exploit.
49
+- Leaked-password protection remains disabled.
50
+- Performance advisor reports unused-index informational notices only in the current snapshot.
51
+
52
+## Scope boundary / NOT VERIFIED
53
+C1 closes only registered-history immutability and server-authoritative read evidence. It does not claim completion of:
54
+- letter templates/editor;
55
+- approval/signature lifecycle or qualified digital signatures;
56
+- full referral-chain UX, SLA/reminders or reply/related-letter graph;
57
+- archive folders/classification;
58
+- real Persian OCR/full-text quality;
59
+- external email/ECE/API delivery adapters;
60
+- persistent two-real-user production browser E2E.
61
+
62
+Those remain later Office Slice C / external-boundary work.