Repository navigation
TimeGate waits for the commit of a document's latest change - #511
Merged
Merged
Conversation
Versions are committed after the write that made them, and the write's response names none, so right after a write the TimeGate redirected to the version before it. GraphVersioningService now counts a document's queued and running commits and remembers whether its last one failed. While one is pending the TimeGate answers 503 with Retry-After; after a failed one, 500. Writes, every other response, and dataspaces without versioning are unchanged. ldh get --timemap/--timegate follow the Link the document advertises, falling back to the query parameters, and --timegate waits as the 503 asks. The Lean model gains failed reconciles and the TimeGate's answer, with timeGate_current: a redirect without a datetime is always to the document's graph. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Commits are made one at a time per repository branch, about a second each: after a bulk write a document's commit can wait behind dozens of others, longer than a flat one-second Retry-After times a client's attempts. Retry-After is now a second per commit queued on the branch, at most a minute (GraphVersioningService.getCommitBacklog), and ldh get --timegate asks up to 120 times. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
A version is committed after the write that made it (
VersioningFilter→commitAsync, queued per branch), and the write's response names no version. Right after a write the TimeGate therefore redirected to the version before it. A client that needs the version equal to the state it read, such as an approval that pins a version, had to poll the TimeMap and compare graphs. It also could not tell "not committed yet" from "commit failed" (failures are only logged).Change
GraphVersioningServicecounts each document's queued and running commits (isCommitPending) and remembers whether its last commit failed (isCommitFailed, cleared by a later success). The failure is recorded before the commit stops counting as pending.?timegate) answers503withRetry-After: 1(no-store) while a commit is pending, and500when the last one failed. Otherwise it redirects as before.VersioningFilterschedules nothing for them, so?timegatestays404).ldh get --timemap/--timegatefollow the document'sLink(rel="timemap"/"timegate"), falling back to the query parameters.--timegatewaits as a503withRetry-Afterasks, up to 30 tries; a 503 withoutRetry-Afterfails as before.formal/http/LdhHttp/Memento.lean):reconcileFails,Versioning.timeGate, andtimeGate_current, which proves that a redirect without a datetime is always to the document's graph, never an older version.Synchronous commits were considered and not taken: they would add a GitHub commit to every write and serialise bulk loads.
Tests
GraphVersioningServiceTest: pending until the commit ends; failure kept until a later success; an unversioned application has no commit state. 591 unit tests pass.CommandOutputTest: Link discovery for both roles; a 503 withRetry-Afteris asked again; a 503 without it fails. 120 tests pass.versioning/GET-timegate-after-write.sh: after a write, the TimeGate waits or redirects to the new commit, never the previous one.versioning/GET-timegate-unversioned.sh: the unversioned admin dataspace still answers404, with noRetry-After.GET-timegate.shandmemento-conformance.shwait out the brief window between GitHub recording a commit and the service ending it.lake buildofformal/httppasses.🤖 Generated with Claude Code