Repository navigation
Admit checkpoint writes on the negotiated owning volume - #5118
Merged
joelteply merged 5 commits intoOct 16, 2026
Merged
Conversation
joelteply
marked this pull request as ready for review
October 16, 2026 20:26
joelteply
deleted the
2e3dd9c1/admit-exact-kv-checkpoint-writes-on-thei
branch
October 16, 2026 20:26
joelteply
added a commit
that referenced
this pull request
Oct 16, 2026
…itizens-can-code; the resolver probe's kind names it CI job 117186712628 (Cormac on #5112): E0004 at the probe's exhaustive match once canary's #5118 added ResolveExisting; named, no wildcard (the clippy gate forbids wildcard_enum_match_arm). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
added a commit
that referenced
this pull request
Oct 16, 2026
…core's git identity, readable tool results, a bounded prompt, a bounded board (#5112) * fix(install): the node's GitHub token is provisioned for the core's own git and gh Every citizen's act-end push on the M5 failed for a day: "could not read Username for 'https://github.com': terminal prompts disabled" (10 of 10 workspace.push probes, 2026-10-16). The core runs as a system launchd daemon; from its children the keychain search list holds only /Library/Keychains/System.keychain, so `gh auth git-credential` finds no token and answers nothing (instrumented helper, 13:00:45Z: gh rc=1, 0 bytes, keychains=System only; the same push from a user shell: rc=0, 99 bytes). The core's git identity cannot depend on a login keychain (none headless, on Linux, or on Windows). The install path provisions GH_TOKEN into config.env from `gh auth token` when gh is logged in; the core applies config.env to its environment at startup (main.rs), so its git and gh inherit the token, and a citizen's shell strips it (shell_session.rs). When gh is absent or logged out the installer says so instead of leaving the node silently unable to push. ## Measured (M5, 2026-10-16) GH_TOKEN provisioned by hand the same way, core restarted (same build f295a63, verified): code/git/push from the core: gh rc=0, 104 bytes, the branch landed on origin (13:12:32Z); before: exit 128 every time. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(cognition): a spilled tool result carries its head beside the handle A tool result over the window's one-result share was handed to the mind as a pointer alone. That sent a citizen back to re-read the same file in slices for hours: Benchy on the M5, 2026-10-16, read a 578-line lib.rs (27,454 chars against a 26,176-char share), perceived it as "a single 27454-character line (or the result has been truncated)", and spent 121 acts without a write (write_or_release_gate); Aris 507. Each act costs 5-30 min on the 27B. The pointer now carries the first lines up to a quarter of the share, named as lines 1-N of M, the handle for the rest, and the direct way to the rest (tool/output ranges, or code/read with start_line/end_line). Never passed off as the whole: the head is labelled and the unseen range is named after it. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(cognition): a tool result goes on as text; the results ring renders its newest entries only Two defects measured on the M5 (Benchy, prompt captures, 2026-10-16): - A tool result went on as its JSON: a long body field (code/read's `content`) JSON-escaped, so a 248-line read reached the mind as "1 lines (13449 chars)", the spill counted one line, and its line-range way in was meaningless. `spill::result_text` renders a result whose bytes are mostly one string field as its scalar fields on a line, then the text raw, with real newlines. - The results ring rendered 200 entries one message each (~30k of a 60k-char prompt), and its head rotated between acts, so 80% of every act's prompt re-prefilled (common_prefix share 0.18-0.19 across 6 consecutive acts). Only the newest RENDERED_RESULTS (16) ride as messages; every older entry is a pointer line in the one collapsed index, which already changed per act. Measured after deploy (owner Fable): common_prefix share and prefill tokens per act on the M5 residents, the spill probe's head_lines, acts_without_write on the probe card. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * test(spill): the over-share contract is a LABELLED head plus the handle, never a fragment passed off as whole Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(cognition): the collapsed index is bounded, and a result's share stands on the served window Measured on the M5 after 92d632c (Benchy's prompt captures, 2026-10-16 13:39-14:25Z): the fold moved 184 older results into ONE 38k-char index message, 62% of a 62k-char prompt, re-prefilled on every settlement; and the one-result share was 5,074 chars because the affordable total is TTFT (60 s) x the measured 110 tok/s = 6,600 tokens, so a file read still spilled. - The index lists its newest INDEX_LINES (24) pointers and counts the rest (each still reachable by #seq through the steps ledger and tool/output). - latest_action_chars is never below an eighth of the SERVED window: the result of the act she just took is what the act is for; affordability bites the optional prompt. Measured after deploy (owner Fable): prompt chars per act, the index message's size, spills per read on the residents, acts to the first write on the probe card. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(work): work/list is bounded; a long array result goes on pretty-printed Measured on the M5 (2026-10-16, Benchy): one `work/list` answered with all 776 cards (469 claimable) as a single 198k-char line of compact JSON, spilled past her window's share, and she could read none of it; another persona's `commands/list` was a 402k-char line. - `work/list` lists at most `limit` cards (default 40), claimable first, then priority, then newest, and says how many matching cards it left out; the totals stay. - `spill::result_text`: a result with no text body goes on pretty-printed when it is long, one element per lines, so its head shows the first elements and the rest pages by line. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(install): the GitHub token is provisioned by an always-run module, on both installers Cormac's review of #5112: _provision_github_token ran only from _cold_export, so a node with no routed cold storage (the IntelMac has no CONTINUUM_STORAGE_PATH) never got GH_TOKEN, and the Windows installer was not touched. Now mod_github_token (install.sh, after mod_cold_storage) and Mod-GitHubToken (install.ps1, same place) each run unconditionally: GH_TOKEN from `gh auth token` appended once to config.env, single-quoted; no gh or not logged in names the gap and leaves the file alone. The cold-storage path no longer shells out to gh. Tests: install-modules.test.sh gains two stub-gh cases (provisions once, mode 600; no gh names the gap) — 5 passed, 0 failed on the M5; windows-service.test.ps1 gains the twin case (runs in CI's Windows lane; no pwsh on this Mac to run it here). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(cognition,persona): the results ring holds its share at every receipt; a turn with no act carries nothing The results ring was collapsed only at settlement, and a coding turn is 100+ acts between settlements: persisted rings on the M5 (2026-10-16) held 213 results / 686k chars, 155 / 1.09M, 123 / 442k, 49 / 138k; fit_messages was the only bound. The share is now enforced at every receipt with hysteresis (a burst to half the share, append-only between bursts, so the prefix stays byte-stable on a KV that cannot shift: the lane logs "cache_reuse is not supported" 7x). The count fold from the morning commit (newest 16 as messages) is removed: it rotated the head on every act. `budget()` reads the serving truth when no pin is set instead of answering "no bound". `end_card_turn` takes the turn's act count and skips the act-end carry at zero (git ran 374 ms on every empty turn, 33 times per resident per 5 min while the lane was gated). Measured (M5, 3ad1300, same four residents): prompt chars per act 61-71k → 17.6-30k; ring entries in the prompt 16 → 0-2; persisted rings 123-213 entries → 1-3; prefix reuse 0.18-0.43 → 0.73-0.96; prefill per act 20-30k tokens → ~15k. Tests: working_memory +2, the 2026-08-24 settlement test rewritten to the receipt-time contract; context_budget is_known. The worktree git grant that shared this commit's first form (8ecf2dc) is its own PR now. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(cognition,persona): the receipt-time collapse needs a known window; the newest result always stays; "THIS TURN" follows the turn's binding Cormac's review of #5112 at 627a016: - The receipt-time collapse is guarded by budget().is_known(), as restore is: an unknown window's results share is the MIN_SERVE_CTX floor, and a receipt can land with the window unknown (a lane relaunching between the prompt and the tool's return answers no loadout). Folding against the floor would collapse results her real window holds. - `newest = rr.is_empty()`: the `&& survivors.is_empty()` let the newest result collapse whenever an older unsaved result had survived, reachable on every receipt now. - collapse_results_over_cap's doc said "called at SETTLEMENT, never mid-settle". And from Benchy's own words on the M5 (2026-10-16): perception's "THIS TURN" stance was computed by the state-blind focus_card (latest heartbeat wins), so a django card in REVIEW read "THIS TURN" while the InProgress card her hands were on (the turn binds actionable-first, act_question) read "held, not this turn"; she spent turns reconciling the two. The stance now uses focus_workspace_card, the same precedence as the binding. Tests: the_this_turn_stance_follows_the_turn_binding_not_the_latest_heartbeat; the settlement test pins a window (an unknown one folds nothing at receipt). working_memory + context_budget + work_focus + active_work_source: 62 passed, 0 failed. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * refactor(cognition): the known-window rule lives in collapse_results_over_cap Cormac on #5112 (5850bdb): record_settlement still called the collapse unguarded, so a settlement in the same relaunch window folded against the MIN_SERVE_CTX floor. The guard is now at the top of collapse_results_over_cap for every caller (receipt, settlement, restore) and gone from the callers. working_memory + context_budget: 62 passed, 0 failed. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * chore(cognition): RESULT_FLOOR_DENOM carries its derived-or-floor justification (CI derived-bounds ratchet, Cormac on #5112) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(system_resources,cognition,work): a shell's cargo-root admission waits its own bound; CI fixtures follow the receipt-time ring - Benchy, M5 2026-10-16 19:01Z and 19:04Z: three shell commands (django workspace, no cargo in them) failed before any child existed with "Cargo cache ownership: Cargo root resolution is still pending: ~/.continuum/cache/cargo-target". Every shell asks for the cargo-root grant (it sets CARGO_TARGET_DIR), and the grant's one filesystem resolution was bounded by the 100 ms pressure-reporter budget; at 91% swap one canonicalize took longer. The resolver takes a bound: reporter ticks keep REPORTER_TIMEOUT, admissions (admit_cargo_target, register_cargo_target) wait ADMISSION_BOUND = 5 s, the same basis as disk_change::READ_BOUND. Test: an_admission_waits_its_own_bound_not_the_reporters. - pinned_act_result_reaches_the_prompt_even_with_an_empty_broadcast (Cormac, CI at be45ab1): the fixture's window now holds the 16.8k inventory beside the next batch, so the ring keeps it and the FIT does the substitution it proves; a smaller window collapses it at receipt. - tool_surface ceiling 17238 -> 17298: work/list `limit` (one optional field, one-line doc), measured locally; the field's longer doc moved to a plain comment. Measured locally: registry 5/5 (new test included, this time), the two faculty tests green, modules::work green. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(runtime,system_resources): one launch-path filesystem bound, measured; the root resolver probes queue and work time Cormac on #5112 (5f28b90): ADMISSION_BOUND cited READ_BOUND and both were bare 5 s literals with no receipt. Now one named bound, runtime::daemon::LAUNCH_PATH_FS_BOUND, carries the measurement (M5, 40ff660c4, 2026-10-16T19:49Z, swap 11.57 GB: realpath+stat of the cargo root p50 9 µs, max 27 µs over 50 calls); READ_BOUND and ADMISSION_BOUND reference it. The three refusals at the 100 ms budget were therefore resolver latency, not the call: the resolver now probes `disk.root.resolution` (queue_ms, work_ms, kind, ok) per resolution and `disk.root.resolution.pending` (bound_ms) on a refusal, so the next one carries its number. The 5 s is a stated hypothesis until card 65019925 posts the queue distribution (owner Fable, due 2026-10-17 12:00Z). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * test(system_resources): the admission-bound test holds the worker on a gate instead of racing a zero bound (Cormac on #5112, CI job 117160235068) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * test(system_resources): fix the path to REPORTER_TIMEOUT inside the tests mod (8154ac8 did not compile its test; the chain had not gated the commit on the test) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * test(windows): the stub installer modules define Mod-GitHubToken as a no-op CI windows-msvc job 117172876831 (Cormac on #5112): the payload-entry case's stub win-modules.ps1 defined only Mod-ColdStorage and Test-WingetAvailable, and install.ps1 now calls Mod-GitHubToken between them. The toolchain-cache case dot-sources the real modules with Get-Command stubbed truthy, which would run the runner's real gh into the scratch profile; it gets the same no-op. The real Mod-GitHubToken case covers the token. First run of the Windows path both reviewers had named as unrun. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Merge origin/canary (664428a, PathWork::ResolveExisting) into fable/citizens-can-code; the resolver probe's kind names it CI job 117186712628 (Cormac on #5112): E0004 at the probe's exhaustive match once canary's #5118 added ResolveExisting; named, no wildcard (the clippy gate forbids wildcard_enum_match_arm). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
Checkpoint saves could write their main file and companions without projected capacity admission on the owning volume. Local engines advertising exact checkpoint sizing now quote the complete serialized bytes, consult the existing disk policy on the physical page directory, and pass an admitted ceiling that the engine recomputes before opening files.
Capability and path discovery belong to the endpoint generation and installed pool. Lifecycle checkpoints negotiate before the first adapter probe; unknown capability refuses writes, transient path discovery can recover, and positively negotiated legacy/remote protocols remain explicitly unactivated. Logical checkpoint handles stay unchanged. Native pin includes the matching capability advertisement.
Validation: existing HTTP, lifecycle, directory, and volume-selection fixtures extended for capacity refusal, checkpoint-before-probe, geometry mismatch, transient resolution recovery, real Windows canonical paths, and UNC boundaries. Rust parsing, Python AST, and diff checks pass; hosted compilation/tests pending. Exact native da8 successor compiled on the isolated Intel CPU lane (3m39s), then all five existing text slot fixtures passed, including the new props assertion (19:35:46–19:35:54Z; owner receipt f1a403b4). Existing cached stories260K model selected through an external pytest plugin; bulk model loading disabled, no downloads or shared lane. Six multimodal fixtures remain unvalidated.
This is projected admission, not a disk reservation or atomic multi-file save. Concurrent writers and failures during writes remain separate limitations. No live checkpoint mutation or deployment performed.
Owned card: 93dba7f6-6108-4d70-a875-830f0252be22. Reuses its existing managed checkout; preserves native model and adapter binding.