Skip to content

feat(reporting-storage): let the Postgres service factory build a subclass - #1589

Merged
bokelley merged 2 commits into
mainfrom
bokelley/storage-service-class
Oct 24, 2026
Merged

bokelley merged 2 commits into
mainfrom
bokelley/storage-service-class

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Fixes #1588.

postgres_reliable_reporting_service(...), which replaced ReliableReportingService.postgres(...) in 9.0.0 (#1557), always constructed the base ReliableReportingService, while SubClass.memory(...) builds the subclass. Hosts override the installed tool methods (get_reporting_status, sync_reporting_status, get_revision_content) on a subclass. Without this, the Embedded Sales Agent copies the factory body, and that copy drifts when the factory gains a store.

  • New keyword: service_class: type[ReliableReportingService] | None = None.
  • Overloads type the result: service_class=HostReportingService returns HostReportingService; the default returns ReliableReportingService.
  • Tests: the default returns the base class, and service_class matches memory() (fails without the fix). New adopter type-check fixture tests/type_checks/reporting_storage_service_class.py, clean under mypy --strict and pyright.

Merge with rebase, not squash. The first commit touches only packages/adcp-reporting-storage/, so it releases only the storage package (0.1.0b1 is already on PyPI; this goes in 0.1.0b2). The second is a tests-only test: commit. A squashed commit touching both trees would count for both components, and a feat would propose adcp 9.1.0.

🤖 Generated with Claude Code

bokelley and others added 2 commits October 24, 2026 21:40
…class

postgres_reliable_reporting_service always constructed the base
ReliableReportingService, while ReliableReportingService.memory builds
cls. Hosts override the installed tool methods on a subclass, so the
Embedded Sales Agent had to copy the factory body to keep its subclass.
Add a service_class keyword, typed so the call returns the subclass.

Fixes #1588

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean, additive PR with no blocking or medium findings.

Checked: adds a service_class keyword to postgres_reliable_reporting_service so hosts build a ReliableReportingService subclass through the factory (cls(...)) rather than copying its composition body, mirroring the existing memory() classmethod pattern. Overloads type the subclass/default return paths correctly and are covered by both a runtime test and a mypy/pyright type-check fixture. Correct feat(reporting-storage) semver for a non-breaking addition; no wire shape, generated types, credentials, or operational paths touched.

Decision-table walk: no critical/high findings (row 1 n/a); gated_paths is false (row 2 n/a); high_risk false (rows 3/5 n/a); no medium findings (rows 4/8 n/a); no no-auto-approve team match (row 7 n/a); no prior decision (row 6 n/a). Falls through to row 9 → approve. Note review_decision is REVIEW_REQUIRED, but row 2 only gates when gated_paths is true, which it is not here.

production: ReportingProductionOptions | None = ...,
service_class: None = ...,
**kwargs: Any,
) -> ReliableReportingService: ...
production: ReportingProductionOptions | None = ...,
service_class: type[_ServiceT],
**kwargs: Any,
) -> _ServiceT: ...
@bokelley
bokelley merged commit a9cfd0c into main Oct 24, 2026
47 checks passed
@bokelley
bokelley deleted the bokelley/storage-service-class branch October 24, 2026 22:24
bokelley added a commit that referenced this pull request Oct 25, 2026
…st (#1601)

The IPR push policy maps every main commit to the PR whose merge commit
it is. #1589 and #1595 were rebase-merged, so their first commits match
no PR and main's IPR check has failed since. List those two exact
commits with their PR numbers; authorship is still checked. Document
squash-only merges in the releasing guide.

#1591's test expected ext={'note': None} to dump as {} by default, but
#1600 deliberately keeps nulls inside opaque ext and context objects.
Expect the null.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

postgres_reliable_reporting_service always builds the base ReliableReportingService, so adopters can't use a subclass

1 participant