Repository navigation
guard test: a stale Moment doesn't guard a write - #52
Merged
jallers merged 1 commit intoNov 11, 2026
Merged
Conversation
guard.ts says a Moment guard guards nothing, but test/integration/ guard.test.ts had only shown it for a query. The new live test covers a write, on its own throwaway Story: - An update filtered on a stale Moment (as a literal) previews as one command, and when sent it applies, overwriting the change made in between. - For contrast, the same update filtered on the stale ChangeDate literal, which is what guard.ts sends, previews as nothing and applies nothing. This pins the behaviour so the guard isn't switched to Moment later. guard.ts's comment now cites the write case. Found while checking the Agility MCP write-safety proposal; results are on #51. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj8mSZ8LrMj16R2cozL
Merged
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.
Adds the write-side check suggested on #51.
src/services/guard.tssays "a Moment guard guards nothing", buttest/integration/guard.test.tshad only shown it for a query. This pins it for a write, so the guard isn't switched toMomentlater.Changes
test/integration/guard.test.ts, "why not Moment, on a write". It uses its own throwaway Story, so it doesn't depend on test order:Moment(as a literal) previews as 1 command, and when sent it applies, overwriting the change made in between;ChangeDateliteral, which is whatguard.tssends, previews as[]and applies nothing.guard.ts: its comment now cites the write case and guard: research an exact stamp for the compare-and-set (Moment, ChangeDateUTC, or a moment-qualified OID) #51. The test file's header now says Moment fails as a guard "for a query or for a write".No source behaviour changes.
Testing
npm run test:integration -- test/integration/guard.test.ts→ 4 passed. The test's Story is deleted in the existingafterAll.npm run verify: typecheck, build, and 127 unit tests pass.Context: the Agility MCP write-safety proposal had treated a
Momentfilter as a compare-and-set. The live results on #51 show it isn't, and the proposal is being corrected to guard on aChangeDateliteral, with an exactexpectedMomentprecondition proposed for Core.Generated by Claude Code