docs: strengthen live polling URL progression invariant in SPEC.md#4060
Open
KyleAMathews wants to merge 1 commit intomainfrom
Open
docs: strengthen live polling URL progression invariant in SPEC.md#4060KyleAMathews wants to merge 1 commit intomainfrom
KyleAMathews wants to merge 1 commit intomainfrom
Conversation
… polling The loop-back URL progression invariant previously exempted live requests, treating repeated same-URL polls as intentional. This was incorrect — the server always advances `electric-cursor`, so each live poll should produce a new URL. Repeated live URLs indicate broken cursor propagation. Updated SPEC.md to: - Extend the invariant to cover both non-live and live requests - Document cursor progression as the live-request guard mechanism - Reclassify "live polling same URL" from Risk: None to Risk: High Also added CLAUDE.md guidance to always read SPEC.md before modifying the TypeScript client. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4060 +/- ##
=======================================
Coverage 88.67% 88.67%
=======================================
Files 25 25
Lines 2438 2438
Branches 615 609 -6
=======================================
Hits 2162 2162
Misses 274 274
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
commit: |
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.
Summary
The SPEC.md loop-back URL progression invariant previously exempted live requests, treating repeated same-URL polls as "Risk: None." This was wrong — the server always advances
electric-cursoron every response, so each live poll must produce a new URL. Repeated live URLs indicate broken cursor propagation and are now classified as Risk: High.This came out of investigating a user report where an Electron app stopped receiving live updates for ~40 minutes despite the server being healthy. Clearing localStorage recovered it. We haven't pinpointed the exact failure mode yet, but tightening the spec to reflect the actual protocol contract is the right first step.
Approach
Documentation-only change. Updated the "Client Fetch Loop Paths" section of SPEC.md:
Live cursor progressionas a formal guard alongside#checkFastLoop.Risk: NonetoRisk: Highwith updated notes.Also added a
CLAUDE.mdentry requiring SPEC.md to be read before modifying the TypeScript client.Non-goals
This PR doesn't add a client-side guard for stalled cursors — it documents that the gap exists and is high risk. A follow-up should add detection/recovery when the cursor doesn't advance (analogous to
#checkFastLoopfor non-live requests).Verification
No code changes — review the diff in
packages/typescript-client/SPEC.mdfor accuracy against the protocol.Files changed
CLAUDE.md— Added guidance to read SPEC.md before touching the TypeScript clientpackages/typescript-client/SPEC.md— Strengthened loop-back URL progression invariant for live polling; reclassified coverage gap risk🤖 Generated with Claude Code