Skip to content

Latest commit

 

History

History
291 lines (208 loc) · 67.3 KB

06-rules-by-change-class.md

File metadata and controls

291 lines (208 loc) · 67.3 KB

Rules by change class

Imperative rules per change class: tool registration, skill payloads, live E2E, light mode/deliverables, retention, delegated subagents, cancellation, onboarding/settings, transport and late-result custody, LLM calls, timeout/wait control, and loop/result-review state machines. Each section names its invariant's home (the home test or the product owner) or marks the rule review-only, citing ARCHITECTURE for mechanism instead of restating it. docs/CHECKLISTS.md remains the only reviewer scorer; its development_compliance item points at this handbook as a whole.

Tool registration and guard surfaces

  • A new Tool: export it from get_tools() as a ToolEntry with one explicit safety policy, its safety_policy or an ouroboros/safety.py::TOOL_POLICY entry (which outranks it): skip for trusted built-ins, check for opaque/outward-facing ones. Declare its capability class in ouroboros/tool_capabilities.py. A child profile gets it only when that narrower principal should.
  • A tool writing the repo working tree also joins _ROOT_ARG_REPO_WRITE_TOOLS and canonicalizes its target paths (_PATH_NORMALIZED_TOOLS for a top-level path; _payload_write_paths plus protected_repo_write_paths for payload-borne ones): visibility checks pass without the write guard, so tests exercise the real guard chain (ARCHITECTURE §6 "Tool capability and execution").
  • Forwarding host wrappers take their own arguments positional-only; never rename or denylist a public tool keyword to avoid collision (tests/test_pause_forwarding_names.py).
  • Read-only producers report admitted absent targets as typed misses only after query, confinement, runtime and protected-artifact checks; denials and bad content remain errors (tests/test_discovery_miss_warnings.py).
  • New memory/data files: decide in the same change whether they enter LLM context (context.py).
  • One rule each: ToolRegistry._builtin_hidden, built-in visibility (test_tool_visibility_golden.py: regenerate it only for an intended visibility change, named in the PR); workspace_copies.protected_write_admitted, protected body paths at dispatch and apply doors (test_isolated_copy_corrections.py).

Enforcement: CHECKLISTS items 11(g), 13 (tool_registration) and 22 (context_building); ouroboros/tools/registry.py (public schema), tests/test_safety_policy.py (one policy per tool).

Skill repair and payload lanes

  • Repair is ordinary managed development carrying the selected skill, source request and admitted revision; Repair-and-run is a real owner message on the ordinary task path. The model enabling the repaired skill resolves that source, never a client allow_enable flag; a later direct owner disable wins; a load-error revert is not one. skill_repair records are selectors, not a reduced tool profile.
  • Installed payloads are ordinary directories; a delegated Git copy is optional. Check the known revision before an operation and record the observed revision after opaque process work without claiming authorship; no long shell lock, no automatic rollback.
  • Every path form uses the existing payload binding owners: a valid TaskConstraint supplies omitted skill-name/bucket selectors, and explicit selectors must match the physical payload.
  • Review, grants, package readiness, enablement and execution are independent facts: one seam readies packages by what admits the bytes (skill_dependencies.py); a dependency or load failure never rewrites the verdict. review_round/snapshot_attempt are display ordinals.
  • UI, CLI and task tools call the shared operation owners. Actor identity is host-derived: an owner-only action needs a real member chat/quiz/mailbox source naming the exact skill, revision and items; a synthetic reference creates no permission, and Repair implies neither grant-all, attestation nor deletion.
  • Test the real installed script/tool/HTTP/widget/companion after review and prerequisites, repeat after corrections, inspect a widget screenshot. Execution receipts name the dispatched revision and are not PASS.
  • A bundled payload change bumps that skill's manifest version; a change to seed reconciliation semantics invalidates the native_seed.json receipt's schema (ARCHITECTURE §2), and the receipt never replaces review/grant binding to installed bytes (tests/test_builtin_skill_platforms.py: unchanged boot without payload work, new versions, dirty source, failed phases).

Mechanism: ARCHITECTURE §13; §6 "Skills and extensions". Enforcement: tests/test_skill_payload_binding.py, tests/test_skill_lifecycle_actions.py, tests/test_review_skill.py.

Capability placement

Skills survive core updates untouched; private core edits need re-merging. For any new capability, whether requested by the owner, a user or myself:

  • Name the lowest rung that delivers it and offer it first: a setting; an arrangement of what exists; a declarative contribution (contributes); skill code (routes, tools, providers, page modules); a core seam. Offer the lower rung even when the request names core; build the higher one when the requester, informed, keeps it.
  • The core is open for extension and closed for features: it keeps the seams and the floors every rung relies on (the draft, Send and message authorship, device leases and native permissions, host-owned sessions and cognition, Panic and recovery). Vendor- or feature-specific code in core is a defect unless the plan names the floor it implements.
  • A new seam ships with its first real consumer in the same change; no seam without a consumer, no consumer-shaped seam. Core consumes the contract, never a skill's name. A shared provider contract (speech, realtime …) is minted only when more than one provider is plausible, consumers must not care which runs, and core owns selection; a fallback is never silent.
  • On an installation that evolves itself the wish becomes a skill, and a missing seam is offered upstream as a pull request instead of living on as a private core patch.

Judgment, not a gate. Review: CHECKLISTS Plan row 6 and capability_placement (advisory). Mechanisms: CREATING_SKILLS "Contributing controls and speech engines" or "Declaring a place, tool effects and an icon"; CLIENT_CONTRACT §11.

Extension dispatch and isolated dependencies

  • A type: extension skill with a reviewed isolated dependency env or a payload-native marker (.so, .dylib, .dll, .pyd) never imports plugin.py or runs handlers inside server.py, even when the dependency tree looks pure-Python: extension_process_runner dispatches it in short-lived child processes; only no-dependency pure-Python extensions use extension_loader's in-process PluginAPI. Containment, not admission: a native payload still faces skill review.
  • A child crash, invalid JSON, timeout or abort answers as a normal tool error, HTTP 502 or WS log message; a child SIGABRT is a handled extension failure, not a server crash. Add no host-process fallback importing native-risk modules.

Only workers reuse a catalog run, per source identity, never by time; a failure is never recorded (ARCHITECTURE §13). tests/test_extension_boot_cache.py: a second birth makes zero copies and catalog children, changed inputs invalidate only the affected extensions; isolation: tests/test_extension_process_runner.py.

Declared skill resources and builds

  • Exact downloads and literal build/check argv reuse the isolated dependency owner: a new declaration needs a fresh executable review and hash-covered specs; the pinned payload is revalidated before its processes launch.
  • Only an explicitly declared check, not package-manager success, proves the requested function. Resolved versions, hashes and diagnostics go into the existing dependency records; verified caches stay outside the replaceable payload/env.
  • Keep wheel-only and npm ignore-scripts unless the entry opts into the build action. Large downloaded or built resources belong to the isolated dependency path, not a giant source patch.
  • Deno flags express the script's current effects and the task's network constraints, not new grants or a stronger claimed OS sandbox.

Mechanism: ARCHITECTURE §13. Enforcement: tests/test_skill_install_resources.py.

Task contract resource policy

  • Outside Cyber Pro, resource_policy.protected_artifacts is execute-only: the declared path may run as a black box; byte reads, copy/hash/static introspection, tracing and debugging of it are refused (ARCHITECTURE §6 "Safety and runtime mode").
  • Acceptance claims (acceptance_claims, the task-success claim grammar) are bounded advice, never gates or taxonomies; success_criteria is an input alias; children receive only claims explicitly passed via schedule_subagent. The result review's ask lists the effective claims as text; a reviewer's finding names the concrete gap and its place, and no host path parses a claim id out of it or re-executes anything to grade it (ARCHITECTURE §6 "Result review", §11.1).

Enforcement: tests/test_acceptance_claims_wiring.py, tests/test_protected_artifacts_policy.py.

Skill-defined Presence

  • A place is the owner's: a connector declares provides: place and per-tool effect/target in its manifest; the owner's choices live in the host place record (places.py), never in the payload, and a connector update never overwrites them. Wake matching reads typed provider facts, never message text.
  • A focus has consciousness authority (autonomy level, allowance, Safety at the consciousness level), not a per-place ceiling: Silent/Paused and Advises are refusals at the one dispatch guard from declared tool effects (place_guard.py), and the automatic reply passes the place_reply check. Old ceilings stay decodable only for retained work.
  • Admission is host-owned: a transport token reaches only places of its exact connector, whose provider/account/conversation/thread must match; identities are never recovered from message text (turn flow: ARCHITECTURE §12).
  • Each admitted event runs a fresh agent under a deterministic binding-plus-source-event task id, a cross-process state-root-wide turn cap and per-conversation serialization; the transport's durable custody owns arrival FIFO. Add no transport-specific scheduler, memory silo, core outbox or resident cross-room agent.
  • Descendants (start_task, schedule_followup) copy the Presence carrier, admitted workspace and ceiling by value or refuse; destination="owner" starts copy none. A Presence caller reaches only its binding's roots (read/steer/cancel) and follow-ups (read/withdraw: queue_schedules.presence_promise).
  • Knowledge-topic and scratchpad mutation each serialize on one stable lock: concurrent owner and Presence turns never overwrite a newer projection with an older render.

Enforcement: tests/test_presence_admission.py; provider-adapter E2E is separate evidence.

Devtools isolation

devtools/ is tracked operator code outside runtime package discovery and the import graph: runtime modules, server.py, web modules and build scripts never import it; generated outputs live in an explicit external root, never in repo/ or live data/; domain methodology lives beside the devtool, not in core governance docs. Review-only (ARCHITECTURE §1 "Devtools boundary").

Live E2E stand (devtools/e2e_live/)

python -m devtools.e2e_live.run_live_lanes runs owner-shaped SM1/SW1/SK1 on isolated real servers; stub_lane.py uses tests/system_e2e/harness.py's loopback model/review answers for --stub. The rule binding runtime changes: keep this opt-in stand outside runtime imports and default local evolution. Operator manual: devtools/e2e_live/README.md.

Scenario acceptance

Judge durable artifacts and real consumer observations, never model prose or an HTTP 200 alone (devtools/e2e_live/README.md#scenario-acceptance).

Seed and settings

One admitted, clean, detached seed; settings from the tree's defaults plus explicit stand knobs, never the owner's live settings; the provider key by environment name only (devtools/e2e_live/README.md#seed-and-settings).

Budget admission and ordering

Admit an attempt only while settled spend, in-flight reservations and its own reservation fit the run cap, FIFO by dispatch index; run_live_lanes.lane_spend reads state/usage.sqlite (the journal only for an older seed) (devtools/e2e_live/README.md#budget-admission-and-ordering).

Self-modification and browser lifetime

--self-mod is opt-in; only SM1 owes the real re-exec/absorb proof, which liveness alone never passes; the browser client reopens across a restart on the lane thread (devtools/e2e_live/README.md#self-modification-and-browser-lifetime).

Reports, focused verification and CI

Run roots are append-only outside repo/ and live data/; the focused contracts are tests/test_e2e_live_* plus tests/test_server_runner_absorb_wait.py; the e2e-live CI job runs only on an explicit e2e_live=true dispatch (devtools/e2e_live/README.md#reports-focused-verification-and-ci).

Light mode and external deliverables

  • Light refuses repo/control-plane mutation while building external deliverables (ouroboros/config.py; ARCHITECTURE §6 "Safety and runtime mode"). Canonical runtime READ aliases must preserve fork-relative bytes, explicit roots, task/Presence restrictions and write ceilings. Verify emitted context readers through real dispatch (tests/test_canonical_runtime_reads.py, tests/test_authored_memory.py), not a duplicate permission predictor.
  • Flow: task_drive scratch, artifact_store canonical result, user_files visible copy (ARCHITECTURE §6 "Tool capability and execution"). user_files writes and declared outputs register captures. Same-name replacement keeps recovery history; changed directory members keep distinct ledger/ZIP pairs. root=deliverables is read/list/search-only for all actors.
  • Task files stream (artifacts.stream_artifact_file, atomic copy_artifact_file), never a whole dataset in a bytes object; a changed file or missing member is an explicit capture failure. Blocking HTTP admission and materialization run off the event loop (gateway._helpers.run_sync_to_completion); a cancelled HTTP waiter never cancels the admitted task. send_file uses immutable captured names, so an earlier delivery URL never aliases a later rewrite. Inputs stay outside deliverable inventories; the inline preview never replaces the full attachment_manifest_ref (ARCHITECTURE §1).
  • scratch=[...] and outputs=[...] are distinct channels: scratch is ephemeral in-cwd verification, exempt from the undeclared-output audit, never an artifact, adopted only with a declaration-time sha (artifacts.record_task_scratch), never in the workspace patch; the audit verifies candidates post-exec by stat, so a path mention is not a write (ARCHITECTURE §6 as above).
  • cwd defaults to active_workspace; light scratch/services need explicit task/artifact/external cwd; scripts honor it. Explicit stop and normal completion export declared outputs; kept/unconfirmed services and Panic bypass export. Test original Docker addresses and native ZIP names through consumers (ARCHITECTURE §6 as above).
  • Outside Cyber Pro the default shell lane carries target-aware git policy (git_shell_policy.py): commit_reviewed remedies self-repo changes; git init/commit/push in an external project tree is ordinary task work.
  • Renames stay callable but hidden (ToolEntry.alias_for) or retire into TOOL_NAME_ALIASES (saved names resolve, uncallable). registry_guards._disabled_tools pairs aliases and splits narrow forms; Presence grants of consolidated names never migrate (tests/test_tool_facade_boundaries.py). Payloads use root="skill_payload", bucket, skill_name. _RETIRED_GITHUB_TOOLS keeps a disabled GitHub name as restrictions on its successor's methods. run_ci_tests has no alias. Golden tests must prove each supported target through final outcome; tombstones prove removal only; dropping a class needs owner acceptance naming the lost outcome. Uploads, skill payloads and owner state are not artifact transport.

Enforcement: ouroboros/tools/shell.py (cwd selection and what light refuses), tests/test_tool_api_v2_public_surface.py (capture/reuse/history), tests/test_deliverables_layout.py (placement), tests/test_git_shell_policy.py; successor parity and artifact transport are review-only.

Own-body candidates and adoption

Mechanism: ARCHITECTURE §6 "Own-body candidates" and §2.

  • One identity. A consumer of the body root reads ctx.repo_dir / system_repo_dir_for (the candidate when bound); only what must describe the running body (review governance, the restart marker, rollback) reads body_candidate.serving_repo_dir_for. Never rebind Env; never give a candidate workspace-mode authority.
  • Prepare before effects, by seam: a new body-writing tool joins body_candidate.authoring_seam. Never classify command text or infer a candidate from a room, name, date or PID; ownership moves only from a terminal task record whose ledgered processes are dead (live_lineage_processes).
  • Attribution is the lineage's own baseline (mutation_attribution.capture_mutation_baseline); the commit gate resolves attributed paths on ctx.repo_dir with no candidate bypass. A process inside the candidate or an admitted own-body child copy gets its isolated environment or a typed refusal.
  • Retention never deletes unique work on age: extend unique_work / _preserve together, an incomplete capture retains the directory, and a GC verdict computed outside the record lock applies only while verdict_holds under it.
  • The old generation never writes the serving tree for an adoption: arm only from the existing stop owners' outcomes (PID census, stop_owned_work's ownership set, reaped children); add no wait, drain or PID probe, nothing on the Panic path. Boot settles adopted only for a process that attested the switched tree before its imports (sys._ouroboros_body_generation).
  • The hook in ouroboros/__init__.py and body_switch.py stay stdlib-only and compatible with the helper an older body captured; a body without the hook receives it via an ordinary release, never by adoption.
  • No generic adoption reset (holds_checkout covers landed, returned and open transitions); returning files never claims restored dependencies. Preserve the loaded-generation handoff contract in ARCHITECTURE §2.
  • Candidates are not auto-pushed. Permitted serving/adoption pushes send only the operation-created tag, never backfill; selected adoption withholds branch and tag (§14). The gate reads numbered/development_marker/neutral from the diff (neutral_allowed for prepared index and bound candidates); partial carrier moves are findings. Recovery grants no adoption authority.

Enforcement: tests/test_body_adoption.py with tests/test_body_candidate.py. Not exercised there: Windows handover, the packaged launcher's frozen code, a native Android host, an end-to-end commit_reviewed with live reviewers on a candidate.

Runtime cleanup and retention

  • Age-based GC of disposable runtime artifacts shares one owner knob, OUROBOROS_GC_RETENTION_DAYS (default and clamp: ARCHITECTURE §7), and the ouroboros/retention.py helpers (age_cutoff, clamp_retention_days, get_gc_retention_days); no hand-rolled cutoff math. Prune functions take retention_days= (default: the knob); server_maintenance.py schedules them.
  • A subsystem with its own lifetime passes retention_days=; an owner-settable one is an ordinary OUROBOROS_<SUBSYSTEM>_RETENTION_DAYS in SETTINGS_DEFAULTS clamped by clamp_retention_days. Never restore the consolidated keys or keep a knob that deletes nothing.
  • Each disposable plane's retirer (storage_removers.PLACE_REMOVERS) reports through maintenance_jobs.pass_report/record_pass (ARCHITECTURE §10 invariant 32), classing holds by its own reason words: an unreadable row or busy lock is a hold, never a pass error; the term's wait is no hold.
  • Durable artifacts are never age-pruned: genesis projects (OUROBOROS_SUBAGENT_PROJECTS_ROOT) and forensic observability blobs (packed, never deleted or counted).
  • Test scratch lasts while needed: a test's folder goes only on its processes' proof, never on its exit alone, and one marker never holds a whole root (ARCHITECTURE §9 "Test runs").
  • Review continuations are recovery state, not disposable GC: archive a record (collision-safe move, never delete) only when its owner task is settled, it stayed un-resumed past task_continuation.RETIRE_SETTLED_CONTINUATION_AFTER_DAYS and no obligation mark of it awaits a landing; doubt or a move error keeps it live.

Enforcement: ouroboros/retention.py (knob and cutoff math), tests/test_observability_retention.py (preserve indefinitely), tests/test_test_environment.py and tests/test_test_storage.py (test scratch), tests/test_retirer_holds.py with test_persistence_lifetimes.py::SERVER_RETIRERS (each retirer both ways), cost contract B7 (rest law); the continuation archive rule is review-only.

Live subagents

Mechanism: ARCHITECTURE §6 "Delegated subagents (Claudexor transport + the nanny)". Review gate: CHECKLISTS items 16 (subagent_isolation), 19 (delegated_transport).

  • Only schedule_subagent schedules (delegation_role=subagent is refused at the gateway task route and the CLI); schema/handler share control.schedule_subagent_properties(); child needs use the capability enum, not contract fields/prose. subagent_id selects a full OUROBOROS_SUBAGENTS row admitted by both enabled axes; dispatch uses its scheduling snapshot; no second selector, host ranking or substitution. Redelivery of an exact task id with live/durable custody is a no-op.

  • The parent's substrate binds; auto-start fresh work only; saved supervision restores before leaf admission, without probing or replaying a pending POST; keep local handoff authority checks: unobserved liveness is not readiness or loss. Stage shown wake exposure before saving; ACK externally only after incorporation; add to _DEFINITE_UNRUN_REASONS only proof of no run. Zero-run receipts remain incomplete | unknown; no silent substrate fallback.

  • Work orders carry the full assignment and host authority, without size cutoffs, forced question/file transport or duplicated objectives; redacted reviews never replace original requirements. delegate_start_instructions.access_instruction states typed native access once; per-call access only narrows it, never derives it from prose. delegate_message uses the operation catalog and route liveInput, not a harness name; its host-minted message_id is the Idempotency-Key, reused only after delivery_unknown, no retry/stall machinery; the host's own placement of an owner row uses the same catalog and frame store, as a frame carrying owner_words.

  • subagents.route_health is every consumer's route reader; quota readers project one ClaudexorGateway.quota_state() envelope; a fully-used ratio without a valid future reset neither refuses dispatch nor certifies quota: final admission is the engine's. Lifecycle facts are visibility only (the result review judges quality, never the route); an unreadable custody log reads evidence_read_failed, never proven-empty. The coordination poll only reads task state and writes nothing beyond the canonical usage-ledger reader's bounded maintenance; every ledger state, absence included, goes through that reader (usage_attempts.lock recovery: ARCHITECTURE §1 "Platform substrate"; pre-send policy: _usage_wait.py).

  • task_constraint booleans parse strictly ("false" is false); deadlines only narrow, delegation budgets only reduce, persisted depth facts are never recomputed from current Settings. active_tool_profile fails closed to read-only, never to self_modification/operator_control; an explicit read-only assignment stays so; live memory_mode=shared stays disabled. The Cyber acting-tool catalog and the subagent browser boundary: CHECKLISTS item 16 and ARCHITECTURE §6 "Tool capability and execution".

  • Acting children may ask review_change about assigned work, not approve/commit/integrate (test_review_change_child); the immediate parent stages via integrate_subagent_patch, lands body commits via commit_reviewed. Native succession grants no child control; test its entry (test_continue_successor_integration; ARCHITECTURE §6). Capture bases prove no authorship (vcs_read diff). One reducer owns canonical/replica terminal fields; test stale replicas at both seams. Custody consumers name covered owner kinds: RunCustody.review_owned stays panel-owned and alive through author finish. Git/payload edits stay private until integrate_delegated_patch (not an explicit in_place writer's). Separate orphan geometry/current rights: copy_apply_refusal checks the recorded target, not caller's folder (test_orphan_apply_authority). Each copy mechanism names its job, the fault it prevents, its size on a small install and its remover; a new kind gets plan review.

  • continue_from enforces the four floors of delegate_continuation (recorded task line, observed terminal, no ambiguous apply, access not wider) plus typed snapshot and engine refusals (ARCHITECTURE §6 "Nanny verbs and continuation"); other facts are advice in the child's prompt, never gates or instructions.

  • Outcome honesty: ending while direct children run is told once and records degraded; finished undecided children are details. control_task_results._wait_for_tasks owns the batch-compact projection (ARCHITECTURE §6 "Child reads and waits"; view=full: settled children whole). Push/live events are wakeups, not terminal authority: a lifecycle change exercises lost/reordered terminal frames.

  • Ordinary-directory sessions use the engine-owned file work product: keep the parent-selected direct/copy strategy, never initialize Git or change run mode as a workaround, carry full file artifacts beside source patches (deletion included: an empty text diff cannot certify no work), apply via the engine CAS, retain unselected results, never relabel direct effects or a discard as an undo.

  • Vendor maintenance trusts engine actions/comparison and catalog sourceProgram, never vendor-name policy or task replay (§6). Preserve unknown-submit/cancel custody and dated local-only context facts. Home tests: test_harness_maintenance_{host,transport,browser}, test_harness_program_facts, test_model_chooser_browser; assert 1/18 accounts at desktop/phone widths.

  • Writable access without product-write authority is private, evidence-only investigation. Integration/debt use delegate_registration_policy.candidate_apply_possible; Continue uses independent_review_without_apply, not path/label guesses (tests/test_investigation_custody.py).

Enforcement: tests/test_acting_subagents.py (profiles and creation), tests/test_delegate_continuation.py (continue_from), tests/test_review_session_ephemeral_scope.py (one-shot registration), tests/test_delegate_message.py (live messages and the host's placement).

Cancellation and effective status

Mechanism: ARCHITECTURE §5 (supervisor/queue_transitions.py, supervisor/cancel_publication.py, supervisor/owner_stop.py); ARCHITECTURE §10 invariants 14-15.

  • Effective task status belongs in ouroboros/task_status.py; never duplicate child-drive merge or terminality logic in gateways or tools. Waits use SETTLED_STATUSES, structured facts and queue-heartbeat freshness, never keyword matching. Read queue documents only through queue_observation.load_queue_document: rows may carry $shared references.
  • wait_task, wait_tasks and await_messages peek the waiting actor's own mailbox via the transport-wait reader: early return for pending mail is disclosed without ACK or stopping children; the round-top drain delivers and ACKs; only a proved-empty mailbox is retained, a read failure or torn data is neither proof nor cached.
  • Terminal quiz reconciliation closes the paired wait even when the answer arrived before worker capacity; a failed loop without captured evidence reports unknown counts, never zero work or an unverified checkpoint.
  • task_status.observe_cancellation_target precedes intent writes and reports physical target, result/queue freshness and delegated custody separately; caller reason and request origin differ: HTTP ingress proves no personal owner intent. Preserve cancel_origin through publication, history, cards and conditional result reads; unknown actors stay unknown; keep the whole reason, labelling a shortened form a preview. Unconfirmed terminal sends are disclosed as "not confirmed", saved copies named as copies; only a same-delivery receipt for the recorded destination retires the notice.
  • Cancel intent is never a status value: every cancel ingress writes a durable intent via ouroboros/cancel_intents.request_cancel, fails closed if that write fails, checks live physical ownership (a settled result is not a dead worker) and keeps the recorded scope widen-only. Natural completion wins a late cancel (discarding is the parent's separate discard_child_result); timeout reaping is not a cancel ingress. The intent and delivery registries read strict to rows and task_done validates via the durable result; only interrupted keeps its restore-path exemption.
  • stop_policy is an axis on the durable intent; owner hurry stays ARCHITECTURE §5's task-local control. Every same-id requeue producer calls the one shared owner_hurry.retry_reset; the hurry projection writes only via update_json_locked on owner_hurry keys, never write_task_result; UI surfaces share web/modules/task_control_menu.js, terminal rows win.
  • Keep cancellation, terminal-delivery, pause-notice and usage recovery off supervisor drain with independent single-flight duties; test their interleavings through existing claims/receipts and generation checks; local keys deduplicate dispatch, never own durable effects. Do not serialize unrelated Stop/delivery behind history work (ARCHITECTURE §5).

Enforcement: ouroboros/cancel_intents.py, tests/test_cancel_origin.py.

Onboarding and Settings surfaces

ARCHITECTURE §2 owns wizard steps, completion and install proofs; §3 Settings, accounts and shared controls. Copy is review-only; layout: test_onboarding_layout_browser.

  • New participants resolve their current room. Cognition survives Resume (test_project_cognition_runtime); review and catalog stay task-private. Never publish room overrides to env. Routes: ARCHITECTURE §7. Writers, grants, skills and process refs read current disk without our old env mirrors. Cyber follows effective Access; permission is not a verdict.
  • One wizard host, the GET /onboarding page, serves subscriptions, API keys and mixed installs; its frame keeps the allow-popups allow-popups-to-escape-sandbox sandbox tokens, without which the sign-in click is blocked silently. Completion stays one transaction and the client completes only on the exact success envelope (ok/runtime_mode/restart_required; ARCHITECTURE §2), because a silent success discards the restart receipt. Only declared raw-model sources supply Main, never agent-only connections; "Without an API key" never means free.
  • Settings keeps no page draft: a row or an editor writes its own keys through the one writer (ARCHITECTURE §3) and refuses its own invalid value. Saved intent, generated drafts and live status are different axes: a status/catalog failure annotates, never erases, a loaded row; only an Agents edit, the wizard or Colab authors a generated or factory catalog; a late preview never absorbs owner edits.
  • Every editor built on model_chooser.js shares suggestions, keyboard and provenance; routing authority stays with its caller. Source/model/account pins survive save/reload and catalog failure; metadata names the credential harness. Delivery follows surface/reference: sessions retrieve, API rows retain saved delivery (native default; review_native_episode.py); model/account edits never select Packet.
  • One capability, one home: a settings key has exactly one row, and task actors and the review pool are one OUROBOROS_SUBAGENTS list in Settings → Agents (web/modules/subagents_settings.js; ARCHITECTURE §3), the Reviewer mark (review_eligible) and an API row's delivery row fields, never a second editor. Name a row by its route-derived handle, never a stored label or ordinal. Routes serialize api_model + credential_profile_id via the neutral primitives (route_editor_primitives.js); an empty managed pin means engine rotation; saved-but-undiscovered choices stay visible and editable; a compound effort slug plus a conflicting separate effort is a validation error. Owner switches expose semantic choices: OUROBOROS_ALLOW_MUTATIVE_SUBAGENTS shows Off / Auto / On, Auto being the unset default, saved empty (config.get_allow_mutative_subagents).
  • Install-time defaults compile from live discovery with typed refusals: never guessed, half-applied, re-derived after onboarding or decided on a moment-in-time reading. Compilation stays linear and split by semantic owner (ouroboros/subscription_install_presets.py); API-only/local-only compilation makes no Claudexor reads; POST /api/onboarding/subagents/preview is the read-only compiler surface. Agent sign-in consumes the harness row's setupLogin as four states (absent, null, a valid object selecting in_app or external_terminal, malformed data as a gap), never a harness-name branch; external-terminal commands use claudexor_daemon.py. Additive response fields keep their JSDoc twin (Gateway Boundary Pattern).
  • Owner settings writes go through gateway/owner_settings.py (lock-as-precondition and CommitBoundary: ARCHITECTURE §1 "Gateway Boundary v1"); pre-commit refusals answer via unsaved_error; owner_write_guard belongs only on endpoints calling _owner_update_settings (directly or via _owner_write_settings), because elsewhere it advertises a lock the endpoint never takes. An endpoint-authored setting is disk-only in both directions: the loader, environment projection and generic save's merge skip-list consult config.ENDPOINT_AUTHORED_SETTINGS, so environment values cannot close the install-time window before its endpoint runs.
  • A control the owner cannot use is worse than none: with no agent subscription the panel shows truthful configured API or local actors and the session chooser points at Accounts, never inventing a route; a saved unavailable session stays visible and dispatch returns its typed refusal, never an API fallback. Harness lists come from one catalog path (accountRows over /api/claudexor/status; pins via indexProfilesByHarness), so a pin option bears exactly its Accounts name. Owner-facing copy says "agent", never "coding agent"; product names stay verbatim.

Enforcement: tests/test_owner_settings_write_seam.py (write seam, endpoint-authored settings), web/tests/settings_rows.test.js and web/tests/settings_one_writer.test.js (one row per key, one writer), tests/test_onboarding_model_sources.py (wizard sources), tests/test_gateway_parity.py (TypedDict mirror).

Transport and late-result custody

  • LLMClient.chat/chat_async: Main streams; callers subtract reserve once. caller_deadline_ts ends sends and accepted-operation waits; helpers use caller_dispatch_deadline_ts for send windows. caller_execution_deadline carries execution time; socket phases narrow to the remaining bounds and never bound wall time.
  • Stream consumption completes inside physical accounting (ARCHITECTURE §6 "Caller-owned subscription model calls"): an EOF, error or cancellation retains private wire evidence and yields no usable partial answer; only a structural parameter rejection uses wire recovery; a retry is never inferred from missing stream text or ping cadence. Local, GigaChat and Claudexor keep separate wire contracts.
  • Late reviewer reuse resolves the exact operation's complete producer receipt from the existing CAS (ARCHITECTURE §6 "Late completion and typed refusals"); paid settlement is recorded once; missing, partial or mismatched custody buys no second same-operation dispatch.
  • Unknown-outcome recovery is typed (loop_transport.new_generation_after_unknown); ARCHITECTURE §6's rails table owns its order. The old outcome and cost stay unknown; new attempts get their own identity and facts-only input; a control-link or read failure only rejoins (same_operation_recoverable); no scheduler, pass counter or paid probe.
  • The body alone follows held runs; delegate_wait's wake reads one detail, never a journal. A retryable read hole proves no run failure; the body owns engine-unreachable episodes (ARCHITECTURE §5–6). After terminal cleanup the custody host notice accompanies the original answer; builtin refusals publish typed non-success at their producer; acceptance JSON validity and completion cleanliness stay separate decisions.

Enforcement: ouroboros/loop_transport.py, tests/test_review_late_cas_recovery.py. Use isolated preflight; fake-provider checks do not qualify live providers/renderers.

LLM call rules

ARCHITECTURE: subscription transport (§6 "Caller-owned subscription model calls"), accounting (§6 "Budget tracking", "Usage ledger substrate vs. accounting policy"), route contracts (§6 "Context fitting, retry, and compaction"; DEVELOPMENT §2 "Provider Independence").

Subscription transport

  • Claudexor preserves model content and native continuation bytes: no credential injection, tools, adapter compaction or silent regeneration. A lost control reply rejoins the same operation ID, and an unknown outcome stays unknown, because a second generation can double-charge. Only the engine classifies model substitution — no host model-string matching — and a local rejection never rotates accounts (only the engine's retryOnOtherAccount grant allows one correlated retry). A complete but unusable terminal settles as stream_rejected, never as unknown or not-dispatched, across sync, async and process boundaries.
  • Caller hints name capabilities; an explicitly unsupported option refuses. Record the submitted options and the provider's appliedOptions echo; an absent key stays unknown. Effort appears in usage, events and Logs, never as automatic chat, toast, incident or a mismatch gate.
  • effort_evidence.py validates effortResolution (effort_resolution) and native prompt_cache_ttl; gateways/claudexor.py reads the unique final session telemetry attempt. Null submitted means omitted, not none; gate promptCacheTtl by harnesses[].promptCacheTtls, and keep engine effort tokens in engine order.
  • The engine's active-turn token is transport, owned by the caller's llm_claudexor.ModelTurnState slot; only the engine boundary writes it. Never derive it from messages (BIBLE P5), copy it on reprepare or offload, checkpoint it, or publish it in usage, events or cards. Opt in by the last successful handshake version, never a next-spawn pin or a failed probe (ARCHITECTURE §6 "The live turn slot"; llm_claudexor.py docstring).
  • Pass model_role and the captured account at every helper and reviewer seam: shared model names share no pins, and account evidence stays source/profile/fingerprint-bound. Manual context sizing grants no scope authority; ACK binds the actual route; density evidence never crosses models.
  • A resource refusal (not the install's own queue, where a send waits) tries configured routes first, never sleeps to a reset, and waits inside the live call on the existing task owner, mailbox, clocks and settings writer; a reviewer call waits in its panel's operation wait. Reprepare wake input from canonical messages against the new route's tools, capacity and image policy. No parked rounds, compensation processes or replay of completed tools and reviews (ARCHITECTURE §6 "Quota and auth waits").

Call sites and accounting

  • Stamp every new physical Main candidate before measurement, pricing and sealing; same-invocation bytes and consumed history (clock line, a recovery send's omitted reasoning) stay fixed (tests/test_send_clock.py). Direct Anthropic shares OpenRouter's one-shot reasoning-strip retry; only a successful retry records the omission.
  • New LLM calls go through the shared LLMClient/llm.py layer — no ad-hoc HTTP clients or provider SDKs outside it (review gate: CHECKLISTS item 11(e)). Exception: skill/extension plugin.py modules may call providers directly.
  • Canonical messages and tools stay function-shaped (§2 "Provider Independence"): a dialect is an outbound projection plus inbound normalization, never a second compaction/replay contract; custom-origin receipts stay private and catalog-bound (request_wire_custom_validation.py). Enforcement: tests/test_request_wire_contract.py; the dialect ladder and usage.request_wire: ARCHITECTURE §6 "Context fitting, retry, and compaction".
  • Every core-mediated physical provider send goes through usage_accounting.execute_physical_attempt[_async] (tests/test_usage_accounting.py). Custody classifiers read the explicit __cause__ chain, never __context__, because implicit chaining would turn a timeout into proven non-dispatch; an ambiguous timeout stays unresolved (tests/test_transport_custody.py).
  • Abandonment never turns a bound into a price or erases the original failure. Only the explicit source command GETs OpenRouter generation prices. Transitions, late corrections and custody: docs/USAGE_STORE.md, tests/test_usage_abandoned_ledger.py, tests/test_openrouter_accounting_evidence.py, tests/test_openrouter_transport_evidence.py.
  • Money transactions contain only checks/transitions. Positive contention/publication churn retries the same proven-unsent claim after rollback outside outer locks; sender errors never replay. Admission-only no-wait context ends at physical handoff, preserving explicit caller budgets. Permission/corruption and unknown handoff stay distinct; reserves remain explicit, stale projections never admit (§6; tests/test_admission_contention.py).
  • Read global limits live through their resolver, never a per-task capture; root ceilings remain unreserved. Thresholds and facts share a dated reading: tree known spend with holds apart, shared headroom against starting headroom (neighbors included), no strategy from durations (tests/test_round_facts_line.py, tests/test_budget_resource_facts.py). Keep the loop's CostCeiling and explicit-profile wrap-up's cache-aware reservation (tests/test_network_budget_wallet.py). Post-task consumers share one frozen usage_breakdown per root subtree; failed reads are unknown, never $0. No second ledger or reconciliation LLM.
  • A runtime notice after the first turn is a [SYSTEM NOTICE] user notice, not a new role=system message; the marker's second meaning, the leading system message's declared mutable blocks: ARCHITECTURE §6 "Prompt caching".
  • Cache-friendliness invariant. Stable governance/contracts precede mutable evidence; clocks, hashes, counters, IDs, estimates and actor paths stay outside the shared prefix. Only the transport projects Main's declared stable prefix (ARCHITECTURE §6 "Prompt caching", "Caller-owned subscription model calls"): never project in a builder or widen the family by name resemblance; keep the notice header byte-stable. Breakpoints: LLMClient._normalize_payload_cache_ttl (docstring), review_execution.assert_cache_breakpoint_cap. Wrap-up keeps schemas, server-web flag and tool_choice and instructs in text: changing them rebuilds cached input; main_loop_wire_options owns payload options across lanes (tests/test_wrapup_real_send_parity.py). In Main's loop a work's start (tools, system row) is written only where the answering place holds no copy, or at a restore; a start its route still holds changes only by physics or the mind's own act. Sent history rewrites only at declared boundaries (compaction, size/output recovery, batch image eviction, a route or tool change), each counted by origin even when sanctioned (prompt_prefix_break; a stamp names only its scope); host producers (skill notes, renewals, carried owner rows) append. No generic cache/retry framework. Enforcement: tests/test_cache_optimization.py, tests/test_memory_view_layout.py; CHECKLISTS item 24.
  • Only sealed reasoning artifacts bind fallback to their endpoint (reasoning_artifacts.transcript_has_sealed_reasoning); readable reasoning stays failover-eligible across families (tests/test_llm_provider_routing.py). A model handover keeps the finalization checks (ARCHITECTURE §6 "Task lifecycle"; tests/test_authoring_handover_loop.py).
  • Review agent sessions and the native review inspection episode get the full governance prompt; never truncate BIBLE, ARCHITECTURE, DEVELOPMENT or CHECKLISTS to fit argv or transport limits (DEVELOPMENT §4 "Core Governance Artifacts").
  • Delegated (subscription-harness) work is accounted on its own ledger row via usage_accounting.record_subscription_session, never record_unmetered_external_dispatch, which drops the sessions/quota axis; a token count of None means unreported, not zero (ARCHITECTURE §6 "Delegated subagents (Claudexor transport + the nanny)"; tests/test_gateway_usage_accounting.py). A skill wave's seats are the rows of its review ledger record, with their own usage facts, never reconstructed by time or model.
  • Derive the Boolean cost_final from open-row count (non_final_rows), never from dollar-sum truthiness. A spent subscription window is subscription_window_exhausted (transient, carries reset_at), never folded into quota_exhausted, which is permanent for a billing refusal and wrong for a window whose cure is waiting (tests/test_reviewer_slot_config.py).
  • Classify before retry from the one record of the provider's answer, by a typed contract or a cited number equal to a limit declared for the route; no phrase joins a recognition list, other words go to minds, a reader model is the owner's call (test_provider_failure_reporting.py). Quota/auth/billing, hard bad or too-large requests never retry as-is (one unsent auth_changed: a new operation, ARCHITECTURE §6). Empty output-limit replies teach no window (test_output_exhaustion_recovery.py). Record retry_same_request before persisting; only llm_not_dispatched, llm_retry_deadline_exhausted or finalize_control_pending takes a proven-unsent grant back. Budget refusal cannot un-count earlier llm.chat retries. Keep transport_death_retries=0; Presence shares recovery (ARCHITECTURE §6 "Context fitting, retry, and compaction"; test_presence_round_recovery.py).

Timeout & Wait Control

  • Owner waits stay RUNNING and yield acting capacity; Stop, deadline, finite lifetime and money still bind. parked_at dates the wait; warm return keeps attempt/effects, cold recovery needs acknowledged handoff (test_owner_wait_*).
  • delegate_wait sleeps on runs: preserve immediate ready answers, marked unacknowledged replay and the result owed after wake to the first model request, after mail drain. Warm/cold parks save coverage and flush deferred ACKs; only saved whole delivery earns ACK. Run progress never wakes the model (sources/unknown holds: ARCHITECTURE §6). Legacy wait_sec is inert; no repeating timers, progress wakes or semantic stall detector (BIBLE P5).
  • Wake facts describe the actor's whole wait, not one poll. Cold release requires exact body acceptance; test dropped hints, withdrawal/acceptance races, same-author live/terminal-unsettled return, retained tree lanes and owner controls (tests/test_cold_external_custody.py). Receipt/runtime identity grants no Resume, and notification exposure consumes no result. The acked child cursor stays task-scoped.
  • Silence never permits finalization, kill or replay; keep its one dated notice per episode to the source and one waiting ancestor, and mint no host role for it (ARCHITECTURE §5; test_silence_attention.py).
  • Raw terminal model or salvage bytes stay separate from the host-authored terminal_provider_notice; a renderer never changes raw answer bytes, and a retained answer must not hide wait or unknown-attempt evidence or invite a blind rerun. Owner Wrap up is distinct from deadline/budget finalization and sends no new summary request (ARCHITECTURE §6 "Task lifecycle").
  • Transport-wait notes use the progress seam with incident=None; never infer urgency or valence from a task's prose; the frozen ToolContext.emit_progress_fn takes one argument, never an incident pair (tests/test_loop_transport_wait_interactive.py).
  • Timeout classes are separate axes. The transport timeout bounds only a dead socket (ARCHITECTURE §6), never reasoning or evidence of a stall; a session or native review episode takes only the task's true bounds (none: none), as it outlives one read; the owner deadline narrows every window; provider transport defaults are ceilings, not promises. Pool seats have no short cognition cap; plan_task and web_search size their outer envelopes for the whole session or the complete paid cascade (ARCHITECTURE §6 "Context fitting, retry, and compaction"), COMMAND_TIMEOUT_TOOLS past their child timeout (tests/test_command_timeout_contract.py).
  • An env-tunable timeout is a SETTINGS_DEFAULTS key in settings_defaults.py plus a clamped getter in runtime_limits.py; a fixed structural bound (WORKER_READY_*, EXTERNAL_PLATFORM_UPDATE_TIMEOUT_SEC) lives in runtime_limits.py alone. Both are re-exported via ouroboros.config, the sole import surface; register each env key; no call-site magic waits. tests/test_timeout_policy.py pins the clamped getters; the placement rule is review-only.
  • Pool changes preserve acting/process counts, memory admission, optional caps and warm returns without capacity grants (ARCHITECTURE §5); choose/launch share gates; memory/store reads and starts/teardown stay outside Q. Keep the conversation spare, PID/birth-bound readiness and charged reservations. Retirement alone needs a settled-local-work token (worker_process.local_work_settled); unknown defers. Stop/update/exhaustion cannot resurrect it. Test assignment, late publication, wait modes, caps 1/3/10 and PID/birth/RSS/latency against base (test_pool_admission, test_dispatch_choice, test_worker_demand*, test_worker_*_quiescence); disclose untested platforms. Starting beacons grant one fixed extension from birth; failed terminal-file writes retry, never false Done or new startup budget.
  • Order wrapper bounds provider, then killable child, then ToolEntry, using config's settlement margin. The test budget belongs to commit_reviewed; standalone preflight_review runs no tests and shares the review_change ToolEntry envelope (task/transport settlement plus finalization grace). The ReviewRequest.drain_deadline barrier may return early but retains worker custody; collection carries the reviewers' own verdicts (plan_ask.settle_released_reply for a plan ask; review_pause.settle_left_review for a change, commit or result wave its author left or stopped waiting for), never an instruction to collect, and neither path buys another panel.
  • Operations outliving logical waits emit typed cognitive_operation start/terminal facts matched by task-attempt/execution/round/call (a tool's terminal is its tool_call settlement row); these exempt only idle. A live paid timeout retains custody, never permits blind retry; late results settle the original attempt, late tool results reaching the next authorized turn as locators (tests/test_late_tool_result_*.py). An owner terminal without a deliberate verdict cannot cancel its paid run.
  • A refusal that spent nothing is a typed $0 not_dispatched row with its cause, never a verdict or a synthetic actor: a review row unstarted once the owner deadline minus finalization reserve is spent, a pending_dispatch row released at the barrier, a result review's $0 refusal (bound NOT_DISPATCHED, its signal DEGRADED, shown once and never holding a delivery again). An in-flight reviewer never counts as final quorum under either enforcement mode (ARCHITECTURE §6 "Review stack"; "Result review").
  • A returned provider response (empty body included) or a typed terminal 408/429/5xx is settled and may use the surface's bounded retry rail; dispatched/unresolved without a typed terminal stays custody-lost/no-resend. A new logical request needs a unique host-attested input the unknown one lacked: the managed upstream-recovery notice or the nanny-leaf wake in ouroboros/delegate_hold.py. A custody retry key names semantic material and an admitted cycle, never its rendered prompt; an unstarted chunk cannot authorize PASS (ARCHITECTURE §6 "Physical custody"; "Late completion and typed refusals").
  • Keep one invocation owner through the actual Future and effect-bearing callbacks, with root/task/attempt identity frozen before submission; joined owned calls need no second executor. Publish existing custody before caller escape or opaque/process/control effects; failed transfer keeps the caller until physical join. Preserve unbound/legacy fallback and independent receipts; test late holds, final owner controls/inherited deadlines and cache invalidation (tests/test_invocation_ownership.py; ARCHITECTURE §6 Owner Pause). Foreground mutators still join, never abandon on the generic tool timeout.
  • An inline executor's Stop is cooperative, never a thread kill (a lane carrier dies by pooled custody); API/thread work remains custodied until actual completion, and Panic/process termination stays independent. A delegated run with an id rejoins its durable invocation after transport failure, never POSTs twice; absent valid invocation means review_custody_lost. TTL proves no death or resend authority (ARCHITECTURE §6 Paid stamp and owner custody).

Loop and result-review state machines

The loop, delivery and result-review state machines live in loop.py, loop_delivery.py and tools/review_result.py, the root admission seal in delivery_seal.py; their mechanism is ARCHITECTURE §6 "Task lifecycle" and "Result review". The plan council keeps no state machine (§6 "Plan construction and review"). Below: the invariants a change must keep and the failure paths it must test.

Loop / State-Machine Changes

  • Task-state changes test affected producers through their next real consumer: malformed/absent facts, transient contention that clears, controls during it, false completion and replay/durable-source preservation. Audit/checkpoint rounds use the normal final-answer path only when explicitly tested and documented.
  • Keep a complete loop-local DeliveryCandidate (ouroboros/loop_delivery.py); sticky host-control provenance survives replacement. Forced resolution is pure, with no retry: the same action/answer/hash request selects complete bytes; malformed or historical controls stay private and retain the candidate. An unforced finish bypasses no pre-delivery notice, result review, safety, skill finalization, deadline, child handoff, unconditional FINAL ANSWER: latch or task-level answer protocol. Host notices stay outside answer bytes and identity; an unchanged answer never revives a superseded verdict (ARCHITECTURE §6 "Task lifecycle").
  • Plan objections are explicit and owned by their raiser: one stands until that participant lists it under withdrawn; omission keeps it (not_adjudicated), an unparseable reply changes nothing, and no vote, aggregate, author answer, other seat or quiz answer closes it. Open objections, the gate and the acceptance view are folds over the typed reply projections in plan_record, never stored verdicts; the hot gate opens no ledger file; a write never dispatches, and no host path asks a participant the mind did not name, the first body-plan ask's marked reviewers excepted. An ask's reviewer_effort orders that ask only, under row_effort's rule, passed via plan_review_slots, never a contextvar (review_change's composed panel is the one disclosed contextvar seam: ARCHITECTURE §6 "Change review on any root"). Enforcement: tests/test_plan_record.py; mechanism: ARCHITECTURE §6 "Plan construction and review".
  • Keep delivered result, unresolved tool-call evidence and the host's objective axis separate: error count alone neither degrades execution nor establishes the objective. Retain execution.unresolved_tool_errors and the cosmetic bucket, expose the no-review warning (loud leftovers) when the objective is not_evaluated, and test every verdict and the no-review case (tests/test_outcome_tool_error_axes.py).
  • A direct child result's decision is an exact-hash disposition via the existing tree_note(kind="decision") payload (type=child_result_disposition). The typed task-tree row is the sole authority; task-result disposition fields are derived reads, never a mirrored write. The SHA-256 binding means a parent cannot claim it integrated a result that later changed; deferred quiets the handoff and forces an honest degraded/best-effort terminal until resolved; the payload schema is the SSOT for the value. A child whose cancel_requested latch file is set carries intent, not outcome: cancel stays pending until custody settles it (tests/test_child_result_disposition.py).
  • Result review: review_change(subject="result") freezes host-attested parts only (request and claims, reply, produced paths, hashes and exact copies, observed_effect and verification receipts); the trace, expected output, inputs, checkpoints and queue labels stay out. Retain its text; its sha is the identity, never refreshed. Keep ARCHITECTURE §6 “Result review”'s panel and mode rules; Auto, a child and Cyber Pro compose their panel; Required fires once; an Advisory or Cyber Pro delivery after findings is informed_finish; Off still runs change review. Keep source acknowledgements, the seal at an author stop and refusal retention (tests/test_completion_selection.py); old context mail grants no owner revision. Workers never author Main's candidate or decision. Checks: tests/test_result_review*.py, tests/test_review_operation_source_closure.py, tests/test_review_operation_collection.py.
  • One completion request serves native tools, explicit review actions, Presence and pure forced extraction; retention leaves tools available. Changed criteria or material evidence make a new subject even with kept text, never old verdict authority. File/diff requests impose no commit-or-revert rule; self-modification keeps reviewed commits (BIBLE P0/P3).
  • Freeze review_evidence.task_inputs and completion_observations before cleanup (ARCHITECTURE §6 "Post-task work"): origin, the whole owner Q/A, peer provenance and canonical split-root verification receipts. Keep first/latest usable author inputs as a separate historical_author_inputs sibling, never directives or criteria. Reuse selected observations, with no live-source reconstruction, excluded-input exposure claim or failed-response anchor; prove evaluator source reads and retention after cleanup (tests/test_historical_inputs.py, tests/test_historical_input_consumers.py). Zero exit is positive, absence unknown; unrelated passes erase no failure. OWNER_DELIVERY_TOOL_NAMES counts sends, never global skill state. Transport receipts stay chat rows outside that snapshot. A review settling after the task ended reaches its room as a late mark (late_review_marks.py), never a reflection row, a score or a lesson.
  • No host stage authors understanding or rewrites the scratchpad: post-task work and fallback drafts never write knowledge, and nothing counts, reopens, ranks or closes backlog entries; knowledge_write is the one writer. A Pause an earlier version saved ends once, its retired stage disclosed beside the skip (tests/test_authored_memory.py).
  • Lifecycle identity fields (host-minted root id and role, started_at from the actual _task_started_ts, existing queued_at, call/execution/round ids, root/parent ids on delegated rows) are observation links, never new accounting or zero-price rules; a missing historical start fact stays missing.
  • Hash identity before history budgeting; recording changes no reviewed fact. Retain full review runs before compact publication; copy and hash before the short artifact lock and never take a result lock inside it; context checkpoints are neither deliverables nor review subjects; a repeated edge cannot turn a deduplicated failure into success (ARCHITECTURE §10).
  • Mirror an actual split-root or split-subagent start, attempt and binding into the canonical result via its terminal-preserving writer; a start written without the named attempt stays unknown, never permission to resume. headless.prepare_terminal_task_files adopts answer, output files and receipt union after blocking post-work and before worker task_done; an I/O failure or a lost event never authorizes model replay. Health owns file recovery, the existing reaper owns execution and deferred-job replay, and the normal terminal event owns queue release and project/evolution hooks — never a second crash executor (ARCHITECTURE §5 "Supervisor Loop").
  • Same-store retention preserves native manifest bytes and digest; exact readers resolve historical versions from the existing CAS or retained own children; never rewrite checkpoints to relocate them; GC requires task-owned physical calls, late ones included (ARCHITECTURE §10; tests/test_deferred_history_retention.py).
  • Payment follows ARCHITECTURE §6 "Result review"'s subject sha: a changed ask, reply or material is a new subject even with identical text, left to its author once a review reached it; source generations, read repetition or narration never buy a wave. Reuse review_change's own subject, paid stamp and counter (review_result attempt rows): no second hash, wallet or cosmetic edits. Result reviewers are the review pool's rows (reviewer_slot_config.review_pool_slots; a malformed catalog refuses typed) with no child-specific cap; format-repair resends are packet-row only.
  • No host writer mints a result decision: the objective axis is derived from the bound result record (outcomes._review_axis, source result_review), from the author's acceptance (author_acceptance) or from the author stop, and the normalizer keeps task_acceptance_review only for stored records. A new objective source lands in the normalizer allowlist and in the cause twins (project_dialogue.TASK_CAUSE_PHRASES, task_reason_words.js) with a parity row, or a card reads a silent false green. PASS|FAIL|DEGRADED is not narrowable; adaptive_quorum applies, any contributing FAIL fails and DEGRADED abstains in the aggregate. Apply an informed Advisory finish separately, never rewriting criticism or hiding independent failed effects or unfinished stops (DEVELOPMENT §5; ARCHITECTURE §6 "Result review"). No coupling question or commit-gate reuse.
  • Critics cannot deny the author's reaction or choose its stop. An author finish after shown findings needs no separate rationale or panel. Stop requires a reason and grants no completion or permission. Showing the findings once is exposure; a predeclared finish authorizes no unseen findings. No semantic counters or keyword gates (BIBLE P5). Test malformed output, partial failures, disagreement, a refused dispatch, false completion and missing fields (tests/test_result_review.py).
  • OUROBOROS_REVIEW_MAX_CYCLES limits paid result waves per root, not author responses: the last findings permit work within ordinary task time, budget, cancel and round rails. A task contract's budget_profile.max_improvement_passes is accepted and inert.
  • Body collection retains complete output, captures applicable work and books sourced money under existing custody/result locks; it never consumes, accepts or applies it. Test independent terminal publication and collection races (tests/test_delegate_body_collection.py). PATCH_DISPOSED names its actual disposer; the original task retains live control. Custody debt is additive, never a review/objective/execution verdict.

Enforcement: the failure-path tests the first bullet mandates, in the home of each state machine (tests/test_result_review.py; the root admission seal: ouroboros/delivery_seal.py).

Cognitive Artifact Integrity

  • Preserve sources, words, outcomes, decisions and pending corrections until version-bound incorporation; authors, helpers and source addresses remain distinct; omission proves no understanding (DEVELOPMENT §4 "Compaction must earn its rewrite").

  • Follow DEVELOPMENT §4's per-mode/actor governance registry, never opportunistic touched-file inclusions.

  • Test account publication separately from selection: sources stay version-bound, non-exclusive and locally foldable; reselection, later source changes and missing history remain visible (tests/test_common_story.py). CHECKLISTS 11(f) reviews preservation/authorship.

Android platform development

Android keeps the common source, update and review authority. Its runtime layout, launcher/seed distinction, native artifact receipt and lifecycle owners are ARCHITECTURE §1 "Android host (experimental)"; the user procedure is docs/ANDROID_INSTALL.md; the CI lanes are ARCHITECTURE §8. Rules:

  • Describe experiments as rooted ARM64 Android, physically tested on Pixel 10a only. Never turn that tested model into a runtime allowlist or the manifest's minimum SDK into a proven support matrix.
  • Native changes use ordinary Android source, reviewed commits and the persistent per-install signing identity. Never copy the publisher private key, runtime credentials, memory or a live rootfs into release assets. Verify official bytes before trusting their source, and record a publisher-signed reference APK and the locally built installed APK as distinct artifacts. Restore the original personal key after loss; never silently generate another identity for an installed package.
  • Dependency changes reach the same source-selected ensure_platform hook serving first installation and later updates, with tracked recipes and patches; a group stays platform_preparing until completion so an interruption or a Git rollback cannot reuse a partially changed SDK as current. Use the existing verified download cache, Node manager and Playwright installer; start no second daemon. Preparation completion is not HTTP or native-success evidence, and the contained preparation's EXTERNAL_PLATFORM_UPDATE_TIMEOUT_SEC bound is neither an environment setting nor a harness deadline.
  • Before claiming native adoption, exercise source → dependency preparation → build → install → readback → restart, and cover a failed native build beside a still-usable core, an older immutable seed with newer source, a local APK modification followed by an upstream source merge, bootstrap-only changes, rollback to older native source with a newer versionCode, bridge loss and recovery, and Panic versus automatic entry. Core HTTP health is separate from native artifact and bridge readiness; checks use their existing owners and preserve incomplete outcomes.
  • Delegated access keeps the common actor/delegation owners (ARCHITECTURE §6 "Delegated subagents (Claudexor transport + the nanny)"); Android acquires no second access default, trust policy or retry implementation, and a sandbox failure is not a successful run or permission to disguise a retry.
  • enter-linux sets this entry's defaults for the existing OUROBOROS_PREFLIGHT_TEST_WORKERS and OUROBOROS_PREFLIGHT_TIMEOUT_SEC levers and preserves explicit overrides; they change test concurrency and time, not test content, review models or context. Measure memory and swap and confirm process cleanup before running full preflight on a phone; do not deliberately reproduce a kernel panic; keep reusable large downloads in the installer's durable cache.
  • android-test explicitly collects android/tests, which ordinary pytest tests/ does not cover. Portable fixtures and host compilation are separate from physical root, boot, permissions, hardware and battery evidence, and the emulator job certifies neither the phone bootstrap nor the owner consent UI. Release SBOMs describe shipped source/APK bytes; installed pins describe the provisioned phone; neither invents the other. Only the tag-only android-build job reads the publisher signing secrets (ANDROID_KEYSTORE_BASE64, ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS); branch and PR Android jobs sign with a disposable key they never publish, so a PR is source/build evidence, not a publisher-signed release claim.