feat(static-loader): retire stale Sections safely#476
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
life-ustc | af33a8e | Commit Preview URL Branch Preview URL |
Jul 17 2026, 09:19 PM |
This was referenced Jul 17, 2026
|
E2E HTML report is ready: https://life-ustc.github.io/e2e-snapshot-artifacts/reports/29614225174/index.html |
…ifecycle # Conflicts: # src/static-loader/import.ts
…nto agent/stale-section-lifecycle # Conflicts: # tests/unit/static-loader-validation.test.ts
tiankaima
marked this pull request as ready for review
July 17, 2026 21:47
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 17, 2026
# [1.62.0](v1.61.2...v1.62.0) (2026-07-17) ### Features * **static-loader:** retire stale Sections safely ([#476](#476)) ([3928bf1](3928bf1))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
Rollout authorized on 2026-07-18 without waiting for #471; recovery risk is explicitly accepted for this rollout.
Scheduled Static Sync keeps retirement disabled. Enabling retirement requires a manual run with the exact downloaded snapshot SHA-256 and exact expected candidate count.
Problem
Production has 132 Section rows in the four synchronized semesters that are absent from the latest complete snapshot. Hard deletion or heuristic jwId remapping is unsafe because these rows may own subscriptions and user-generated history.
Changes
sourceLastSeenAt/retiredAtStaticImportStategenerated-at/SHA watermark under the import advisory lock; older or same-time/different-content snapshots fail before model writesgenerated_at, a 15-minute maximum future skew, and whole-import recencyThe separate empty-source SectionTeacher reconciliation bug was fixed and released independently by #478 so it is not held behind this rollout gate.
Verification
Deployment boundary
The expand-only Section lifecycle storage migration from #473 was applied by scheduled Static Sync run 29606298861 before cancellation; its
Load static snapshotstep was skipped, so no lifecycle/backfill/retirement data write ran. DB Migrate Deploy run 29606395044 then confirmed no pending migrations. #475 restored exact Prisma schema parity and released in v1.61.1.This PR additionally contains an additive
StaticImportStatetable migration. It has not yet been merged or applied. After an approved rollout, ordinary/scheduled writes intentionally fail closed until a manual dry run and exact-SHA bootstrap establish the first watermark.#474 added repository-side recovery tooling, but it does not prove the provider, retention/PITR window, RPO/RTO, or an isolated restore. The owner explicitly authorized this rollout without waiting for #471; #471 remains open because those recovery criteria are still unmet.
Refs #468
Recovery follow-up: #471