Skip to content

feat(jobstore): A1 gate, pipeline goldens byte-identical on PostgresStore; jsonb codec - #22488

Merged
Git-on-my-level merged 22 commits into
integration/legacy-retirefrom
lr/12-a1
Oct 19, 2026
Merged

Git-on-my-level merged 22 commits into
integration/legacy-retirefrom
lr/12-a1

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

A1 gate for the Postgres job store: the pipeline characterization goldens are byte-identical when the simulator runs on the real PostgresStore (testing/pipeline_sim/postgres_store.py, tests/integration/test_pipeline_goldens_postgres.py). The run found that batch documents carry datetime (and potentially bytes) values jsonb cannot store; database/jobstore/codec.py tags and restores them ($datetime, $bytes), wired through connection.configure. #22447 has merged, and integration is merged in, so this diff is the A1 slice only.

Lane / contract

Lane 12, A1 (plan A section 4). No other lane's files.

Product invariants affected

INV-DATA-1: path match only (integration merge). This change does not alter the Firebase/Firestore project, the serving endpoints, or artifact routing; the Postgres store is unselected in every deployed service.

Verification

  • Local m5, Postgres 16.2: the 8 goldens are byte-identical on PostgresStore, and the codec + hermetic-network unit tests pass after the integration merge.
  • Earlier: store+outbox conformance on sim+emulator+postgres, 137 passed.
  • Staging Cloud SQL goldens: re-running from this head (the first staging run used eb227b0, which predates the metadata-hostname allowance now on integration).

Rollback

Revert. The store is unselected in production.

Failure-Class: none

Git-on-my-level and others added 22 commits October 19, 2026 13:19
…end Store conformance

Adds database/jobstore (connection pool capped at 4, expand-only versioned
migrations with checksum + advisory lock, PostgresStore over the batch Store
protocol, SERIALIZABLE with bounded retry), testing/store_fixtures.py (the
store_backend fixture over sim, Firestore emulator and Postgres, local PG16
on a private unix socket) and tests/integration/test_store_conformance.py.
Postgres in CI needs an unnamed .github change (S6), so the postgres
parameter skips in GitHub CI and is proven locally.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…he modules reachable

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…sor, validation, conversation writes and projection scan

Closes the four gaps the Store conformance suite had strict-xfailed.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…uite on sim, Postgres and emulator

The outbox owns wake creation (defer, not-due claim_key -> DEFERRED), wake(row_id, wake_token)
is idempotent, wake_pending (migration 0003) makes a failed task create sweep-retryable.
The emulator leg skips until lane 9's Firestore outbox is wired into build_outbox_backend.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…t ignore to its imports

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… connector and operator entry

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nst Cloud SQL with IAM auth

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…endpoint only under OMI_TEST_POSTGRES_IAM

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ostgresStore; jsonb codec for datetime and bytes

PgSimStore runs the simulator through the real PostgresStore. The first run found that batch documents
carry datetime values jsonb could not store; the codec tags and restores datetime and bytes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…B8) (#22470)

* feat(backend): main.py mounts routers through the OMI_ROLE role map (B8)

main.py's 110-line include block becomes one mount_routers(app, role, globals())
call; app_roles.ROUTER_MOUNTS is the route table (same order, default role
all, so behaviour-neutral). Router imports stay static for the image closure
and import-time checks. An unknown OMI_ROLE fails startup.

check_duplicate_routes.py resolves role-map mounts so it does not silently pass
on an empty main app (it still reports the one load-bearing duplicate). The
census test adds router-import == role-map equality; the api-key and support
harness tests assert role-map membership instead of include_router text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(backend): the role map owns the router imports (pyright-clean main.py)

Mount rows hold router modules directly, so app_roles imports every router once
(static, same order, after main.py's env/credential setup) and main.py imports
only the mount entrypoint plus messaging. Typecheck: 0 errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(backend): role-map membership checks read app_roles.py statically (fast-unit guard)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(backend): router registration tests read ROUTER_MOUNTS rows structurally

main.py mounts through the B8 role map, so client_telemetry and memory_product
registration is asserted as an AST Mount(...) row in app_roles.py (an import
would load every router, too slow for the fast-unit guard).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(backend): allowlist the product-search endpoint test against the m5 fast-unit CPU limit

test_product_memory_router.py::test_product_search_endpoint_keeps_expired_unadjudicated_short_term_and_excludes_archive
is unchanged by this branch. On m5 it measured 0.37-0.47s CPU against the 0.30s
fast-unit fail limit (load average 35-50), including 0.37s for the unchanged
integration version of the file, so it sits at the limit rather than having
regressed. The local pre-push gate selects the file only because the router
registration test in it moved to the B8 role map. CI still runs the test; the
allowlist is the documented exception mechanism (approved by the lead).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…lr/12-a1

# Conflicts:
#	backend/testing/hermetic_network.py
#	backend/tests/unit/test_hermetic_network_cloudsql.py
…ted; Pool alone applies the jsonb codec

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level marked this pull request as ready for review October 19, 2026 13:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T13:48:51.661952Z 0922cfb Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Git-on-my-level
Git-on-my-level merged commit af3d114 into integration/legacy-retire Oct 19, 2026
26 checks passed
@Git-on-my-level
Git-on-my-level deleted the lr/12-a1 branch October 19, 2026 14:11
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.

1 participant