C# and Python: soft flush means one thing (soft-flush-cs-py) #153

Merged
libby merged 6 commits from store-replace/soft-flush-cs-py into main 2026-11-13 01:53:51 +00:00
Member

What. Soft flush now means one thing in C# and Python, as in TS and Rust: an absent path is written, a store the reader reads is left byte for byte, an unreadable file is refused and left.

  • C#: CacheBackingStore.PushAll(bool soft) is the single abstract owner (PushAll() stays as the plain call). The single-file store decides under its lock from ReadSnapshot; a skip leaves staged writes staged and the store dirty (ruling variants:ruling:soft-flush-skip-keeps-staged-writes). The directory store skips when the manifest read returned bytes (the reader's answer, not a second look at the path). CultCache.FlushAsync/FlushAllBackingStores, CultMesh.FlushAsync and CultNetLocal.FlushAsync pass the flag instead of ignoring it. Test stores adapted.
  • Python: push_all(envelopes, soft=False) on the protocol default, SingleFileMessagePackBackingStore and JsonLinesBackingStore; both stores decide from _pull(), the reader's own answer (None is absent). The protocol default's pull returns a list and cannot say absent, so a soft push through it always skips a store whose pull returns (open question: an inheriting store is never written by a soft push). A readable store holding no records skips in every decider. cultnet-py is untouched.

Why. The flag was accepted and ignored (C#) or absent (Python), so a soft flush silently overwrote a store. Follow-up variants:follow_up:soft-flush-all-runtimes.

Deviation. The spec's cultmesh-py node.flush caller is a reactive-document writer flush with no store or soft concept, so it is unchanged.

Verification (head 80eed16c, full runs). C#: Caching.Tests 1362 passed, 4 skipped, 0 failed; Caching.OutsideStoreTests 8 passed; Mesh.Tests 362 passed, 4 skipped; Networking.Tests 839 passed, 4 skipped. Python (cultcache-py and cultnet-py on PYTHONPATH from this worktree): cultcache-py 270 run, OK, 1 skipped. cultnet-py was not rerun (untouched). On base 25f21fcc cultcache-py is 263 run, OK, 1 skipped with cultnet-py importable; without it the two SimulationFactTests fail on ModuleNotFoundError: cultnet_py, an environment defect, not a base failure. Hand mutations: h2 listed 30 (C# 16, Python 14), not 31; this pass added 7 (host and node soft-from-memory, records-count in the single-file, directory, Python single-file, JSONL and protocol deciders), all killed. The red-first for C# was not run on base (the flag did not exist there); Python red was run.

Ids. Spec variants:cut_spec:cut-soft-flush-cs-py.r2; report variants:cut_report:cut-soft-flush-cs-py.h3 (h1 overstated its test counts; h2 misstated its mutation count).

🤖 Generated with Claude Code

**What.** Soft flush now means one thing in C# and Python, as in TS and Rust: an absent path is written, a store the reader reads is left byte for byte, an unreadable file is refused and left. - C#: `CacheBackingStore.PushAll(bool soft)` is the single abstract owner (`PushAll()` stays as the plain call). The single-file store decides under its lock from `ReadSnapshot`; a skip leaves staged writes staged and the store dirty (ruling `variants:ruling:soft-flush-skip-keeps-staged-writes`). The directory store skips when the manifest read returned bytes (the reader's answer, not a second look at the path). `CultCache.FlushAsync/FlushAllBackingStores`, `CultMesh.FlushAsync` and `CultNetLocal.FlushAsync` pass the flag instead of ignoring it. Test stores adapted. - Python: `push_all(envelopes, soft=False)` on the protocol default, `SingleFileMessagePackBackingStore` and `JsonLinesBackingStore`; both stores decide from `_pull()`, the reader's own answer (None is absent). The protocol default's pull returns a list and cannot say absent, so a soft push through it always skips a store whose pull returns (open question: an inheriting store is never written by a soft push). A readable store holding no records skips in every decider. cultnet-py is untouched. **Why.** The flag was accepted and ignored (C#) or absent (Python), so a soft flush silently overwrote a store. Follow-up `variants:follow_up:soft-flush-all-runtimes`. **Deviation.** The spec's cultmesh-py `node.flush` caller is a reactive-document writer flush with no store or soft concept, so it is unchanged. **Verification (head 80eed16c, full runs).** C#: Caching.Tests 1362 passed, 4 skipped, 0 failed; Caching.OutsideStoreTests 8 passed; Mesh.Tests 362 passed, 4 skipped; Networking.Tests 839 passed, 4 skipped. Python (cultcache-py and cultnet-py on PYTHONPATH from this worktree): cultcache-py 270 run, OK, 1 skipped. cultnet-py was not rerun (untouched). On base 25f21fcc cultcache-py is 263 run, OK, 1 skipped with cultnet-py importable; without it the two SimulationFactTests fail on `ModuleNotFoundError: cultnet_py`, an environment defect, not a base failure. Hand mutations: h2 listed 30 (C# 16, Python 14), not 31; this pass added 7 (host and node soft-from-memory, records-count in the single-file, directory, Python single-file, JSONL and protocol deciders), all killed. The red-first for C# was not run on base (the flag did not exist there); Python red was run. **Ids.** Spec `variants:cut_spec:cut-soft-flush-cs-py.r2`; report `variants:cut_report:cut-soft-flush-cs-py.h3` (h1 overstated its test counts; h2 misstated its mutation count). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
benchmark.py's InMemoryBackingStore implements the BackingStore protocol and takes the new keyword.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
C#: soft flush skips a readable store and keeps staged writes dirty; Mesh and CultNetLocal pass the flag
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
0a1486eccd
CacheBackingStore.PushAll(bool soft) is the one abstract owner; PushAll() stays as the plain call.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Soft flush: tests for the survivors of the hand mutations (directory store, JSONL and protocol default, host and node passthrough, plain PushAll); revert the benchmark.py touch
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
fb80e32749
The InMemoryBackingStore in cultnet-py benchmark.py has no soft caller (the Python cache never passes soft), so the keyword there was unowned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Soft flush: the reader's own answer decides (no second stat, protocol default included); pin the readable-empty store, spy the flag through Mesh and host, changelog the breaking PushAll
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
80eed16c0d
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Soft flush: pin the host and node passthroughs with a held record (absent writes, readable skips, unreadable refuses); XML-doc the one meaning on the three FlushAsync(bool soft) overloads
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
8df0c4b25a
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merge origin/main into soft-flush: JSONL push_all keeps the one _rewrite entry (refuse the link, read, decide soft)
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 24m23s
1f9fffee83
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
libby merged commit 558526c125 into main 2026-11-13 01:53:51 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/CultLib!153
No description provided.