Skip to content

Migrate retained Entity digest baselines to schema v2 - #2875

Merged
benhook1013 merged 6 commits into
codex/entity-digest-v2-catchupfrom
codex/entity-digest-v1-baseline-migration
Sep 26, 2026
Merged

benhook1013 merged 6 commits into
codex/entity-digest-v2-catchupfrom
codex/entity-digest-v1-baseline-migration

Conversation

@benhook1013

@benhook1013 benhook1013 commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Superseded by #2872 at bc50b3196af1407737ad6d628804c3ee7ff1ddb7. All six #2875 migration commits and all 32 unique path blobs are retained in #2872, leaving no independent patch. GitHub automatically marked this PR merged when its head became an ancestor; no PR merge operation was invoked. This branch is retained for audit. The reader-before-writer rollout and live migration gate still apply.

Topology and scope

Draft child of #2872 (codex/entity-digest-v2-catchup) at exact parent 1e3f4d8cca15dd4f293898510330f251d70e103c. Current child head: af5e197dfd8b62701afd82fb612c7ad6a8d20303. Unique diff: 32 files. #2873 is a separate sibling and must reconcile behind this published child before review intake; it was not edited here.

Implements the historical Entity full-version digest baseline schema-v1→schema-v2 migration as a protected, disabled-by-default one-shot Game Design Job. It enumerates bounded retained v1 rows, preflights an exact tenant/version scope, binds a stable operation and complete expected-old tuple, obtains exact Entity v2 digest evidence, and performs a compare-and-swap baseline update plus immutable before/after audit in one Game Design transaction. Success and uncertain-write recovery require exact persisted audit and baseline readback. The live row retains original and last real publish-workflow provenance; the audit separately records migration actor, workload, operation, and time. No public operator route or cross-service database mutation is introduced.

The Job uses a dedicated service account with zero Kubernetes API verbs, no shared JWT key, an immutable image digest, narrow egress, and a client certificate admitted only for the internal Entity digest RPC. The opt-in certificate writer issues a URI-only clientAuth leaf under the internal CA; admission allows exactly this ephemeral runtime identity without adding a permanent hosted-controller consumer. Secret-read verification is separate from the certificate writer and checks the namespace trust bundle. Missing identity/projection or wrong scope fails closed.

Rollout and live gate

Maintain an explicit fail-closed publication window for affected v1 scopes. Deploy the Game Design reader/reconciler first, then Entity v2 writer, then issue/verify the dedicated migrator identity and run exact scoped enumeration, preflight, migration, and database readback. Reopen publication only after all affected scopes have verified v2 evidence or a recorded scoped no-data boundary. Retire the Job, Certificate, and Secret afterward. Never compare v1 and v2 digests as the same schema. The synthetic version:<id> applied-commit remediation remains separate.

No retained live v1 row inventory or no-data query has yet been executed. No live issuance/bootstrap, served Entity mTLS acceptance, retained-row PostgreSQL readback, publication-window, or identity-retirement proof is claimed. Synthetic PostgreSQL migration/readback is proven in CI. The five PostgreSQL Testcontainers integration cases compiled but all skipped locally because Docker is unavailable. The new case asserts that a seeded baseline returns a generated ID and is exactly readable from PostgreSQL.

Validation and review

  • Local: focused common identity/guard, Entity config, and Game Design migration unit tests pass; Game Design migration suite now has 17 passing unit cases. Affected :common-platform-core:check, :common-security:check, :entity-management-service:check, and corrected :game-design-service:check passed with -PfullCheck; Game Design boot JAR builds with runner and V29 migration included.
  • Local deployment/docs: Helm migration render contract; trust-bootstrap issuance, hosted-identity admission, standalone certificate-helper contracts; ShellCheck; full Helm validation; Markdown lint/link check; and diff hygiene pass. Wrong URI and wrong CA are rejected in helper proof.
  • Baseline and audit readback corrections at af5e197df: explicitly return generated IDs, require database readback, and normalize PostgreSQL timestamp fields. CI 36221110601 removed the original null but exposed baseline timestamps; CI 36221633455 passed baseline seeding and exposed audit timestamps. Current-head CI 36221988201 passed the Game Design full-check/integration job, including all five PostgreSQL baseline cases. The overall run is red on unrelated Python import lint, a preview/dev-tool contract, and seven Friends cross-service cases owned by Constrain gameplay presence roles and redact legacy friend views #2858; Validation Gate reflects those failures. Local :game-design-service:check -PfullCheck passes.
  • Exact-head stacked CI: Preview Plan, submit-gradle, and validate-overlays pass. These are not a live DB/certificate migration proof or a full develop-target Validation campaign.
  • Independent read-only reviews: first whole-boundary pass found one P2 publish-provenance defect, fixed in 5a68415d7 with production/readback/unit/integration changes. The final updated-head whole-boundary pass found zero actionable defects. No Hosted or CLI CodeRabbit was requested.

FireMUD LOC impact

Compared 1e3f4d8cca15 → af5e197dfd8b (PR merge-base → head).
PR scope: 32 changed files · 3,808 added textual lines / 26 deleted textual lines.

Section Base LOC Head LOC Δ LOC Change
Overall 578,996 582,505 +3,509 +0.6%
 Source 497,651 500,720 +3,069 +0.6%
  ↳ Code 226,668 228,114 +1,446 +0.6%
  ↳ Tests 270,983 272,606 +1,623 +0.6%
 Markdown 53,396 53,409 +13 +<0.1%
 Design 56,159 56,172 +13 +<0.1%
  ↳ Architecture 44,673 44,681 +8 +<0.1%
  ↳ Project management 5,292 5,297 +5 +0.1%
  ↳ Observability 2,147 2,147 0 0.0%
  ↳ Operator runbooks 579 579 0 0.0%
  ↳ gRPC API documentation 2,023 2,023 0 0.0%
  ↳ Product requirements and user journeys 926 926 0 0.0%
  ↳ Developer workflows 440 440 0 0.0%
  ↳ Other design 79 79 0 0.0%

Rows are hierarchical and overlapping views; do not add them together.
LOC means cloc code lines; blank and comment-only lines are excluded.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 88552b1f-711e-4d95-b232-06c1f6bdb40c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@benhook1013

Copy link
Copy Markdown
Owner Author

Composed #2873 exact-head CI run 36216715980 executes the #2875 Game Design integration suite and reports four EntityDigestBaselineMigrationIntegrationTest NPEs (lines 131, 229, and 333). All occur while using the baseline seeded by RecordedParticipantDigestRepository.save, before the intended migration assertions. That insert uses .returning().fetchOne() on an ad-hoc jOOQ table; a missing/null generated ID is the leading hypothesis, not yet confirmed from test XML. Please make the saved baseline/ID readback explicit, add a fixture assertion, and rerun the focused PostgreSQL cases in #2875. I have not changed the #2875 repository/test in #2873; this is an owning-parent CI handoff.

@benhook1013
benhook1013 merged commit bc50b31 into codex/entity-digest-v2-catchup Sep 26, 2026
58 of 62 checks passed
@benhook1013
benhook1013 had a problem deploying to trusted-hosted-cluster September 26, 2026 15:07 — with GitHub Actions Failure

This branch had an error being deployed

1 failed deployment
trusted-hosted-cluster — af5e197d Deployed Sep 26, 2026 by benhook1013 via Delete Preview Runtime #1579
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