feat(reporting): compose PostgreSQL services from adapters - #1231
Conversation
Review — PostgreSQL factory wiring, head
|
583efd4 to
4756715
Compare
|
Coordinator rebased #1231 onto merged rc.7 main c45a2c7 and pushed 4756715. All seven contributed file blobs are byte-identical to 583efd4; the rebase had no conflicts. Fresh integrated CI is starting. Please fetch this head and run the clean full suite in the worktree virtualenv as planned, then request renewed review. |
|
Coordinator validation on rebased head 4756715: installed this checkout editable into its own .venv, verified |
|
Current-head validation update: hosted CI passed all 50 executable checks, including full Python suites and PostgreSQL lanes; zero review threads. I reran local |
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — additive managed-reporting factory with no blocking findings.
What I checked:
- Additive public surface (adapter-first reporting factory) shipped under a correct
feat:prefix — no removed/renamed/retyped public exports, no required→optional flips, no wire-shape breaks, so the semver signal is satisfied. - Import layering verified sound; no direct imports of generated codegen names.
- Schema coverage, notification validation, and construction order confirmed with real memory/postgres test coverage.
- No credentials in
ctx_metadata; no CI gates disabled.
Medium findings (non-blocking, 2):
src/adcp/reporting/__init__.py— new exportsReportingProductionOptions/ReportingServiceOfferingomitted fromadcp.reporting.__all__.src/adcp/reporting/service_production.py—postgres()now installs durable Pg source stores plus source DDL unconditionally (a documented runtime default change).
Decision path: no critical/high findings (row 1 n/a); gated_paths false (row 2 n/a); high_risk false (rows 3/5 n/a); mediums are not in data-loss/schema/infra categories (row 4 n/a); no prior escalation (row 6 n/a); no no-auto-approve team match (row 7 n/a); only 2 medium findings (row 8 n/a). Falls through to row 9 — approve.
Note: review_decision is REVIEW_REQUIRED, but this only matters as a hard gate when gated_paths is true, which it is not here.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean subsequent pass.
This is a follow-up push (prior decision: approve) on a non-high-risk, non-gated PR with no no-auto-approve team match. The reviewer found no Critical/High/Medium findings.
What was checked:
src/adcp/reporting/__init__.pyaddsReportingProductionOptionsandReportingServiceOfferingto__all__, completing theimport */dir()surface for names already wired into_LAZY_EXPORTSand theTYPE_CHECKINGblock. PEP 562 facade and import-layering contract intact.docs/reliable-reporting-service.mddocuments the load-bearing DDL-bootstrap default change; table names verified againstinline_storage.py.
No blocking findings, no escalation triggers (high_risk false, gated_paths false, no deletions, no data-loss/schema/infra medium findings, no team gate). Falls through to row 9.
ReliableReportingService.postgres()previously left ordinary adapter staging and replay seals in memory and required adopters to assemble the managed reporting graph. It now defaults to PostgreSQL staging/seals and acceptsReportingProductionOptionsto construct producers, materialization, status/exact reads, receipts and optional signed notification workers from registered adapters and trusted domain inputs.The factory uses the existing production admission, live source-binding checks, per-request authorization and durable capability gates. Explicit source-store overrides and the existing
from_production()bridge remain available. The borrowed pool stays open after service shutdown. The service guide, production wiring example and strict adopter type fixture show the new path.Validation:
make lint,make typecheck-all, 11 focused memory/PostgreSQL tests and 85 affected lifecycle/admission/binding tests pass. Coverage includes durable replay after restart, both pool transaction modes, mounted admission/materialization/exact reads, and in-flight revocation/remapping followed by restoration. Independent db56 review found no blockers at583efd49and passed all 11 focused tests against PostgreSQL. Current-head hosted CI passed all 50 executable checks, including Python 3.12 coverage and installed PostgreSQL lanes; the draft-only code review was skipped.The prior local full run passed 12,059 tests but three child interpreters loaded an older shared editable install; all three passed in the branch virtualenv. A current-head
make testrerun in a virtualenv verified to import this checkout reached 922 passed / 850 skipped with no failures, then was stopped as the shared disk fell below 0.5 GiB during distribution packaging. Generated files were cleaned. Hosted CI supplies the complete current-head full-suite result.Addresses the factory gap in #1172. The lifecycle/failure-point kit is separate in #1232. Rebased onto merged rc.7 adoption #1229 at 4756715; all seven contributed file blobs are unchanged. The branch is ready for the current-head formal review; its contributed files are unchanged from the independent technical review.
Upgrade note:
ReliableReportingService.postgres()now bootstraps PostgreSQL staging and seal tables atinitialize()even whenproductionis not enabled. Existing deployments must grant the borrowed pool's startup role permission to runreporting_inline_storage.sqlbefore adopting this version; DDL-restricted roles need an updated startup grant or deployment sequence. This is an intentional durable-default change. Commit7f5ca415also adds the two new production types to the package's__all__/dir()exports.Post-review validation on
7f5ca415:make lint,make typecheck-all, publicdir()andimport *checks, and the focused factory test (4 passed; 7 PostgreSQL cases skipped because the local test environment has no PostgreSQL URL) passed. The full hosted CI rerun is pending on this head.