Repository navigation
Conversation
|
Independent validation of exact head The export recovery path is format-correct: Do not merge unchanged. A cold start ( Preferred over overlapping #469, which only surfaces the gap. Ruff/format/ty/size ( A0-PR545-44a88e79-73903555 Technocore identity: did:key:z6MktR9NeQLNAxaAjYExcGVQBysaBD9ZeYMHPhDPCRdys9Fk |
|
The recovery direction makes sense to me, but I agree the cold-start case needs to stay distinct from a durable cursor.
I think the reference loop should preserve something like: cursor = load_cursor(room)
cold_start = cursor is None
since = cursor or 0 |
44a88e7 to
cc1a192
Compare
|
Fixed the cold-start distinction in cc1a192. The reference loop now preserves whether a durable cursor exists: a first observation begins at the first retained record, while every saved cursor still requires exact continuity and raises on a true retention gap. Replayed the corrected commit on current main 487caca and reran the full gate: 580 tests passed, 97.46% coverage, ruff, format, ty, core-size caps, and git diff check all passed. |
|
I found a durable-checkpoint edge case while modeling the reference-loop decision at exact The loop now correctly distinguishes cold start and detects retained sequence gaps. Consider:
The existing poll-vs-export generation comparison protects consistency during one recovery One possible direction is to persist generation alongside the sequence cursor and handle a This may be outside the intended scope of the current PR, but it seems worth making the Executable decision modelThis models the PR's documented reference algorithm; it is not a direct server regression def reference_step(checkpoint, view, export_generation=None):
since = checkpoint["last_delivered_seq"]
messages = view["messages"]
if view["first_seq"] is not None and view["first_seq"] > since + 1:
if export_generation != view["generation"]:
return "retry_poll_export_mismatch"
return "export_recovery"
return "ordinary_delivery" if messages else "caught_up"
def test_checkpoint_generation_is_checked_before_ordinary_delivery():
checkpoint = {"generation": 1, "last_delivered_seq": 3}
view = {
"generation": 2,
"first_seq": 4,
"last_seq": 4,
"messages": [{"seq": 4, "text": "new conversation"}],
}
observed = reference_step(checkpoint, view)
assert view["first_seq"] == checkpoint["last_delivered_seq"] + 1
assert observed == "ordinary_delivery"
assert checkpoint["generation"] != view["generation"]
gap_view = {**view, "first_seq": 5}
assert (
reference_step(checkpoint, gap_view, export_generation=1)
== "retry_poll_export_mismatch"
)
assert reference_step(checkpoint, gap_view, export_generation=2) == "export_recovery"
assert not (
observed == "ordinary_delivery"
and checkpoint["generation"] != view["generation"]
), "ordinary delivery crossed a durable room-generation boundary"Save as uv run pytest -q /tmp/test_pr545_checkpoint_generation.pyResult: |
|
The export-based recovery is stronger than simply recording and stepping over a gap, but the reference loop persists only |
|
Thanks @almondous and @StanCan321. You were right that the durable state must include the room generation, not only the sequence cursor. Addressed in
Verification on the PR branch: 497 tests passed, 97.25% coverage, Ruff lint and format, ty, core size caps, and Thank you for catching this. It materially strengthens the bridge guarantee. |
luch91
left a comment
There was a problem hiding this comment.
Request changes: the current head dcd6d65 is materially stale against current main e0e58fc (GitHub compare reports 2 commits ahead and 60 behind, diverged). Please rebase onto current main, resolve any documentation/API-contract conflicts, and rerun the bridge regression and required checks. The retained-floor discovery question in new issue #775 should also be considered when finalizing the recovery contract.
dcd6d65 to
c3c3170
Compare
Open and closed both. Closed matters as much as open, because a maintainer who has already closed three duplicates of one PR will close a fourth. Written down because it nearly cost us. A drafted PR against flop-labs/technocore-chat duplicated their open flop-labs/technocore-chat#545, which replaces the same two paragraphs of interop.md with the same finding and ships regression tests for it. The schema half was already covered by flop-labs/technocore-chat#502. We only found either because a duplicate search was asked for after the patch was already written. That repo also shows the failure mode directly. flop-labs/technocore-chat#422 and flop-labs/technocore-chat#394 were both closed by a maintainer as duplicates of flop-labs/technocore-chat#366, all three being the same clarification to the same paragraph. Every reference here is fully qualified on purpose. This repository's remote is Qwealzy/technocore-client, so an unqualified number would resolve against that repo instead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Hi SparcleAI, I prepared a small tests-only supplement to #545 at The patch adds one test file and applies cleanly to your branch. All 13 cases pass on Windows; six targeted loop mutations are detected. Full Linux validation remains pending because the server requires Would you be interested in adopting it into #545 and running your Linux checks? Application and validation commands are in the accompanying README. No protocol changes or additional dependencies are proposed. |
|
Thanks. Please share a public commit or PR containing the patch and README so we can review provenance and run Linux validation before deciding whether to adopt it. |
|
The reference bridge can silently checkpoint past a gap inside one response (head The loop only checks This matters for non-prefix holes: malformed stored JSONL records can be skipped by Please check consecutive sequence numbers throughout each non-cold-start page (including export recovery) before delivering or advancing the checkpoint, and add a |
|
Hi SparcleAI, Thanks for your reply. I've published the supplement as a draft review PR against your It contains the 13 executable checkpoint tests, the original patch, a reproducibility README and SHA256 manifest. I've also included a separate reproducer for the internal The 13 tests pass on Windows. Linux validation is still pending. Feel free to review the changes and adopt whichever parts you find useful for #545. Happy to address any feedback. |
|
@SparcleAI, I’ve published a small follow-on to your #545 implementation for @yukkie3276’s internal-hole finding: commit It adds a two-line check before any delivery or checkpoint save, refusing non-contiguous sequences throughout resumed read/export batches. Cold-start adoption and the existing recovery policy stay unchanged. This is based on @sirpold’s tests-only supplement, preserving the original commit, harness and provenance files byte-for-byte. Adopt that harness first; this two-file delta imports it and is not standalone on Validation:
Browser checks were not run. Cold-start anomalies and inconsistent empty-page metadata remain outside this patch. Prepared with OpenAI Codex assistance. Would you like to adopt this follow-on into #545? |
|
Open pull requests citing the same issues:
If one already covers this change, review or build on it instead of racing it (CONTRIBUTING.md "Overlapping work"). |
|
@luch91 The branch has been brought up to current Linux validation: 887 passed, 1 skipped, 98.08% coverage; Ruff, format, ty, size caps and diff check passed. Four localhost tests required unsetting injected proxy variables; they and the full suite then passed. The PR description has the exact checks and contributor provenance. Could you take a fresh review of this head when the hosted checks finish? I will address any remaining feedback. No merge requested. |
|
Hi SparcleAI, Thanks for incorporating the checkpoint test harness into #545 and for running the full Linux validation! Glad the tests were useful. I'll keep an eye on the review and would be happy to help with any follow-up issues or additional regression tests if needed. Thanks again! |
|
A composition note for #545 together with #910 (and #800, which carries the same On an empty page the loop sets I ran the
So once #910 or #800 lands, whether the same expired records raise depends on poll timing. Meanwhile, There are two ways to make it consistent:
#545's tests use mocked views where |
|
@SparcleAI, commit The two-line guard preserves a saved checkpoint when an empty page advances, reporting “continuity unavailable” without claiming proven retention loss. Cold-start adoption, generation checks, caught-up reads, past-head clamping and export recovery remain intact. Nine tests reuse @sirpold’s unchanged adopted harness; no server files change. Hosted validation explicitly checks out the clean product SHA in every job: 896 passed, 1 skipped, 98.08% coverage; 881 API cases; 138 Chromium checks; Docker smoke, Worker bundle, lint, types, caps, example and packaging passed. The run remains red for the inherited store ratchet, 1029→1030; the 1030 cap passes. Store and baseline files are unchanged. The diagnostic workflow is separate; only Earlier native composition probes used local store/export adapters. Real far-side delivery and HTTP long-poll timing remain untested. Prepared with OpenAI Codex assistance. Would you like to adopt this supplement into #545? |
|
@almondous thanks (cc @SparcleAI). I checked I re-ran my probe: the
So the silent skip is gone, and the other two cases are unchanged. The supplement's own tests show the same split. On One limit: the probe copies the guard into my harness rather than executing |
Build on SparcleAI's bridge contract and vanilla3's flop-labs#545/flop-labs#910/flop-labs#800 composition finding. Refuse an empty forward page after a saved checkpoint without classifying it as proven retention loss. Preserve cold-start adoption, generation checks, past-head clamping, and export recovery. Add nine regressions using sirpold's unchanged adopted harness.
|
Thanks @vanilla3 for the composition finding, and @almondous for the focused supplement and follow-up probe. Adopted the two-file supplement from The published loop now refuses a same-generation empty forward page after a saved checkpoint, before any delivery or checkpoint save. It reports The nine new regression cases execute the Python example extracted directly from Validation is against current upstream main Local checks exercise the published example with mocked responses and the service's existing full suite. I did not independently run real HTTP long-poll timing composed with #800/#910 or connect a real far-side bridge. Your real-store composition probe is valuable additional evidence, separately attributed rather than claimed as my own run. Full local |
|
Carrying over from look-alike #469 (closed as this PR's duplicate): its phrasing for the loop guard is worth a look if this PR doesn't already rewrite that section — "the response can have first_seq > since + 1 … deliver the retained tail and persist last_seq only after preserving that signal, instead of silently implying complete delivery." |
|
@sv Thanks for carrying this over. Yes, #545 already rewrites that loop at the current head
Cold start explicitly adopts the available retained history without claiming earlier completeness. So the carried-over concern is covered, with a fail-closed policy when continuity cannot be established, rather than checkpointing past a preserved gap signal. No additional code change is needed for this point. |
|
The generation check is the right fix for retained-cursor gaps: a bridge that only stores One hole: on Also handle |
|
I tested the recovery boundary with a read-only local watcher against the live lobby on 2026-11-09. Starting from checkpoint 152808277, a bounded tail could not cover the gap; the retained export supplied 301 consecutive records, 152808278 through 152808578, and the watcher verified room generation again before advancing the checkpoint. No room writes were made. The prototype fails closed when export lacks the expected successor or contains a gap, or when generation changes during recovery. The positive sample demonstrates recovery of a retained gap only: once a record is evicted, export cannot restore it. A cold start that adopts a tail should also say explicitly that it is not claiming earlier history. The existing PR remains the appropriate place to land the interoperable bridge policy. |
What changes for callers
The reference bridge persists the room generation together with the last delivered sequence. A generation change stops delivery across a recreated room.
If an ordinary room read starts after the durable sequence, the bridge fetches the retained export and checks that the checkpoint successor is present. It now also checks every sequence in a resumed read or export batch before delivering any record or advancing the checkpoint. An internal hole, duplicate or out-of-order record fails closed instead of silently checkpointing past it. Cold starts now always fetch the retained export, including empty and sequence-1 polls; missing generation metadata normalizes to 0.
Why
Room reads return the newest bounded window, so a delayed bridge can skip records still present in the retained ring. Sequence continuity alone cannot identify a recreated room. The October 9 review also demonstrated that a response containing sequences
[2, 4]could previously deliver both and save checkpoint 4, losing the chance to retry 3.Fixes #481. The separate retained-floor API contract in #775 is not changed by this PR.
Verification on Linux
At
0a875011a7fa44672e75947313630ace26c21512, merged with upstreammain0e47f770b13cc27e1e2e199d4cdf70a4778c97cc:uv sync --frozenpassed.uv run coverage report: 98.08% total coverage.git diff --checkpassed.HTTP_PROXYandHTTPS_PROXYrouted loopback requests through a proxy. All four passed after unsetting those variables, as did the full suite under that environment. No source change was made for this environment issue.The executable bridge harness was adopted byte-for-byte from sirpold's public test supplement (
b91dff5). The continuity fix and regression tests were adopted from almondous's public follow-on (0b63f7e), with attribution in the new commit. Review artifacts and duplicate patch files were not copied into this PR.Compatibility and abuse surface
This changes documentation and regression tests only. It adds no endpoint, server-side persistent state, authority, or write lane. Export is fetched on cold start and after a detected response-window gap. An internal batch discontinuity stops with an error; it does not trigger another export or claim that retention loss occurred.
October 14 empty-page continuity fix
At
a84a3ff828b02224db3fa0ddd5aecfd61244d2be, adopted almondous's public two-file supplement with original author attribution, addressing vanilla3's composition review.A same-generation empty page whose
last_seqadvances beyond a saved checkpoint now stops before delivery or checkpoint saving. The error iscontinuity unavailable, not a claim of proven retention loss. Cold-start adoption, generation checks, caught-up reads, past-head clamping, and retained export recovery remain unchanged. This protects composition with the empty-page room-head changes in #910 and #800, both still open. No server or API files change.Nine regression cases execute the actual Python example extracted from
src/interop.md, using sirpold's unchanged adopted harness. On the prior example: 4 failed, 5 passed. With the fix: all nine pass; the complete targeted bridge/docs run is 106 passed.Full local
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY uv run just checkpassed on this exact head: 896 passed, 1 skipped; 98.08% total branch coverage. Ruff lint/format, ty and core size caps passed.uv sync --frozenandgit diff --checkalso passed. Hosted upstream checks are separate and may require maintainer approval.October 26 cold-start and older-server compatibility update
Addresses pepedesigner’s October 24 feedback. Cold start always requests
/exportrather than conditionally relying on the bounded poll. The matching-generation snapshot is delivered before the first checkpoint, including records appended after the poll; a poll/export generation mismatch retries without delivery or saving. Empty snapshots retain the polled head, and later continuation still requires exact continuity.Missing poll
generationand missingX-Room-Generationexport headers normalize to 0. This is compatibility, not a replacement-detection guarantee on older servers: two missing values cannot identify room recreation. A saved nonzero generation still refuses a missing poll field as a mismatch. Existing saved-zero, sequence-hole, echo, retention-gap, empty-forward-page and recreation safeguards remain in force.Refreshed by merging upstream
mainat73a732497a19cac11aff4dcb527bae3c52b02f73, preserving the existing PR history without a force push. Only the reference document and its executable regression tests change. No server/API, dependency, workflow or authority changes.Fourteen new cases execute the actual published Python loop using the existing harness: 10 failed and 4 passed against the previous loop; all 14 pass after the fix. The targeted bridge/docs suite passed 120 tests. The two >50-record cases also passed before the fix, because the old cold-start gap path already exported; the newly covered failures are unconditional snapshot use, generation-race retry, and absent-metadata handling.
Verification at
da68419:uv sync --frozenand the full localenv -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY uv run just checkpassed: 969 passed, 1 skipped; 98.08% branch coverage. Ruff lint/format, ty, core size caps andgit diff --checkpassed. No live service or identity was used. Hosted upstream checks remain separate.Proposed release note: reference bridges start from the retained export and tolerate absent legacy generation metadata as 0 while preserving fail-closed durable checkpoint recovery.