Repository navigation
Rotation thresholds: settings table, GET and catalog:write-gated PATCH - #3047
Merged
Merged
Conversation
Schema constraint shape reportno new constraints detected in this diff (uniqueIndex, .unique(), SET NOT NULL, CHECK, FK) |
…le-row rotation_thresholds table Adds the station-wide rotation thresholds table (schema and mock double), a validator that is partial at both levels and rejects explicit nulls, unknown keys and day counts outside 1..365, a one-UPDATE service, the two catalog-gated routes registered ahead of the templated rotation routes, and unit and integration coverage.
…ead lint directives and repeated prose, and tighten the route-order and integration tests
jakebromberg
force-pushed
the
feature/issue-2733-rotation-thresholds
branch
from
October 8, 2026 00:20
2b7e0d5 to
8aabdad
Compare
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.
Closes #2733
Adds the station-wide rotation thresholds: a single-row
rotation_thresholdstable (sameid boolean+CHECK (id = true)shape aslibrary_watermark),GET /library/rotation/thresholds(catalog: read) andPATCH /library/rotation/thresholds(catalog: write). Wire types are hand-declared field-for-field with the contract (RotationThresholds,UpdateRotationThresholdsRequest); the@wxyc/sharedpin is untouched.Behaviour
{}and{"window_days": {}}are 200 no-ops that return the current record; the response is always the whole record after the write.nullat either level and an unknown key at either level are 400s naming the key. Bin keys are matched exactly againstROTATION_BINS(notparseRotationBin), so"h"and" H"are rejected.UPDATEof only the supplied columns, no read-modify-write. The DB carries only a>= 1floor so the 365 ceiling can be raised without a migration./rotation/thresholdsis registered above bothGET /rotation/:idandPATCH /rotation/:id; the route-order test gains the literal, a PATCH-arm vacuity guard and dispatch assertions, and the two route comments that said "two literals" / "no literal PATCH exists" are reworded.Migration
0190_rotation-thresholdsis a generatedCREATE TABLEwith the seed (INSERT ... ON CONFLICT DO NOTHING, H/M/L/S = 60,card_stale_days= 30) appended in the same file, following the0084/0104precedent. Migration artifacts (sql, snapshot, journal, applied-hashes) are in their own commit. The number is provisional: a sibling PR also adds a migration, so whichever merges second regenerates after rebasing.This PR carries a migration that auto-deploys to production on merge. Not for auto-merge; after merging, confirm the
deploy-auto.ymlrun succeeded.Verification
typecheck,lint,format:check,test:unit(665 suites),lint:migrations,check:db-mock-sync,check:sql-claim-docs,check:auth-tables-doc, the bulk-update, precondition-guard, cross-cache-flag, legacy-entry-id and LML-caller-classification checks all pass locally.rotation-thresholds.spec.js(defaults, partial update, no-ops, 400 table, re-running the seed leaves an edited row alone).AUTH_BYPASS).Size
About 190 added lines of production source including doc comments (roughly 110 of them code); the budget estimate was ~90. Most of the overage is the schema and validator docblocks and the route-order comments.