Repository navigation
FRM-17: summarize timing and guard response completion - #38
Merged
Merged
Conversation
Store the reached timing total in the completion batch and guard its pruning against a database-managed answer revision. Keep timing repair for older completions and retry when a concurrent save changes which questions the response reaches.
Member
Author
|
recheck |
Contributor
There was a problem hiding this comment.
Independent exact-head review of ceb5dd47dd72d8d06a8ff486b1c0ea4c468379ac.
I find no blocking issue.
- Migration order is additive and rollout-safe as written:
0015only addsresponse.answer_revisionwith a default, then0016adds database triggers. A previous Worker can keep writing through the column addition, and once the triggers exist its answer inserts/updates advance the revision even though that Worker does not know the column. Position-only writes and already-applied marked saves do not writeanswer, so they do not advance the revision. - Completion uses the revision read before answer evaluation as a conditional guard in every completion statement. A concurrent save therefore invalidates deletion of unreached answers and the completion update together, and the bounded retry recomputes required/unreached answers from the newer rows instead of completing from stale state.
- The reached active-time total is calculated in the same final completion statement after the conditional unreached-row deletes in the same batch, so the stored summary matches the answers that remain reached. Completed rows cannot receive further answer writes, which also makes the bounded null-summary repair stable.
- The synthetic regression coverage is strong: it exercises a save winning just before completion, a branch opening with required and optional follow-ups, a previous-Worker write winning during rollout, persistent concurrent saves, save retry/position-only revision stability, withdrawal winning, duplicate completion, and median/backfill behavior.
I independently ran the focused suites at this tree: 56/56 passed. I also ran full pnpm verify: exit 0, including 517/517 web tests, 87/87 schema, 48/48 results and 58/58 tally-import tests plus the build. Hosted check, e2e, changes, cla and Devin Review are green at this head.
One coordination caveat, already in the PR body and not a defect of this diff: if draft #28 lands first with its own migration 0015, this branch must regenerate its migrations before landing. No merge, deployment or production action performed.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What and why
Persist the reached active-time total in the same batch that completes a response and deletes unreached answers. Completed responses have a timing summary immediately. Older rows with a null summary keep the bounded repair path.
Guard each completion write with the answer revision read before validation. If a save wins, recompute reach and required answers before retrying. Database triggers advance the revision on answer writes from both Worker versions during rollout. Position-only updates and duplicate saves keep the revision stable.
FRM-17
How it was tested
pnpm verifypassed all 721 tests and the build on the final head. Hosted CI check passed.pnpm test:e2epassed 174 Chromium tests with eight existing skips. CI runDeploy notes
0015_answer_revision.sqland0016_answer_revision_triggers.sqlbefore the new Worker. The timing repair remains available for existing completed rows.0015. The branch that lands second must regenerate its migrations against the updatedmain.