Repository navigation
Shape ratchets: waits, unknowns, stringly errors, flag states and string ids counted in every core crate (RTOS rules 10-11) - #5990
Merged
Conversation
…leep or poll ever moves work forward (RTOS rule 10) Joel, 2026-11-14. Covers production, tests and our own tooling; a bound is only a loud watchdog. Measured cost on the M5: continuum stop hung 100 s on four deploys waiting on a timer (core shutdown is 2.2 s); two CI tests flake on machine speed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…sort error path, behind error events and interrupts Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ule 11 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ion and tests held apart (RTOS rules 10-11)
Joel, 2026-11-14: "I can't even keep track of the thousands of these you've made." The
tracking is mechanical now. core/source-hygiene/src/shapes/ adds five token rules over the
shared lexer, each held as `<name>` (production) and `<name>_in_tests` through
ratchet::hold_sites, over every core/ workspace member (not only the audited set):
- waits_that_decide_flow: sleep/sleep_until, interval/interval_at, tick_interval: Some,
Duration-typed consts, timeout/timeout_at/recv_timeout whose Err side carries on.
Exempt only with `// event-exempt: <remote that may never answer>`.
- unknown_as_value: map_or(0 / 0.0, unwrap_or(0)/unwrap_or_default() on a measurement-named
read, .max(1) guarding a division, usize/u32/u64::MAX returned as a sentinel.
- stringly_errors (library code): Result<_, String>, Result<_, ()>, map_err to format!/
to_string/to_owned, ..Error/..Failure variants holding a bare String.
- state_as_flags: structs with 2+ bool/AtomicBool fields; match (a, b, ..) over 2+ Option
fields of one struct declared in the same crate (crate-wide learning pass).
- string_identities: .get("lit") on JSON outside wire code; HashMap/BTreeMap<String, _>
struct fields in library code.
Totals only fall, judged against the base by the PR's own rules; every crate's count is
recorded beside them (HeldOnly::SweptByCrate: a touched file keeps old sites, adds none).
The CI receipt now also prints every crate of every ratchet in a folded log group, the
full per-crate baseline a floor-up sweep reads.
The reason-marker check moves from time_bounds into lexer::marker_with_reason, the one
owner both rules use.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… "group params ... pass by reference") Joel, 2026-11-14: "group params as part of structs when they belong together. Pass by reference and assign mutability and optional at contract." Library fns with 5+ parameters or 3+ consecutive same-primitive parameters (swappable), `.clone()` passed straight as a call argument (anywhere), and pub fn parameters taking an owned String/Vec. Held like the other five, production and tests apart. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…r own rule (2186 -> 2197 in CI) The first CI run counted 11 new contract_shape sites in the rules themselves, every one a Range cloned into a call that only reads it. type_is, fields, variants, is_self, param_type and string_keyed_map now take &Range; state_as_flags files each struct's Option fields as a typed OptionalFields record instead of a map keyed through a cloned argument. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…te table is committed as the starting line Baselines measured by CI (run 43541300117) over canary 7a29474 with this PR's rules, production / tests: waits_that_decide_flow 408/290, unknown_as_value 218/34, stringly_errors 2926/238, state_as_flags 146/9, string_identities 839/184, contract_shape 2186/1246. Rule 10's line that time_bounds and wall_clock counted sleeps is corrected: neither did; waits_that_decide_flow does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…e ratchets Rule 10/11 text: canary's #5986 wording kept, plus the shape-ratchet section, its baselines and the correction that time_bounds and wall_clock never counted sleeps. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Moved since 7a29474: waits_that_decide_flow 408/290 -> 398/291, stringly_errors 2926 -> 2923, state_as_flags 146 -> 145, contract_shape 2186/1246 -> 2192/1250; continuum-engine's total 1,454 -> 1,444. The rest held. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
This was referenced Nov 14, 2026
A panicked persona loop is started again after a doubling wait, instead of ending her for good
#5874
Open
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.
How this serves the minds: the code residents work in, and the code that runs them, gets cleaner by a gate rather than by Joel's memory. Joel, 2026-11-14: "I can't even keep track of the thousands of these you've made." This is plan Phase 3 (locks) and Phase 5 (floor-up pattern sweeps).
What
core/source-hygiene/src/shapes/adds six token rules over the shared lexer. The lexer is zero-dependency by the crate's hard constraint, so there is no syn; strings and comments are never treated as code. Each rule covers everycore/workspace member and holds two ratchets:<name>for production and<name>_in_tests. They hold through the existingratchet::hold_sites: the total may only fall, it is judged against the PR's base tree by the PR's rules, and each crate's count is recorded.waits_that_decide_flowtick_interval: Some,Durationconsts, timeout/timeout_at/recv_timeout whose Err side carries on; exempt only with// event-exempt: <remote>unknown_as_valuemap_or(0/0.0,unwrap_or(0)/unwrap_or_default()on measurement-named reads,.max(1)guarding a division,usize/u32/u64::MAXreturned as a sentinelstringly_errors(library)Result<_, String>,Result<_, ()>,map_errto format!/to_string/to_owned,..Error/..Failurevariants holding a bare Stringstate_as_flagsmatch (a, b, ..)over 2+ Option fields of one struct in the same cratestring_identities.get("..")on JSON outside wire code;HashMap/BTreeMap<String, _>struct fields in library codecontract_shape.clone()as a call argument; pub fn taking owned String/VecAlso changed:
time_boundsintolexer::marker_with_reason, one owner for both rules.HeldOnly::SweptByCrate: a touched file keeps its old sites and may add none. Since only a touched file's sites can move, the held total rises exactly when the touched files gain sites.Not judged per crate. A rise in one crate does not fail on its own, because a Phase 2 crate cut moves sites between crates with the total unchanged.
moving_sites_into_an_existing_crate_passes_and_is_recordedpins that behaviour. Per-crate counts are receipts.Measured
CI run 43541300117, base canary
7a29474a9, this PR's rules. Production / tests:The ten crates with the most sites:
The floor crates:
continuum-base: 15 stringly errors and 1 string identity.continuum-host: 5 waits in production and 2 in tests, 2 unknowns, 1 contract.continuum-pack: not on canary.The full 49-crate table is in
docs/planning/SHAPE-RATCHET-BASELINE-2026-11-14.md. Rule 11 in CONTINUUM-ENGINE.md names each ratchet with its total.The first CI run caught the rules breaking their own rule: 11 Range clones passed as call arguments, which pushed contract_shape from 2186 to 2197. They were fixed by borrowing.
Nothing was compiled locally; this machine serves live minds, and CI is the compiler.
Stacked on #5986 (RTOS rules 10-11, docs only), merged in so the ratchets document under rule 11.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo