codex/aram-gate3-integration-validation-20261030
add-index-html-10623938925177053894 arena/094f314c-aram chatgpt-phase1b2-autopilot codex/adr-future-connectors-pi-v1 codex/aram-account-note-source-trace-20261031 codex/aram-actions-node24-maintenance-20261031 codex/aram-analyst-review-workbook-20261031 codex/aram-bs-candidate-statement-20261031 codex/aram-cash-flow-direct-candidate-20261031 codex/aram-clean-reference-year-integrity-20261030 codex/aram-cross-statement-controls-20261031 codex/aram-equity-changes-candidate-20261031 codex/aram-five-statement-cli-20261031 codex/aram-five-statement-integration-20261031 codex/aram-five-statement-orchestrator-20261031 codex/aram-gate3-coverage-target-guard-20261030 codex/aram-gate3-hidden-xlsx-guard-20261030 codex/aram-gate3-integration-validation-20261030 codex/aram-gate3-mapping-change-preview-20261030 codex/aram-gate3-stale-note-guard-20261030 codex/aram-income-statement-candidate-20261031 codex/aram-manifest-referential-integrity-20261031 codex/aram-mapping-source-parser-20261101 codex/aram-multidimensional-mapping-20261101 codex/aram-multistatement-mapping-20261031 codex/aram-pipeline-manifest-schema-20261031 codex/aram-readonly-mapping-coverage-20261031 codex/aram-reconciliation-review-gate-20261031 codex/aram-same-flush-fiscal-lock-20261030 codex/aram-synthetic-windows-demo-20261031 codex/aram-trial-balance-diagnostic-20261031 codex/aram-windows-background-detail-search-20261031 codex/aram-windows-detail-review-20261031 codex/aram-windows-five-statement-pilot-20261031 codex/aram-windows-statement-figures-20261031 codex/gate-2a-pilot-workbook codex/gate-2a-pilot-workbook-6864754244772568979 codex/gate3-authenticated-principal-boundary-20261030 codex/gate3-authored-draft-staging-20261030 codex/gate3-carry-forward-preview-20261023 codex/gate3-draft-staging-audit-20261030 codex/gate3-mapping-batch-freshness-20261030 codex/gate3-mapping-batch-review-20261030 codex/gate3-mapping-core codex/gate3-mapping-coverage-20261023 codex/gate3-mapping-excel-20261023 codex/gate3-note-mapping-review-20261023 codex/gate3-signed-year-scope-20261030 codex/gate3-unapproved-proposal-storage-20261030 codex/payvast-mapping-discovery-20261023 codex/phase-2a-backend-foundation codex/phase-2b-post-merge-record codex/phase-2b-source-registration codex/phase-2b-source-registration-12955190277775369594 codex/post-gate2a-control-reconciliation codex/post-pr18-acceptance-record codex/project-control-foundation codex/t1-repo-hygiene-20261023 codex/t2-ci-hardening-20261023 codex/t3-explicit-migrations-20261023 codex/t6a-readonly-diagnostics-20261023 codex/v1-01-safety-gate-hardening codex/v1-year-isolation-followup-20261023 codex/windows-native-pilot-shell-20261030 docs/aram-master-control-plan-20261111 docs/aram-roadmap-dashboard-20261030 docs/financial-statement-reconciliation-1402-1404-20261110 feat/gate3-governed-mapping-20261101 feat/gate3-package9-1-security-20261103 feat/gate3-package9-isolated-20261103 fix/password-unicode-validation-20261111 governance/aram-5-1-3-controls-20261030 governance/role-based-operating-model jules-1168663913887856558-73b8a885 jules-gate-2b-mapping-workflow-foundation-4137724387867065330 phase-1b1-audit-report-7365389436990903239 phase-2a-backend-foundation-10237597358138521261 phase1b2-postmerge-metadata-fix refactor/drg-parent-year-id-15088443704684163304 source-data-cleanup
md 5.28 KB

Implementation and Verification Plan — Fiscal-Year Graph Integrity

  • Date: 2026-10-30.
  • Issue: #36.
  • Parent: PR #32 @ 28d1c57882ec20fc17c2c133bbe62ff56e12973f (unaccepted).
  • Combined candidate: Draft PR #35, superseding the separately tested Draft PR #41.
  • Design: fiscal-year-graph-integrity.md.
  • Scope: models.py, test_models.py, spec, plan, append-only log/handoff. No migration or financial source changes.

Work item A — Same-flush lifecycle protection

  1. Branch from exact #32 head. Add regressions without changing implementation.
  2. Demonstrate failures against unmodified parent: commit 8e637e96a8c09b5f2fc826922dd4b53a7ec512a3, CI 41059319522: 9 failed, 111 passed. Failure cause: missing expected ValueError on seven existing-record changes, new source document, same-flush company change. A separately committed Draft edit followed by approval remains a passing control.
  3. Resolve proposed status from in-session FiscalYear before querying persisted state, and apply same-flush Company guard.
  4. Re-run all: fix SHA f5f9257563f382f6663bc7b1eb0433a43482e9fd, CI 41059384195: 120 passed, 1 warning, Alembic round-trip and compile passed.

Work item B — Persisted clean dependent references

  1. Reproduce gap separately on a child Draft: RED SHA 0994232dfb48eac4d448cf4ea09b8ba770ae0cf0, CI 41060564954: 6 failed, 123 passed. The six failures are cross-year unmodified reference bypasses for two note-reference kinds and statement-year moves, each tested across same and different companies.
  2. Add before-flush checks for persisted dependent MappingRule and StatementLine references when NoteDefinition or FinancialStatement year changes. GREEN SHA c3df2611fdcf20812ca9d9a8c794f1b31d9fcddf, CI 41060729930: 129 passed, 1 warning.
  3. Add positive behavior checks: valid unreferenced parent movement, explicit old-year mapping/note-line retarget and moving note and statement parents together. GREEN SHA 78ff0dd5a8ee35b621ae901be39f6a11d37ea063, CI 41060899585: 132 passed, 1 warning.
  4. Verify pre-consolidation exact final-head run: 331ce349777b39394c633be929ebbbde904c37b5, CI 41061089312: 132 passed, 1 warning, migrations and compile successful.

Work item C — Consolidation under Issue #36

  1. Copy the verified graph-integrity code and regressions into PR #35's branch, which targets PR #32's exact head.
  2. Restore PROJECT_STATUS.md from PR #32 to honor Issue #36's file allowlist.
  3. Add this design/plan pair; preserve append-only project log and handoff entries with explicit supersession of PR #41.
  4. Verified CI for consolidated PR #35 at head 8bd5817b324e1585aca88b72285a4fc00187369d: Backend CI 41061793756 SUCCESS, 132 passed, 1 warning, isolated Alembic upgrade/downgrade and compile. Further record-only edits require one more final-head check. Required commands in backend:
    • python -m pip install -e '.[test]'
    • pytest
    • ARAM_DATABASE_URL=sqlite:///./ci-migration.db alembic upgrade head
    • ARAM_DATABASE_URL=sqlite:///./ci-migration.db alembic downgrade base
    • python -m compileall -q src tests migrations
    • git diff --check (local when available or inspect complete GitHub patch; do not invent it as executed).
  5. Inspect exact 6-file diff, document performance and concurrency limitations, compare main SHA, and obtain genuine non-author C1/C2/C3 review. All reviewer names and signed-off SHAs must be visible remotely.
  6. After consolidated #35 succeeded at 8bd5817b324e1585aca88b72285a4fc00187369d, closed superseded PR #41 without merge; retained its RED/GREEN CI and recorded supersession in PR #41's final comment. Only PR #35 remains a candidate.
  7. After the parent #32 itself is independently accepted, rebase/retarget onto the new accepted head and rerun every mandatory check. No routine merge while controls are blocked.

Acceptance and rollback

  • Separate responsibility: ChatGPT authored test/code/docs; it cannot self-certify C1/C2/C3. Controls stay BLOCKED until actual distinct reviewers participate.
  • This work does not validate raw/bulk SQL, external writers, PostgreSQL/SQL Server concurrency, real accounting data, access permissions, release binaries, or end-to-end source-to-statement reconciliation.
  • A reviewer can reject any undeclared changed path, failure log, stale SHA, unindexed reference-scan performance issue or unapproved accounting operation.
  • Rollback before merge: close Draft candidate. If later merged with approval, use a new independently reviewed revert PR. Do not modify canonical data or force-push.