Skip to content

tests: judge the gate cache only on a run where no other write moved the stamp - #193

Merged
robertohluna merged 2 commits into
mainfrom
fix/sync-gate-cache-flake
Oct 30, 2026
Merged

robertohluna merged 2 commits into
mainfrom
fix/sync-gate-cache-flake

Conversation

@robertohluna

@robertohluna robertohluna commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Flakes in test-current: a write to a column the gate does not read leaves the scan cached and, on the next run, a run table: a labelled run holds an aggregate, open runs leave the scan cached saw both scans rebuilt (again was [:holds_above, :index]).

Cause: the cache stamp is the write sequences of the whole store (sync_capture, sync_mutations, sync_local_stamp), not of one workspace. The Engine's own schedulers run during the suite, so a write to any workspace that syncs, from anything, can move the stamp between a test's two reads and rebuild the scan. That is correct behaviour for the cache; the tests assumed nothing else would write in that window.

Fix: while_stamp_holds/1 reads the three sequences before a repeatable run (warm read, the writes under test, the read under test) and after it. If they moved, something else wrote and the run says nothing about the writes under test, so it is repeated (up to 20 times, then it fails). If they did not move, the cache must have held, and the test still asserts that nothing was scanned again. Applied to the four tests that assert a rebuild-free read (unrelated-column write, run table, ttl first reread, second pull). The cache and its stamp are unchanged. A per-workspace stamp would make the cache immune to writes elsewhere; that is a product change of its own.

@robertohluna
robertohluna merged commit c74773c into main Oct 30, 2026
17 checks passed
@robertohluna
robertohluna deleted the fix/sync-gate-cache-flake branch October 30, 2026 11:39
robertohluna added a commit that referenced this pull request Oct 30, 2026
…e is doing (#196)

Three tests failed once each on CI while four full suites ran at once,
and passed in other runs. Test code only, no product change.

- `SyncTest` "seal works through a backlog larger than one batch": the
Sync scheduler seals on its own timer. When it took a batch of the 5100
inserted rows between the insert and the call, the call counted only the
rest (`sealed` was 5000). The test now suspends the scheduler (as other
sync tests already do) so the call under test is the only sealer. The
assertions are unchanged.
- `SyncGateTest` "a pull of many pages scans the workspace once": the
same race as #193. The gate cache stamp is the store-wide write
sequences, so a write by anything else mid-pull rebuilds the index (2
builds instead of 1). The pull now runs under `while_stamp_holds/1`, and
each attempt starts from an empty cache so a retry is not served the
entry the last attempt built.
- `GmailBrokerTest` "secrecy": `every_stored_row` rendered every row of
every table with `inspect` and timed out at 60 s. The store now does the
search: one byte-wise `instr(CAST(col AS BLOB), CAST(secret AS BLOB))`
pass per column, for the reference and all four tokens, with nothing
copied out. A control (the connector's own id must be found in
`connectors.id`) proves the scan can find a stored value, so an empty
answer means something. The view, log and evidence checks are unchanged.
robertohluna added a commit that referenced this pull request Nov 1, 2026
## Release 0.3.11

Moves the version from 0.3.10 to 0.3.11 in the 16 files the 0.3.10 bump
(#178) touched: application, CLI, MCP, client installer, contract, docs
and the tests that pin it.
Contract schema `1`, API `v1` and expected migration `85` are unchanged:
nothing since 0.3.10 adds a migration.
Two lines in `docs/guides/versioning-and-releases.md` that record when a
feature arrived ("From 0.3.10 on") stay as they are.

## In 0.3.11 (since v0.3.10)

- bundles: a rolled-back batch leaves no line in the written log, and
the boot take-back runs beside boot (#177)
- sync: a replica removes what it made from a source package only once
the package row is gone, as the origin does (#173)
- workspace: the crawl skips files in no workspace, and a takeover
relabels default rows only, atomically with the row (#179)
- steward: a tenant takes back the default rows its source packages
vouch for under a bare workspace id (#171)
- ci: run the Linux merge-gating jobs on MIOSA self-hosted runners
(#180)
- api: ingest takes occurred_at, source_id and write_files (#181)
- search: the full-text match drives the join, and the store keeps its
planner statistics fresh (#182)
- graph: a backfill job done in slices records the whole run when its
last slice finishes (#183)
- deps: plug_crypto 2.2.1, which keeps the secret key base out of stack
traces (CVE-2026-105963) (#184)
- intake: a cross-reference copy is dated when its signal happened, not
when its file was written (#185)
- docs: the README leads with what the engine does, measured results,
what sets it apart, how it works, and a five-minute start (#186)
- wiki: a page without citations goes stale by age, and RAG skips stale
or unsourced pages (#187)
- api: bound search text, collapse duplicate hits, honor limit on graph
and exports, scope stats (#189)
- wiki: re-curate a stale page only when the curator has material (#190)
- health: report a broken embedder as degraded, count rag, connector and
intake metrics, keep the git sha current (#188)
- tests: retry a bundle job cancel sent from a telemetry handler until
the store answers (#191)
- api: an offset without a limit on the graph windows its edges like a
limit does (#192)
- tests: judge the gate cache only on a run where no other write moved
the stamp (#193)
- bundle jobs: answer a Store that did not answer as busy, not as a job
that is not there (#194)
- store: a workspace window keeps its (workspace_id, id) index whatever
the planner statistics say (#195)
- test: three tests no longer depend on timing or on what else the store
is doing (#196)
- memory: an episode's provenance is projected as evidence links, so
assemble no longer fails (#197)
- embed: an input Ollama refuses as longer than the model's window is
sent again at half its length (#198)
- embed: the two request clauses sit together again, so a strict compile
passes (#200)
- memory: a recall over a stale associative projection queues its
rebuild (#199)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant