## Business Value
Provide a daily view of unresolved QuickBooks Class-to-School assignments by file, covering the current school year since 1 July. The email includes a full grouped CSV with signed expense/revenue and posting counts, with classless postings shown separately. Unresolved assignments may be intentional.
## Implementation
- Add an independent reporting Lambda over accepted Core postings, validating publication/ledger counts, freshness, immutable source provenance, School assignment compatibility and independent accounting totals.
- Live daily at 10:00 UTC, addressed only to ashwanth.r@trilogy.com for now. Both recipient audiences and SES IAM enforce that single address. The production-only deployment allowlist excludes the digest from dev stacks and registry publication; runtime rejects non-prod before AWS access.
- Fence final School compatibility with mapping-generation reads. If the generation changes, recheck compatibility once; incompatible assignments, changing Core inputs or continuous generation movement fail before delivery.
- Audit every non-system relation before adding reader grants, rejecting excess table/column privileges and unreviewed memberships. Require all three explicit accounting partitions and their measures, and neutralize formula-like CSV source text while preserving raw evidence and signed amounts.
- Save immutable report/MIME evidence. Fetch and checksum-verify the frozen MIME before acquiring a daily delivery claim so preparation failures can retry. Same-day retries skip verified receipts; ambiguous SES attempts remain blocked for reconciliation.
- Keep whole-table readiness because the Core writer atomically replaces the entire fact. Historical ledger entries are supported; mixed fact generations indicate contamination and are rejected.
## Validation
- Latest main (55fa4e51) is incorporated into head 97317afe. 151 Python tests, 1,013 CDK tests, TypeScript compilation and scoped Ruff checks pass. The full CDK suite ran in a clean snapshot of this head.
- Added 23 tests executing the shipped readiness SQL, precise inter-query mapping-race tests, retry tests for pre-claim S3 timeout/checksum failure, and reader-audit regression coverage. An actual-entrypoint dev synthesis test checks both stack and registry exclusion; the daily rule test requires production mode in its target input.
- Live audit-only verification inspected 3,559 relations and confirmed exactly the seven approved SELECTs, with no unreviewed roles/groups or column grants; no grants were changed. The live owning procedure confirms whole-table replacement and a retained publication ledger.
- Deployed only Pipeline-quickbooks-unmapped-class-report-prod with --exclusively; verified [1/1], CloudFormation completion and exact deployed Python/SQL. Only the Lambda code changed in this stack.
- Supported live workflows on 21 October: preview validate-qb-review-preview-20261021T041652Z validated all 39 groups and matched the independent preflight CSV; validate-qb-review-self-test-20261021T041912Z sent one test email only to ashwanth.r@trilogy.com; validate-qb-review-duplicate-check-20261021T041937Z skipped the duplicate using the same verified receipt. All three run records are SUCCESS with failure notifications suppressed. Today's production claim was untouched, and the enabled daily rule still targets production mode at 10:00 UTC.
- Review responses include the detailed evidence, starting at https://github.com/AI-Builder-Team/Surtr/pull/2190#discussion_r4333003580. Historical execution evidence remains in pipelines/runners/quickbooks-unmapped-class-report/VALIDATION.md.
## Implementation Effort
Approximately 3–4 engineering days for an average engineer to implement the accounting/readiness contract, runner/access controls, safe delivery state, deployment isolation, regression coverage and live validation without AI assistance.
## Linear
https://linear.app/builder-team/issue/SURTR-1650