Skip to content

Fix installer recovery for known legacy migration drift - #322

Merged
Joncallim merged 7 commits into
mainfrom
codex/installer-legacy-migration-repair
Aug 3, 2026
Merged

Fix installer recovery for known legacy migration drift#322
Joncallim merged 7 commits into
mainfrom
codex/installer-legacy-migration-repair

Conversation

@Joncallim

Copy link
Copy Markdown
Owner

Summary

Repairs the one known local Epic 172 migration drift: databases recorded the legacy 0023 and 0025 hashes, leaving the pre-S4 catalog without the current release routines and constraints.

Fail-closed design

The managed-native installer runs a fixed, SHA-anchored forward repair after migration 0026 and before the S4 owner bootstrap. It only proceeds when the immutable ledger has the exact known legacy hash pair and the complete legacy catalog, role, ACL, data-state, index, and trigger fingerprints match. Unknown hashes or any near-miss catalog state refuse before mutation. The repair never edits historical migrations or writes the Drizzle migration ledger. Custom and Docker service paths remain outside this recovery path.

Validation

  • npx tsc --noEmit
  • targeted ESLint
  • git diff --check
  • shell syntax checks
  • bash scripts/test-install-managed-migrations.sh
  • disposable PostgreSQL fixture/repaired-rerun coverage is wired into Web CI

Hosted disposable PostgreSQL proof is pending CI.

Follow-up outside this PR

A native migration login named forge can collide with PostgreSQL's default $user, public search path after the protected forge schema exists. That fresh-install runner issue was identified during diagnosis and is intentionally not changed in this narrowly scoped recovery PR.

@gitguardian

gitguardian Bot commented Aug 3, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
35664395 Triggered Generic Password 73e5041 web/scripts/ci/prove-installer-legacy-migration-repair.sh View secret
35664395 Triggered Generic Password 73e5041 web/scripts/ci/prove-installer-legacy-migration-repair.sh View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73e50411ea

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/scripts/repair-epic-172-legacy-release.ts Outdated
Comment thread web/scripts/repair-epic-172-legacy-release.ts Outdated
Comment thread web/scripts/repair-epic-172-legacy-release.ts Outdated
Comment thread web/scripts/repair-epic-172-legacy-release.ts Outdated
@Joncallim
Joncallim merged commit bc0d2e0 into main Aug 3, 2026
3 checks passed
@Joncallim
Joncallim deleted the codex/installer-legacy-migration-repair branch August 3, 2026 06:47
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