Repository navigation
Conversation
…to a mind Three owner rules held only in prose get enforced checks on the existing seam (SourceRule + lexer tokens + hold_sites per crate, base-vs-head via `ratchets`): - polling_sites (68): a production sleep/sleep_until or interval tick whose innermost loop re-reads the filesystem, a child, a peer or a store, or whose wait names itself a poll/retry/backoff. Cadence owners (SubstrateGovernor, CadenceTable, BrainRegion, module harness, pressure monitors + broker, the daemon liveness reconnect owner, provisioning/rate_limit) allowed by module path. Touched files end clean. - string_id_fields (395): struct fields id / *_id / *_ids typed String, &str, Box/Arc/Rc<str> or Option/Vec/VecDeque/HashSet/BTreeSet of one. - hand_rolled_short_ids (27): #5389's predicate, superseded here with per-crate counts and `_id[..8]` slicing; #5389 becomes the migration only. - prose_literals (32): literals of >= 4 words in the modules whose text reaches a resident (prompt assembly, deliberation_prompt, tool_surface, continuum-prompt prompt_assembly/prefix, build_persona_system_prompt, sdk_codegen ai_help/call_form/refusal), logs/attributes/asserts skipped. Touched files end clean. Each has a negative-control test (an added offender is counted). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Closing as superseded in the main by canary 800c21c (#5990, shape ratchets): its |
Why
Serves the minds by locking three of Joel's repeated rules into the build so the substrate they run on stops regressing (Phase 0/3, "stop adding to the slop": ratchets fail the build). Rules:
What
All four ratchets run on the existing seam:
SourceRule, the token lexer, andhold_sites, which records per crate and judges against the base tree via theratchetsbinary. Each file has one#[cfg(test)] modwith// what this catches:. Every new file is under 250 lines, and no file over 1,000 lines was touched.polling_sitespolling_sites.rsstring_id_fieldsstring_ids.rshand_rolled_short_idsstring_ids.rsprose_literalsprose_literals.rsThe total is judged against the base. Per-crate counts are recorded and printed (
name@crate) but not judged per crate, so a crate cut that moves sites between crates still passes.polling_sites. A production
tokio::time::sleep/thread::sleep/ awaitedsleep/sleep_until/ interval.tick()counts when its innermostloop/while/for..ineither:try_wait,Command,connect/ HTTP /execute,query/list/status/snapshot/load/try_recv, orread_*/list_*/fetch_*/check_*/poll_*; orPOLL,retry,backoff.Macros (
select!,probe!) and atomicfetch_addand friends don't count. The cadence and backoff owners from CONCURRENCY-STYLE-GUIDE are allowed by module path, not by comment:persona/substrate_governor,runtime/cadence_table.rs,runtime/brain_region.rs,runtime/module_harness.rs,runtime/governor_bus.rssystem_resources/{memory,disk,fd}_pressure,paging/broker.rs,modules/pressure_broker_module.rsairc/daemon_liveness.rs(the one reconnect owner) andprovisioning/rate_limit.rs(the host-told retry owner)For scale: the audited production tree has 134 waits, 112 of them in loops. The ~302 figure from the audit included tests.
string_id_fields. Fields of production brace structs named
id,*_idor*_ids, typedString,&str,Box/Arc/Rc<str>, orOption/Vec/VecDeque/HashSet/BTreeSetof one. Enum struct-variants are not counted yet.hand_rolled_short_ids. This supersedes #5389's rule: same predicate and name, now with per-crate counts and
*_id[..8]slicing added. #5389 becomes only the migration and should drop itsshown_ids.rsandlib.rsline on rebase. Its migration will lower this count.prose_literals. A string literal of 4 or more words counts (
{..}placeholders and escapes removed). The cut is a definition, not a tuned number: a label names one thing in at most three words, and a sentence needs more. Literals inside attributes, log/panic/assert macros and.expect(..)are skipped. "Reaches a mind" is a list of module paths, derived from where her prompt messages are built and documented in the rule:llm_deliberation_faculty/prompt/andllm_deliberation_faculty/tool_surface.rscognition/tool_surface*andcognition/deliberation_prompt.rscontinuum-promptprompt_assemblyandprompt_prefix.rspersona/supervisor/build_persona_system_prompt.rssdk_codegen/{ai_help,call_form,refusal}.rsTop offenders
kernel/system_resources/bounded_command.rs3genome/.../engine_lora_adapter/train_status.rs3academy/cognition/swe_bench/fetch_hf_rows.rs3live/audio/resource_lifecycle.rs2live/consumers/avatar.rs2engine/inference/stderr_relay/follow.rs2core/contracts/event_classes.rs18memory/memory/types.rs8engine/ai/types.rs8core/modules/auth.rs8kernel/routing/airc_realtime.rs7models/commands/pull.rs6live/session/orchestrator.rs4core/modules/verdict_board.rs3core/ipc/positron_nav_source.rs3rooms/card_facts.rs2mind/persona/{recorder,perception_region}.rs2 eachprompt/prompt_assembly.rs14 (the presence blocks, 102 to 116 words each)cognition/deliberation_prompt.rs6 (TOOLS_INTRO233 words,ACTING_BLOCK215)kernel/sdk_codegen/ai_help.rs2cognition/.../prompt/newest_result.rs2build_persona_system_prompt.rs1 (196 words)Known gaps (inference, not measured)
#![cfg(test)]still read as production, for exampleresource_admission/aging_tests.rs. This is a lexer gap that predates this PR.vitals_emitter,positron_live_source) are not caught by the re-read list.Measured
Branch head 3ddb337, based on canary e14d6d6, measured 2026-11-07 on the M5 (cargo serialized at nice 19):
cargo test -p source-hygiene: 104 passed, 0 failed (lib run 6.0 s).cargo run -p source-hygiene --bin ratchets -- origin/canary: exit 0. Base equals head for every ratchet:polling_sites68 → 68,string_id_fields395 → 395,hand_rolled_short_ids27 → 27,prose_literals32 → 32. All other ratchets are unchanged.an_added_poll_is_counted_and_a_pacer_is_not,an_added_string_id_field_is_counted_and_typed_ids_are_not,each_hand_rolled_form_is_counted_and_the_owner_is_not,added_prose_is_counted_and_labels_and_logs_are_not.Do not merge without review.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo