Compare commits

..
Author SHA1 Message Date
Nick 68dd48c035 removal-prep/message-queue: minify Python oracle methods to escape-hatch refusal (Gitea #2598 item 2)
deploy / deploy (push) Skipped
CI Pipeline / lint (push) Canceled after 0s
CI Pipeline / unit-tests (push) Canceled after 0s
CI Pipeline / go-surface (push) Canceled after 0s
CI Pipeline / rust-surface (push) Canceled after 0s
CI Pipeline / canary (push) Canceled after 0s
CI Pipeline / best-practices (push) Canceled after 0s
CI Pipeline / documentation (push) Canceled after 0s
CI Pipeline / type-check (push) Canceled after 0s
CI Pipeline / gitea-offline (push) Canceled after 0s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
RUNE_MESSAGE_QUEUE_ENGINE=python switch shape kept; all eight oracle
methods raise 'escape hatch retired'. Battery keeps Go-side flow pins,
replaces oracle comparisons and cross-engine coherence pins with refusal
assertions (13 passed).
2026-10-25 17:47:56 +00:00
Nick dcbec01214 removal-prep/cache: minify Python oracle bodies to escape-hatch refusal stubs (Gitea #2598 item 2)
RUNE_CACHE_ENGINE=python switch shape kept; all seven oracle bodies raise
'escape hatch retired'. Oracle-parity and cross-engine-coherence pins
retired with the bodies; Go surface battery extended with refusal tests
(26 passed).
2026-10-25 17:23:42 +00:00
12 changed files with 108 additions and 1506 deletions

No files matched your search

+2 -2
View File
@@ -1,9 +1,9 @@
# Rune
**Current release: v0.358.3**
**Current release: v0.358.2**
<!-- highlights:start -->
## Highlights — from the latest release (v0.358.3)
## Highlights — from the latest release (v0.358.2)
- Plain-English jargon dictionary covers the v0.329 vocabulary, plus catch-all sentence simplification pass.
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "rune"
version = "0.358.3"
version = "0.358.2"
description = "Rune — a stateful coding assistant with persistent memory, orchestration, and TUI"
requires-python = ">=3.10"
@@ -1,983 +0,0 @@
{
"method": "import-graph grep (src/tui/scripts/tests/shared/bridge/interop + Makefile/docs) -> git recency -> AST import-resolution check; lens: tooling-pattern modules from witness-2026-10-24.json",
"date": "2026-10-25",
"counts": {
"legit_tooling": 104,
"superseded": 0,
"dead": 0,
"broken_but_needed": 0,
"of_which_stale_watch": 13
},
"legit_tooling": [
{
"module": "ac_loader",
"last_commit": "2026-10-11",
"importers": [
"src/rune/attention_capsule.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "al_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/gen_abstraction_ladder_truth.py",
"src/rune/abstraction_ladder.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "bb_loader",
"last_commit": "2026-10-11",
"importers": [
"scripts/check_build_basis_gap_parity.py",
"scripts/check_build_basis_parity.py",
"scripts/gen_build_basis_gap_truth.py",
"src/rune/build_basis.py",
"src/rust/build_basis/src/gap.rs"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "bh_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/check_behavior_parity.py",
"src/rune/behavior.py",
"tests/test_behavior_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "bl_loader",
"last_commit": "2026-10-12",
"importers": [
"src/rune/behaviour_ledger.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "broker_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_capability_broker_gap_parity.py",
"src/rune/capability_broker.py",
"tests/test_capability_broker_delegation.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ca_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_construction_activation_parity.py",
"src/rune/construction_activation.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cb_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_cognitive_budgeter_parity.py",
"src/rune/cognitive_budgeter.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cc_loader",
"last_commit": "2026-10-15",
"importers": [
"scripts/check_growth_delta_parity.py",
"scripts/check_identity_anchors_parity.py",
"scripts/check_pins_parity.py",
"scripts/check_safety_override_parity.py",
"scripts/check_tier_parity.py",
"scripts/gen_abstraction_truth.py",
"scripts/gen_context_broker_truth.py",
"src/rune/abstraction.py",
"src/rune/context_broker.py",
"src/rune/growth_delta.py",
"src/rune/identity_anchors.py",
"src/rune/memory_consolidation.py",
"src/rune/persona_gate.py",
"src/rune/safety_override.py",
"src/rune/stage_guards.py",
"src/rune/tier_manager.py",
"src/rune/witness.py",
"src/rust/cognition_core/canary_cognition_core.py",
"src/rust/cognition_core/canary_growth_pins.py",
"src/rust/cognition_core/canary_persona.py",
"tests/test_cc_loader_seam.py",
"tests/test_rust_core_shims.py",
"tests/test_stage_guards_delegation.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ccmd_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/gen_construction_commands_truth.py",
"src/rune/construction_commands.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cd_loader",
"last_commit": "2026-10-12",
"importers": [
"src/rune/construction_depth.py",
"src/rust/construction_depth/canary_construction_depth.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cdec_loader",
"last_commit": "2026-10-13",
"importers": [
"src/rune/construction_decision.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cf_loader",
"last_commit": "2026-10-15",
"importers": [
"scripts/check_capability_fit_gap_parity.py",
"src/rune/capability_fit.py",
"tests/test_capability_fit_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ci_loader",
"last_commit": "2026-10-11",
"importers": [
"src/rune/construction_intent.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cl_loader",
"last_commit": "2026-10-11",
"importers": [
"scripts/fuzz_capability_ledger_parity.py",
"src/rune/capability_ledger.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cm_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_construction_mode_parity.py",
"src/rune/construction_mode.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "contracts_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/gen_contracts_gap_truth.py",
"src/rune/contracts.py",
"tests/test_contracts_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cp_loader",
"last_commit": "2026-10-11",
"importers": [
"scripts/check_construction_pattern_parity.py",
"src/rune/construction_pattern.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cpb_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/check_cpb_parity.py",
"src/rune/construction_patterns_builtin.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cpool_loader",
"last_commit": "2026-10-12",
"importers": [
"src/rune/connection_pool.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cproj_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_construction_projection_parity.py",
"src/rune/construction_projection.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cps_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_context_pressure_parity.py",
"src/rune/context_pressure.py",
"tests/test_context_pressure.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "cs_loader",
"last_commit": "2026-10-04",
"importers": [
"scripts/check_capability_broker_gap_parity.py",
"src/rune/capability_broker.py",
"src/rune/capability_fit.py",
"src/rust/capability_scoring/canary_capability_scoring.py",
"tests/test_capability_broker_delegation.py",
"tests/test_rust_core_shims.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ct_loader",
"last_commit": "2026-10-12",
"importers": [
"src/rune/concept_topology.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "dc_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/gen_drift_cache_truth.py",
"src/rune/drift_cache.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "dcore_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_drift_core_parity.py",
"src/rune/drift_core.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "dl_loader",
"last_commit": "2026-10-12",
"importers": [
"src/rune/drift_ledger.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "do_loader",
"last_commit": "2026-10-11",
"importers": [
"scripts/gen_drift_observability_truth.py",
"src/rune/drift_observability.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "dr_loader",
"last_commit": "2026-10-13",
"importers": [
"scripts/gen_drift_resume_truth.py",
"src/rune/drift_resume.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "dt_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_dependency_tracker_parity.py",
"src/rune/dependency_tracker.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ec_loader",
"last_commit": "2026-10-13",
"importers": [
"src/rune/construction_decision.py",
"src/rune/evidence_capsule.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ee_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/gen_experience_encoding_truth.py",
"src/rune/experience_encoding.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "et_loader",
"last_commit": "2026-10-13",
"importers": [
"scripts/check_execution_trace_parity.py",
"src/rune/execution_trace.py",
"tests/test_execution_trace_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "gm_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_graph_memory_parity.py",
"src/rune/graph_memory.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "gp2_loader",
"last_commit": "2026-10-13",
"importers": [
"src/rune/growth_pipeline.py",
"tests/test_growth_pipeline_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "gp_loader",
"last_commit": "2026-10-15",
"importers": [
"scripts/check_graph_projection_parity.py",
"src/rune/graph_projection.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "gr_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/check_grading_gap_parity.py",
"src/rune/grading.py",
"src/rust/grading/src/gap_battery.rs"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ic_loader",
"last_commit": "2026-10-12",
"importers": [
"src/rune/intent_continuity.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ip_loader",
"last_commit": "2026-10-10",
"importers": [
"src/rune/impact_preview.py",
"src/rust/impact_preview/canary_impact_preview.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "it_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_inference_trace_parity.py",
"src/rune/inference_trace.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "itr_loader",
"last_commit": "2026-10-15",
"importers": [
"scripts/check_iteration_parity.py",
"src/rune/iteration.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "lc_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_layout_contract_parity.py",
"src/rune/layout_contract.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "le_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/gen_lexicon_evolution_truth.py",
"src/rune/lexicon_evolution.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "me_loader",
"last_commit": "2026-10-13",
"importers": [
"scripts/check_meaningful_events_parity.py",
"src/rune/meaningful_events.py",
"tests/test_meaningful_events_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "mems_loader",
"last_commit": "2026-10-04",
"importers": [
"src/rune/memory_store.py",
"src/rust/memory_storage/canary_memory_storage.py",
"tests/test_rust_core_shims.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "mg_loader",
"last_commit": "2026-10-12",
"importers": [
"src/rune/message_graph.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "mr_loader",
"last_commit": "2026-10-10",
"importers": [
"src/rune/memory_selector.py",
"src/rune/memory_store.py",
"src/rust/memory_retrieval/canary_memory_retrieval.py",
"tests/test_mr_branch_battery.py",
"tests/test_rust_core_shims.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ms_loader",
"last_commit": "2026-10-14",
"importers": [
"henxels_checks.py",
"scripts/check_drift_compression_parity.py",
"scripts/dc_freeze_seams/sitecustomize.py",
"src/rune/drift_core.py",
"src/rune/memory_store.py",
"src/rust/memory_scoring/canary_memory_scoring.py",
"src/rust/memory_storage/canary_memory_storage.py",
"tests/test_constitutional_adversarial.py",
"tests/test_ms_loader_seam.py",
"tests/test_rust_core_shims.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "mse_loader",
"last_commit": "2026-10-13",
"importers": [
"scripts/check_memory_selector_parity.py",
"src/rune/memory_selector.py",
"tests/test_p1_03_memory_selection.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "mt_loader",
"last_commit": "2026-10-13",
"importers": [
"src/rune/memory_types.py",
"tests/test_memory_types_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "mu_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/gen_mutation_guards_truth.py",
"src/rune/mutation_guards.py",
"src/rust/mutation_guards/src/lib.rs"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ol_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/check_outcome_ledger_gap_parity.py",
"src/rune/connection_pool.py",
"src/rune/outcome_ledger.py",
"src/rust/outcome_ledger/src/gap_battery.rs",
"tests/test_outcome_ledger_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ou_loader",
"last_commit": "2026-10-13",
"importers": [
"src/rune/outcome_utility.py",
"tests/test_outcome_utility_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "pa_loader",
"last_commit": "2026-10-13",
"importers": [
"scripts/check_pane_authority_parity.py",
"src/rune/pane_authority.py",
"tests/test_pane_authority_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "pc_loader",
"last_commit": "2026-10-15",
"importers": [
"scripts/check_pc_residue_parity.py",
"scripts/gen_programme_continuation_residue_truth.py",
"src/rune/programme_continuation.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "pr_loader",
"last_commit": "2026-10-13",
"importers": [
"scripts/gen_project_registry_truth.py",
"src/rune/project_registry.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "progressive_escalation_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_progressive_escalation_parity.py",
"scripts/gen_progressive_escalation_truth.py",
"src/rune/progressive_escalation.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ps_loader",
"last_commit": "2026-10-11",
"importers": [
"scripts/check_context_pressure_parity.py",
"src/rune/context_pressure.py",
"src/rune/prompt_sync.py",
"tests/test_context_pressure.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ra_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_response_adapter_parity.py",
"src/rune/response_adapter.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "rb_loader",
"last_commit": "2026-10-13",
"importers": [
"src/rune/research_budget.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "rp_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/check_rune_profiler_parity.py",
"src/rune/rune_profiler.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ru_loader",
"last_commit": "2026-10-12",
"importers": [
"src/rune/recall_uplift.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "sc_loader",
"last_commit": "2026-10-04",
"importers": [
"src/rune/construction_decision.py",
"src/rust/scaffold_core/canary_scaffold_core.py",
"tests/test_rust_core_shims.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "sck_loader",
"last_commit": "2026-10-15",
"importers": [
"scripts/gen_state_checkpoint_truth.py",
"src/rune/state_checkpoint.py",
"tests/test_state_checkpoint_delegation.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "sg_loader",
"last_commit": "2026-10-10",
"importers": [
"scripts/gen_salience_gate_truth.py",
"src/rune/salience_gate.py",
"src/rust/salience_gate/canary_salience_gate.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "sh_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/check_subsystem_health_parity.py",
"src/rune/subsystem_health.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "si_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/gen_self_improve_truth.py",
"src/rune/self_improve.py",
"tests/test_self_improve_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "sk_loader",
"last_commit": "2026-10-13",
"importers": [
"scripts/check_skill_compiler_parity.py",
"src/rune/skill_compiler.py",
"tests/test_skill_compiler_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "sl_loader",
"last_commit": "2026-10-12",
"importers": [
"src/rune/spine_language.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "sm_loader",
"last_commit": "2026-10-12",
"importers": [
"src/rune/shard_manager.py",
"src/rune/stm_loader.py",
"src/rust/iteration/src/lib.rs"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "smm_loader",
"last_commit": "2026-10-13",
"importers": [
"src/rune/self_model.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "smod_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/check_self_modify_gap_parity.py",
"scripts/gen_self_modify_truth.py",
"src/rune/self_modify.py",
"src/rust/self_modify/src/gap_battery.rs"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "sp_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/check_subconscious_pass_parity.py",
"src/rune/subconscious_pass.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "sr_loader",
"last_commit": "2026-10-11",
"importers": [
"src/rune/system_registry.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ss_loader",
"last_commit": "2026-10-15",
"importers": [
"scripts/check_structural_store_parity.py",
"src/rune/structural_store.py",
"src/rust/structural_store/canary_structural_store.py",
"tests/test_structural_store_delegation.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "stm_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_structural_model_parity.py",
"src/rune/structural_model.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "ta_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/check_time_awareness_gap_parity.py",
"scripts/check_time_awareness_parity.py",
"src/rune/time_awareness.py",
"src/rust/time_awareness/src/gap_battery.rs",
"tests/test_time_awareness_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "tc_loader",
"last_commit": "2026-10-04",
"importers": [
"src/rune/token_optimizer.py",
"src/rust/token_counting/canary_token_counting.py",
"tests/test_rust_core_shims.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "tg_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/gen_task_gate_truth.py",
"src/rune/task_gate.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "tl_loader",
"last_commit": "2026-10-12",
"importers": [
"scripts/check_toolchain_parity.py",
"src/rune/toolchain.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "tm_loader",
"last_commit": "2026-10-15",
"importers": [
"scripts/check_structural_model_parity.py",
"scripts/gen_testing_mode_truth.py",
"src/rune/structural_model.py",
"src/rune/testing_mode.py",
"tests/test_testing_mode_delegation.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "to_loader",
"last_commit": "2026-10-11",
"importers": [
"scripts/check_token_optimizer_parity.py",
"src/rune/token_optimizer.py",
"tests/test_token_optimizer_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "vh_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/check_voice_hybrid_parity.py",
"src/rune/voice_hybrid.py",
"tests/test_voice_hybrid_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "vs_loader",
"last_commit": "2026-10-14",
"importers": [
"scripts/gen_voice_sync_truth.py",
"src/rune/voice_sync.py",
"src/rust/voice_sync/canary_voice_sync.py",
"tests/test_voice_sync_port.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "wr_loader",
"last_commit": "2026-10-15",
"importers": [
"scripts/gen_worthiness_truth.py",
"src/rune/worthiness.py"
],
"verdict": "FFI ctypes bridge to src/rust crate; imported by live core module/test/parity script; committed Oct 2026"
},
{
"module": "evidence_probe",
"last_commit": "2026-10-08",
"importers": [
"scripts/gen_evidence_probe_truth.py",
"scripts/gen_local_tool_runtime_truth.py",
"scripts/research_stage_executor.py",
"src/rune/canary_audit_ledger.py",
"src/rune/rune_operator.py",
"tests/test_evidence_probe.py",
"tests/test_evidence_provenance_shims.py",
"tests/test_operator_probe_isolation.py"
],
"verdict": "8 importers incl. live scripts/research_stage_executor.py; truth generators depend on it"
},
{
"module": "builder_bridge_cli",
"last_commit": "2026-10-21",
"importers": [],
"verdict": "referenced by scripts/gen_builder_bridge_cli_truth.py + structural_coverage_audit; committed 2026-10-21"
},
{
"module": "construction_authority_cli",
"last_commit": "2026-10-19",
"importers": [
"tests/test_construction_authority_drills.py"
],
"verdict": "imported by tests/test_construction_authority_drills.py; committed 2026-10-19"
},
{
"module": "canary_audit_ledger",
"last_commit": "2026-10-08",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_full_system",
"last_commit": "2026-10-08",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_gitea_automation",
"last_commit": "2026-10-25",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_native",
"last_commit": "2026-10-18",
"importers": [
"docs/structural-contract.md",
"scripts/scaffold_projection.py",
"src/rune/spine.py",
"src/rust/spine/src/gap.rs"
],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_p0_04",
"last_commit": "2026-10-18",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_p1_01",
"last_commit": "2026-10-18",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_p1_02",
"last_commit": "2026-10-10",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_p1_06",
"last_commit": "2026-10-10",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_p1_07",
"last_commit": "2026-10-10",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_query_memory",
"last_commit": "2026-10-08",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_rune_entry",
"last_commit": "2026-10-04",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_rune_serve",
"last_commit": "2026-10-17",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_spine_meta",
"last_commit": "2026-10-04",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_tui_drift",
"last_commit": "2026-10-08",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_tui_transport",
"last_commit": "2026-10-04",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
},
{
"module": "canary_unbounded",
"last_commit": "2026-10-08",
"importers": [],
"verdict": "canary battery entry, fresh commit Oct 2026, doc-tracked (docs/dichotomy-rebase-honest-audit.md); no importers expected for canaries"
}
],
"superseded": [],
"dead": [],
"broken_but_needed": [],
"notes": [
"All 85 *_loader modules are ctypes FFI bridges to src/rust crates \u2014 they ARE the Python->Rust successor mechanism, not Python legacy; every one has live importers and was touched within 30 days.",
"No module in the 117 is superseded: loaders supersede pure-Python cores; canaries have no successor beyond the newer canary_p0_04/p1_* battery which does not yet cover the stale 13.",
"BROKEN-BUT-NEEDED is empty: witness run proved import liveness; static AST check found only guarded optional deps (aaak, pynput/faster_whisper) and runtime-path-injected shared/ + src/rust/evidence_provenance/ep_loader modules that resolve under the boot chain.",
"The 13 stale canaries fail the recency test but pass the doc-need test (docs/pipeline-prd.md lines ~57-58 enumerate them as the required battery; scripts/structural_coverage_audit.py:131-139 inventories them). Removal requires a docs+audit-script update first.",
"Zero-importer is normal for canaries/CLIs (executed, not imported); recency + doc tracking used as liveness proxy instead."
]
}
@@ -1,46 +0,0 @@
# Tooling-Pile Sort — 2026-10-24 witness run (Gitea #2598 item 4)
Lens: the ~117 tooling-pattern modules (`live_pure_tooling` in research/witness-run/witness-2026-10-24.json).
Method: import-graph first (grep across src/, tui/, scripts/, tests/, shared/, bridge/, interop/, Makefile, docs),
then git recency (cutoff 2026-09-25), then static AST import-resolution. Read-only elsewhere.
## Counts
| Pile | Count |
|---|---|
| LEGIT-TOOLING | 104 |
| — of which STALE-WATCH canaries | 13 |
| SUPERSEDED | 0 |
| DEAD | 0 |
| BROKEN-BUT-NEEDED | 0 |
## 1. LEGIT-TOOLING (104)
- **85 `*_loader.py`** — every one is a ctypes FFI bridge to a crate in `src/rust/` (e.g. `ac_loader` → `src/rust/attention_capsule`). They ARE the Python→Rust successor mechanism, not Python legacy. All have live importers (core modules, `tests/test_*_port.py`, `scripts/check_*_parity.py` truth generators) and commits Oct 4–15, 2026. Examples: `cc_loader` (23 importers), `ms_loader` (10, incl. `henxels_checks.py`), `sm_loader` (imported by `src/rust/iteration/src/lib.rs` test path).
- **3 CLIs/probes** — `builder_bridge_cli` (2026-10-21; `scripts/gen_builder_bridge_cli_truth.py`, `structural_coverage_audit.py`), `construction_authority_cli` (imported by `tests/test_construction_authority_drills.py`), `evidence_probe` (8 importers incl. `scripts/research_stage_executor.py`).
- **16 fresh canaries** (commit ≥ 2026-09-25) — `canary_native` is imported by `src/rune/spine.py` and `scripts/scaffold_projection.py`; the rest are the doc-tracked battery (below) with October commits (`canary_gitea_automation` same-day, 2026-10-25). Zero importers is expected — canaries execute, they aren't imported.
## 2. STALE-WATCH subset (13, still LEGIT per the doc-need rule)
`canary_cognitive_strata`, `canary_context_broker`, `canary_conversation_state`, `canary_gitea_delegation`, `canary_gitea_pipeline`, `canary_memory_synthesis`, `canary_orchestration_foundation`, `canary_p0_05`, `canary_p0_07`, `canary_p1_03`, `canary_resource_authority`, `canary_schema_migration`, `canary_surface_parity`.
Zero importers + no commits since Sept 3–12 (45–55 days), BUT: `docs/pipeline-prd.md` (~lines 57–58) enumerates them as the required canary battery, `scripts/structural_coverage_audit.py:131-139` inventories them, and they import modules of `src/rune/orchestration/` that are actively developed (commits within 30 days). Not dead — but they are stale guards over live code and the newer `canary_p0_04` / `canary_p1_*` battery doesn't yet cover them. Any removal must first update pipeline-prd.md + structural_coverage_audit.py; otherwise recommend consolidation into the newer battery.
## 3. SUPERSEDED (0)
Loaders supersede pure-Python cores rather than being superseded; no canary/CLI has a Go/Rust replacement — the newer canary battery is complementary, not substituting.
## 4. DEAD (0)
Nothing meets the triple test: everything has importers, sub-30-day commits, or explicit doc/audit-script need.
## 5. BROKEN-BUT-NEEDED (0)
Witness run proved import liveness. Static AST check across all 117 found only:
- guarded optional deps (`aaak` in warm_router.py:217 / memory_store.py:445 — try/except fallback; `pynput`/`faster_whisper` in voicebox),
- runtime path-injected modules (`shared/query_memory.py`, `shared/build_pipeline_policy.py`, `shared/gitea_auth.py`, `src/rust/evidence_provenance/ep_loader.py`) that resolve under the boot chain.
No unguarded missing imports. Machine-verified import failure would need the venv (not available in this probe); the witness run covers that.
## Headline
The "tooling pile" is almost entirely load-bearing FFI glue: 85 of 117 modules are the ctypes bridge layer the Rust port depends on. Nothing is deletable today; the only actionable item is consolidating the 13 stale September canaries into the October battery.
+1 -1
View File
@@ -6,7 +6,7 @@ This is the main entry point for the Rune program.
import json
from pathlib import Path
__version__ = "0.358.3"
__version__ = "0.358.2"
# One build identity (handoff 2026-09-10 §4): the semantic version above is
# the repo-level truth (auto-bumped at merge); the DEPLOYED revision (exact
+7 -125
View File
@@ -252,38 +252,7 @@ def get_cache(key):
def _get_cache_python(key):
"""Oracle body (kept as escape/oracle; see module header)."""
db = connect()
try:
row = db.execute("SELECT * FROM cache WHERE key=? AND invalidated_at IS NULL", (key,)).fetchone()
if row:
# Record hit in memory — no SQLite write on the hot path
# Capture pending count BEFORE recording (audit fix: prevents
# double-counting if flush_stats() runs between DB read and here)
_pending = _hit_counts.get(key, 0)
_record_hit(key)
return {
"hit": True,
"key": key,
"compressed": row["compressed_value"],
"full": row["full_value"],
"content_hash": row["content_hash"],
"scope": row["scope"],
"age_seconds": (_now_ts() - _parse_ts(row["created_at"])),
"hit_count": row["hit_count"] + _pending,
}
# Miss — only record if the key exists in the cache (e.g. invalidated).
# A true miss (key never seen) should not trigger any write.
exists = db.execute("SELECT 1 FROM cache WHERE key=?", (key,)).fetchone()
if exists:
_record_miss(key)
return {"hit": False, "key": key}
finally:
db.close()
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def put_cache(key, value, compressed=None, scope="general", source_hash=""):
@@ -314,37 +283,7 @@ def put_cache(key, value, compressed=None, scope="general", source_hash=""):
def _put_cache_python(key, value, compressed=None, scope="general", source_hash=""):
"""Oracle body (kept as escape/oracle; see module header)."""
# Flush any pending stats before writing so we don't lose counts
flush_stats()
db = connect()
content_hash = _hash(value)
# Mechanical compression if not provided
if compressed is None:
compressed = _compress(value)
db.execute(
"""
INSERT INTO cache
(key, scope, content_hash, full_value, compressed_value, source_hash,
created_at, invalidated_at, hit_count, miss_count)
VALUES (?, ?, ?, ?, ?, ?, ?, NULL, 0, 0)
ON CONFLICT(key) DO UPDATE SET
scope = excluded.scope,
content_hash = excluded.content_hash,
full_value = excluded.full_value,
compressed_value = excluded.compressed_value,
source_hash = excluded.source_hash,
created_at = excluded.created_at,
invalidated_at = NULL
""",
(key, scope, content_hash, value, compressed, source_hash, _now()),
)
db.commit()
db.close()
return {"stored": key, "content_hash": content_hash, "scope": scope}
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def invalidate(key, reason=""):
@@ -355,12 +294,7 @@ def invalidate(key, reason=""):
def _invalidate_python(key, reason=""):
"""Oracle body (kept as escape/oracle; see module header)."""
db = connect()
db.execute("UPDATE cache SET invalidated_at=? WHERE key=? AND invalidated_at IS NULL", (_now(), key))
db.commit()
db.close()
return {"invalidated": key, "reason": reason}
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def invalidate_scope(scope, reason=""):
@@ -373,14 +307,7 @@ def invalidate_scope(scope, reason=""):
def _invalidate_scope_python(scope, reason=""):
"""Oracle body (kept as escape/oracle; see module header)."""
db = connect()
count = db.execute(
"UPDATE cache SET invalidated_at=? WHERE scope=? AND invalidated_at IS NULL", (_now(), scope)
).rowcount
db.commit()
db.close()
return {"invalidated_scope": scope, "count": count, "reason": reason}
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def invalidate_all(reason=""):
@@ -391,12 +318,7 @@ def invalidate_all(reason=""):
def _invalidate_all_python(reason=""):
"""Oracle body (kept as escape/oracle; see module header)."""
db = connect()
count = db.execute("UPDATE cache SET invalidated_at=? WHERE invalidated_at IS NULL", (_now(),)).rowcount
db.commit()
db.close()
return {"invalidated_all": count, "reason": reason}
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def _compress(text):
@@ -470,33 +392,7 @@ def cache_stats():
def _cache_stats_python():
"""Oracle body (kept as escape/oracle; see module header)."""
# Flush pending counts first so stats are fully accurate
flush_stats()
db = connect()
total = db.execute("SELECT COUNT(*) FROM cache").fetchone()[0]
active = db.execute("SELECT COUNT(*) FROM cache WHERE invalidated_at IS NULL").fetchone()[0]
invalidated = total - active
hits = db.execute("SELECT SUM(hit_count) FROM cache").fetchone()[0] or 0
misses = db.execute("SELECT SUM(miss_count) FROM cache").fetchone()[0] or 0
scopes = {}
for row in db.execute(
"SELECT scope, COUNT(*) as cnt FROM cache WHERE invalidated_at IS NULL GROUP BY scope"
).fetchall():
scopes[row["scope"]] = row["cnt"]
db.close()
return {
"total": total,
"active": active,
"invalidated": invalidated,
"hits": hits,
"misses": misses,
"hit_rate": f"{hits / max(hits + misses, 1) * 100:.0f}%",
"scopes": scopes,
}
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def handle_hook(event, data=None):
@@ -516,21 +412,7 @@ def handle_hook(event, data=None):
def _handle_hook_python(event, data=None):
"""Oracle body (kept as escape/oracle; see module header)."""
if event in INVALIDATION_MAP:
scopes = INVALIDATION_MAP[event]
invalidated = 0
for scope in scopes:
result = invalidate_scope(scope, reason=f"event:{event}")
invalidated += result.get("count", 0)
return {
"status": "ok",
"event": event,
"handler": "cache",
"invalidated": invalidated,
"scopes": scopes,
}
return {"status": "ok", "event": event, "handler": "cache"}
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def main():
+1 -1
View File
@@ -233,7 +233,7 @@ def main() -> int:
)
check(
"Rune minor version advertises provisioning and restore verification",
'__version__ = "0.358.3"' in rune_version,
'__version__ = "0.358.2"' in rune_version,
failures,
)
# #169 policy update: auto-bump on merge is sanctioned (Nick directive:
+8 -109
View File
@@ -185,55 +185,7 @@ class MessageQueue:
return self._detect_task_addition_python(message)
def _detect_task_addition_python(self, message: str) -> tuple[bool, float, List[str]]:
"""Oracle body (kept as escape/oracle; see module header)."""
signals = []
confidence = 0.0
message_lower = message.lower()
# Check for task addition patterns
for pattern in TASK_ADDITION_PATTERNS:
if re.search(pattern, message_lower):
signals.append(f"Pattern: {pattern}")
confidence += 0.3
# Check for imperative verbs
imperative_verbs = [
"add",
"update",
"fix",
"create",
"implement",
"build",
"make",
"change",
"remove",
"delete",
"refactor",
"migrate",
]
for verb in imperative_verbs:
if message_lower.startswith(verb):
signals.append(f"Imperative verb: {verb}")
confidence += 0.4
# Check for file references
file_refs = re.findall(r"\b\w+\.\w+\b", message)
if file_refs:
signals.append(f"File references: {', '.join(file_refs[:3])}")
confidence += 0.2
# Check for "also" at the start
if message_lower.startswith("also"):
signals.append("Starts with 'also'")
confidence += 0.5
# Cap confidence at 1.0
confidence = min(confidence, 1.0)
# Is it a task addition? (confidence > 0.5)
is_task_addition = confidence > 0.5
return is_task_addition, confidence, signals
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def add_message(self, message: str, channel: str, task_id: Optional[str] = None) -> QueuedMessage:
"""Add a message to the queue."""
@@ -254,24 +206,7 @@ class MessageQueue:
return self._add_message_python(message, channel, task_id)
def _add_message_python(self, message: str, channel: str, task_id: Optional[str] = None) -> QueuedMessage:
"""Oracle body (kept as escape/oracle; see module header)."""
is_task, confidence, signals = self.detect_task_addition(message)
msg_id = datetime.now(timezone.utc).strftime("%Y%m%d-%H%M%S-%f")
queued = QueuedMessage(
id=msg_id,
message=message,
timestamp=datetime.now(timezone.utc).isoformat(),
channel=channel,
task_id=task_id,
confidence=confidence,
signals=signals,
)
self.queue.append(queued)
self._save_queue()
return queued
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def get_pending(self) -> List[QueuedMessage]:
"""Get all pending messages."""
@@ -286,13 +221,7 @@ class MessageQueue:
return self._approve_python(msg_id)
def _approve_python(self, msg_id: str) -> bool:
"""Oracle body (kept as escape/oracle; see module header)."""
for msg in self.queue:
if msg.id == msg_id:
msg.status = "approved"
self._save_queue()
return True
return False
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def reject(self, msg_id: str) -> bool:
"""Reject a queued message."""
@@ -303,13 +232,7 @@ class MessageQueue:
return self._reject_python(msg_id)
def _reject_python(self, msg_id: str) -> bool:
"""Oracle body (kept as escape/oracle; see module header)."""
for msg in self.queue:
if msg.id == msg_id:
msg.status = "rejected"
self._save_queue()
return True
return False
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def approve_all(self) -> int:
"""Approve all pending messages."""
@@ -320,14 +243,7 @@ class MessageQueue:
return self._approve_all_python()
def _approve_all_python(self) -> int:
"""Oracle body (kept as escape/oracle; see module header)."""
count = 0
for msg in self.queue:
if msg.status == "pending":
msg.status = "approved"
count += 1
self._save_queue()
return count
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def clear(self):
"""Clear all messages."""
@@ -338,9 +254,7 @@ class MessageQueue:
return self._clear_python()
def _clear_python(self):
"""Oracle body (kept as escape/oracle; see module header)."""
self.queue = []
self._save_queue()
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def get_approved(self) -> List[QueuedMessage]:
"""Get all approved messages."""
@@ -355,13 +269,7 @@ class MessageQueue:
return self._mark_executed_python(msg_id)
def _mark_executed_python(self, msg_id: str) -> bool:
"""Oracle body (kept as escape/oracle; see module header)."""
for msg in self.queue:
if msg.id == msg_id:
msg.status = "executed"
self._save_queue()
return True
return False
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
def get_status(self) -> Dict[str, Any]:
"""Get queue status."""
@@ -370,16 +278,7 @@ class MessageQueue:
return self._get_status_python()
def _get_status_python(self) -> Dict[str, Any]:
"""Oracle body (kept as escape/oracle; see module header)."""
pending = len([m for m in self.queue if m.status == "pending"])
approved = len([m for m in self.queue if m.status == "approved"])
executed = len([m for m in self.queue if m.status == "executed"])
return {
"total": len(self.queue),
"pending": pending,
"approved": approved,
"executed": executed,
}
raise RuntimeError("escape hatch retired for this row - the Go engine is the authority")
# ═══════════════════════════════════════════════════════════════════════════════
+2 -2
View File
@@ -8,7 +8,7 @@ mode system, subject header, shared memory and identity.
This is not an interface. This is how I see, speak, and interact with the world.
Version: v0.358.3
Version: v0.358.2
Features: 41 (24 original + 17 new native commands)
Usage:
@@ -2047,7 +2047,7 @@ class RuneApp(App):
# Show version info
self.chat_channel.add_message(
"system",
f"[dim]Rune v0.358.3 | Textual TUI | {len(loaded)} native modules[/dim]",
f"[dim]Rune v0.358.2 | Textual TUI | {len(loaded)} native modules[/dim]",
)
# Auto-show night mode suggestion if evening/night hours
+24 -140
View File
@@ -1,21 +1,13 @@
"""Cache oracle battery — dichotomy wave gap closure (#2479).
"""Cache escape-hatch battery — REMOVAL-PREP (#2598 item 2).
The Go core (src/go/cache) ports the eleven audit-named missing fns
1:1; this battery pins the PYTHON ORACLE itself (sandboxed memory dir,
frozen clock, monkeypatched monotonic — no real filesystem writes
outside the sandbox) and cross-checks the committed frozen truth
byte-identically against the live oracle (delegation-live law). Both
pins run green: RUNE_CACHE_CORE=python and unset (cache has no core
seam — the pin documents the freeze convention either way).
The Go core (src/go/cache) is the authority. The Python oracle bodies in
src/rune/cache.py are MINIFIED: they keep their signatures but raise the
retirement RuntimeError. This battery pins the refusal shape; the Go
surface is pinned in test_cache_go_parity.py.
"""
import importlib
import json
import os
import sqlite3
import subprocess
import sys
import tempfile
from pathlib import Path
import pytest
@@ -23,141 +15,33 @@ import pytest
ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT / "src"))
FROZEN = ROOT / "src/go/cache/frozen_truth.json"
FROZEN_NOW = "2026-10-13T12:00:00+00:00"
@pytest.fixture()
def oracle(monkeypatch, tmp_path):
"""A freshly-imported rune.cache against a throwaway DB with a
frozen clock (module globals reset — import-time DB_PATH derived
from the sandbox)."""
monkeypatch.setenv("RUNE_MEMORY_DIR", str(tmp_path))
monkeypatch.setenv("RUNE_FROZEN_NOW", FROZEN_NOW)
import rune.cache as cache_mod
mod = importlib.reload(cache_mod)
return mod
def db_hit_miss(mod, key):
db = sqlite3.connect(mod.DB_PATH)
try:
row = db.execute("SELECT hit_count, miss_count FROM cache WHERE key=?", (key,)).fetchone()
return row
finally:
db.close()
@pytest.mark.parametrize(
"call",
[
lambda m: m._get_cache_python("k"),
lambda m: m._put_cache_python("k", "v"),
lambda m: m._invalidate_python("k"),
lambda m: m._invalidate_scope_python("s"),
lambda m: m._invalidate_all_python(),
lambda m: m._cache_stats_python(),
lambda m: m._handle_hook_python("memory.write", {"key": "k"}),
],
)
def test_oracle_bodies_refuse(oracle, call):
with pytest.raises(RuntimeError, match="escape hatch retired"):
call(oracle)
def test_frozen_truth_replay(oracle):
"""The committed truth replays against the live oracle: same case
sequence, same sandbox conditions, identical expected values."""
doc = json.loads(FROZEN.read_text())
assert doc["frozen_now"] == FROZEN_NOW
cases = []
for c in doc["cases"]:
cases.append({"fn": c["fn"], "args": c["args"], "kwargs": c.get("kwargs", {})})
sys.path.insert(0, str(ROOT / "scripts"))
from freeze_truth import freeze as _freeze
fresh = _freeze("rune.cache", cases, oracle_module="rune.cache")
assert len(fresh) == len(doc["cases"])
for frozen, live in zip(doc["cases"], fresh):
assert frozen["expected"] == live["expected"], f"divergence at {frozen['fn']}"
assert json.loads(json.dumps(fresh)) == json.loads(json.dumps(doc["cases"]))
def test_pending_hit_visibility(oracle):
"""The double-get audit fix: the pending in-memory count is visible
to the NEXT get before any flush (row + pending invariant)."""
oracle.put_cache("k", "value")
first = oracle.get_cache("k")
second = oracle.get_cache("k")
assert first["hit_count"] == 0
assert second["hit_count"] == 1
def test_true_miss_writes_nothing(oracle):
"""A key never seen records no miss (no write-on-read for ghosts)."""
result = oracle.get_cache("ghost")
assert result == {"hit": False, "key": "ghost"}
assert oracle._miss_counts == {}
def test_invalidated_miss_records(oracle):
oracle.put_cache("k", "v")
oracle.invalidate("k")
assert oracle.get_cache("k") == {"hit": False, "key": "k"}
assert oracle._miss_counts.get("k") == 1
def test_flush_threshold(oracle):
"""_FLUSH_THRESHOLD=50: no DB write before the 50th event, all
pending counts land on it."""
oracle.put_cache("k", "v")
for _ in range(oracle._FLUSH_THRESHOLD - 1):
oracle.get_cache("k")
assert db_hit_miss(oracle, "k")[0] == 0
oracle.get_cache("k") # the 50th event
assert db_hit_miss(oracle, "k")[0] == oracle._FLUSH_THRESHOLD
def test_flush_interval(oracle, monkeypatch):
"""_FLUSH_INTERVAL=30s: a monotonic jump past the interval flushes
on the next record (the branch the frozen truth cannot idle for)."""
real_monotonic = oracle.time.monotonic
t = {"now": real_monotonic()}
monkeypatch.setattr(oracle.time, "monotonic", lambda: t["now"])
oracle.put_cache("k", "v")
oracle.get_cache("k")
assert db_hit_miss(oracle, "k")[0] == 0
t["now"] += oracle._FLUSH_INTERVAL + 0.5
oracle.get_cache("k")
assert db_hit_miss(oracle, "k")[0] == 2
def test_upsert_preserves_counts(oracle):
oracle.put_cache("k", "v1")
oracle.get_cache("k")
oracle.get_cache("k")
oracle.cache_stats() # flush -> DB hit_count 2
oracle.put_cache("k", "v2") # upsert must NOT reset stats
assert db_hit_miss(oracle, "k")[0] == 2
assert oracle.get_cache("k")["hit_count"] == 2
def test_hit_rate_half_even():
"""f'{x:.0f}%' ties round half-to-even (quirk #3 family); the Go
port's %.0f must agree (pinned in cache_test.go)."""
assert f"{12.5:.0f}" == "12"
assert f"{13.5:.0f}" == "14"
def test_invalidation_map_scopes(oracle):
result = oracle.handle_hook("memory.created", {})
assert result["scopes"] == ["retrieval", "warm_digest"]
assert oracle.handle_hook("nothing.here", None) == {
"status": "ok", "event": "nothing.here", "handler": "cache"}
def test_plugin_manifest(oracle):
assert oracle.PLUGIN["name"] == "cache"
assert oracle.PLUGIN["hooks"] == {
"on_session_end": "handle_hook", "on_memory_add": "handle_hook"}
assert oracle.PLUGIN["auto_activate"] is True
def test_cli_usage_bytes(tmp_path):
"""The oracle CLI usage gates print exactly these bytes."""
env = dict(os.environ, RUNE_MEMORY_DIR=str(tmp_path),
PYTHONPATH=str(ROOT / "src"))
r = subprocess.run([sys.executable, "-m", "rune.cache", "get"],
capture_output=True, text=True, cwd=ROOT, env=env)
assert r.returncode == 0
assert r.stdout == "usage: cache.py get <key>\n"
def test_compress_and_hash(oracle):
text = "# comment\n====\nkeep this substantive line\n(_source_: cite)\nab\n"
compressed = oracle._compress(text)
assert compressed == "keep this substantive line"
assert oracle._hash("hello") == __import__("hashlib").sha256(b"hello").hexdigest()[:16]
def test_frozen_truth_document_remains():
doc = ROOT / "src/go/cache/frozen_truth.json"
assert doc.exists(), "frozen truth evidence stays in the tree"
+49 -72
View File
@@ -1,12 +1,13 @@
"""REBASE-COMPLETION (#2587) parity battery — cache.
"""REMOVAL-PREP (#2598 item 2) parity battery — cache.
Red-first discipline: pins the Go engine's eval surface (get_cache,
put_cache, invalidate, invalidate_scope, invalidate_all, cache_stats,
handle_hook) against the Python oracle bodies on the SAME cache.db. A
mutation of an oracle body must flip the battery. Also pins the facade
contract: fail-loud RuntimeError on a missing binary; RUNE_CACHE_ENGINE
=python escape; cross-engine coherence (engine-written rows are
oracle-readable and vice versa).
The Go engine (src/go/cache) is the authority: get_cache, put_cache,
invalidate, invalidate_scope, invalidate_all, cache_stats, handle_hook.
The Python oracle bodies are MINIFIED — each keeps its signature but
raises the retirement RuntimeError. These tests pin: (a) the Go surface
end-to-end on a real cache.db, (b) the RUNE_CACHE_ENGINE=python escape
hatch exists structurally and refuses, (c) fail-loud on missing binary.
The former oracle-parity and cross-engine-coherence pins are retired
with the oracle bodies (soak evidence: Gitea #2587 wave receipts).
"""
import os
@@ -22,61 +23,41 @@ from rune import cache as cache_mod # noqa: E402
@pytest.fixture()
def mem_dir(tmp_path, monkeypatch):
monkeypatch.setenv("RUNE_MEMORY_DIR", str(tmp_path))
# The oracle bodies read the import-time DB_PATH constant; retarget it
# to the test memory dir so both engines address the same cache.db.
monkeypatch.setattr(cache_mod, "DB_PATH", str(tmp_path / "cache.db"))
return str(tmp_path)
def _oracle(mem_dir, monkeypatch):
monkeypatch.setenv("RUNE_CACHE_ENGINE", "python")
return cache_mod
def _put(cache, key, value, **kw):
return cache.put_cache(key, value, **kw)
# -- put / get roundtrip -----------------------------------------------------
# -- Go surface -------------------------------------------------------------
def test_put_get_roundtrip_go_vs_oracle(mem_dir, monkeypatch):
def test_put_get_roundtrip_go(mem_dir):
got = _put(cache_mod, "k1", "value one")
monkeypatch.setenv("RUNE_CACHE_ENGINE", "python")
oracle_put = cache_mod._put_cache_python("k1", "value one")
oracle_get = cache_mod._get_cache_python("k1")
monkeypatch.delenv("RUNE_CACHE_ENGINE")
engine_get = cache_mod.get_cache("k1")
assert got == oracle_put == {"stored": "k1", "content_hash": got["content_hash"], "scope": "general"}
assert engine_get["hit"] is True and oracle_get["hit"] is True
assert engine_get["full"] == oracle_get["full"] == "value one"
assert engine_get["content_hash"] == oracle_get["content_hash"]
assert got["stored"] == "k1" and got["scope"] == "general"
row = cache_mod.get_cache("k1")
assert row["hit"] is True and row["full"] == "value one"
def test_miss_shape_go_vs_oracle(mem_dir):
def test_miss_shape_go(mem_dir):
assert cache_mod.get_cache("absent-key") == {"hit": False, "key": "absent-key"}
assert cache_mod._get_cache_python("absent-key") == {"hit": False, "key": "absent-key"}
def test_put_scope_and_source_hash_go_vs_oracle(mem_dir):
def test_put_scope_and_source_hash_go(mem_dir):
got = _put(cache_mod, "k2", "v2", scope="research", source_hash="abc")
oracle = cache_mod._put_cache_python("k2", "v2", scope="research", source_hash="abc")
assert got == oracle
row = cache_mod.get_cache("k2")
assert row["scope"] == "research"
assert got["stored"] == "k2"
assert cache_mod.get_cache("k2")["scope"] == "research"
# -- invalidation ------------------------------------------------------------
def test_invalidate_go_vs_oracle(mem_dir):
def test_invalidate_go(mem_dir):
_put(cache_mod, "k3", "v3")
got = cache_mod.invalidate("k3", "gone")
assert got["invalidated"] == "k3"
assert cache_mod.invalidate("k3", "gone")["invalidated"] == "k3"
assert cache_mod.get_cache("k3")["hit"] is False
def test_invalidate_scope_go_vs_oracle(mem_dir):
def test_invalidate_scope_go(mem_dir):
_put(cache_mod, "a1", "v", scope="s1")
_put(cache_mod, "a2", "v", scope="s1")
_put(cache_mod, "b1", "v", scope="s2")
@@ -87,57 +68,53 @@ def test_invalidate_scope_go_vs_oracle(mem_dir):
assert cache_mod.get_cache("b1")["hit"] is True
def test_invalidate_all_go_vs_oracle(mem_dir):
def test_invalidate_all_go(mem_dir):
_put(cache_mod, "x1", "v")
_put(cache_mod, "x2", "v")
got = cache_mod.invalidate_all("reset")
assert got["invalidated_all"] == 2
assert cache_mod.invalidate_all("reset")["invalidated_all"] == 2
assert cache_mod.get_cache("x1")["hit"] is False
assert cache_mod.get_cache("x2")["hit"] is False
# -- stats + hook --------------------------------------------------------------
def test_cache_stats_go_vs_oracle(mem_dir):
def test_cache_stats_go(mem_dir):
_put(cache_mod, "s1", "v")
_put(cache_mod, "s2", "v", scope="other")
stats = cache_mod.cache_stats()
oracle = cache_mod._cache_stats_python()
assert stats["active"] == oracle["active"] == 2
assert stats["scopes"] == oracle["scopes"]
assert stats["active"] == 2
def test_handle_hook_go_vs_oracle(mem_dir):
def test_handle_hook_go(mem_dir):
got = cache_mod.handle_hook("memory.write", {"key": "h1"})
oracle = cache_mod._handle_hook_python("memory.write", {"key": "h1"})
assert got["handler"] == oracle["handler"] == "cache"
assert got["status"] == oracle["status"] == "ok"
assert got["handler"] == "cache" and got["status"] == "ok"
# -- cross-engine coherence -----------------------------------------------------
# -- escape hatch: shape kept, body refuses -----------------------------------
def test_engine_write_oracle_read(mem_dir, monkeypatch):
_put(cache_mod, "cross1", "via engine")
@pytest.mark.parametrize(
"call",
[
lambda c: c._get_cache_python("k"),
lambda c: c._put_cache_python("k", "v"),
lambda c: c._invalidate_python("k"),
lambda c: c._invalidate_scope_python("s"),
lambda c: c._invalidate_all_python(),
lambda c: c._cache_stats_python(),
lambda c: c._handle_hook_python("memory.write", {"key": "k"}),
],
)
def test_oracle_bodies_refuse(mem_dir, call):
with pytest.raises(RuntimeError, match="escape hatch retired"):
call(cache_mod)
def test_engine_disabled_refuses(mem_dir, monkeypatch):
monkeypatch.setenv("RUNE_CACHE_ENGINE", "python")
assert cache_mod.get_cache("cross1")["full"] == "via engine"
with pytest.raises(RuntimeError, match="escape hatch retired"):
cache_mod.get_cache("esc")
def test_oracle_write_engine_read(mem_dir, monkeypatch):
monkeypatch.setenv("RUNE_CACHE_ENGINE", "python")
cache_mod.put_cache("cross2", "via oracle")
monkeypatch.delenv("RUNE_CACHE_ENGINE")
assert cache_mod.get_cache("cross2")["full"] == "via oracle"
# -- facade contract -------------------------------------------------------------
def test_engine_disabled_uses_oracle(mem_dir, monkeypatch):
monkeypatch.setenv("RUNE_CACHE_ENGINE", "python")
r = cache_mod.put_cache("esc", "v")
assert r["stored"] == "esc"
# -- facade contract ------------------------------------------------------------
def test_missing_binary_fails_loud(mem_dir, monkeypatch, tmp_path):
+13 -24
View File
@@ -1,4 +1,4 @@
"""REBASE-COMPLETION (#2587) parity battery — message_queue.
"""REMOVAL-PREP (#2598 item 2) battery — message_queue.
Red-first discipline: pins the Go engine's eval surface against the
Python oracle bodies on the SAME queue.json. A mutation of an oracle
@@ -50,8 +50,9 @@ DETECT_CASES = [
@pytest.mark.parametrize("message", DETECT_CASES)
def test_detect_task_addition_go_vs_oracle(message):
is_t, conf, signals = MessageQueue().detect_task_addition(message)
o_is, o_conf, o_signals = MessageQueue()._detect_task_addition_python(message)
assert (is_t, round(conf, 6), signals) == (o_is, round(o_conf, 6), o_signals)
assert isinstance(is_t, bool) and isinstance(signals, list)
with pytest.raises(RuntimeError, match="escape hatch retired"):
MessageQueue()._detect_task_addition_python(message)
# -- add / pending / approved / status ------------------------------------------
@@ -59,10 +60,9 @@ def test_detect_task_addition_go_vs_oracle(message):
def test_add_message_go_vs_oracle(queue_dir):
got = _engine(queue_dir).add_message("add a feature", "chat")
oracle = _oracle(queue_dir).add_message("add a feature", "chat")
assert got.message == oracle.message == "add a feature"
assert got.status == oracle.status == "pending"
assert got.channel == oracle.channel == "chat"
assert got.message == "add a feature"
assert got.status == "pending"
assert got.channel == "chat"
def test_pending_approved_flow_go_vs_oracle(queue_dir):
@@ -85,10 +85,6 @@ def test_reject_go_vs_oracle(queue_dir):
assert q.reject(m.id) is True
st = q.get_status()
assert st["pending"] == 0
oracle_q = _oracle(queue_dir)
om = oracle_q.add_message("add x", "chat")
oracle_q.reject(om.id)
assert q.get_status() == oracle_q.get_status()
def test_approve_all_go_vs_oracle(queue_dir):
@@ -109,29 +105,22 @@ def test_clear_go_vs_oracle(queue_dir):
# -- cross-engine coherence --------------------------------------------------------
def test_engine_write_oracle_read(queue_dir):
def test_engine_state_roundtrip(queue_dir):
q = _engine(queue_dir)
m = q.add_message("cross", "chat")
mo = _oracle(queue_dir)
assert any(x.id == m.id for x in mo.get_pending())
def test_oracle_write_engine_read(queue_dir):
mo = _oracle(queue_dir)
m = mo.add_message("cross back", "chat")
q = _engine(queue_dir)
assert any(x.id == m.id for x in q.get_pending())
q2 = _engine(queue_dir)
assert any(x.id == m.id for x in q2.get_pending())
# -- facade contract ------------------------------------------------------------------
def test_engine_disabled_uses_oracle(queue_dir):
def test_engine_disabled_refuses(queue_dir):
os.environ["RUNE_MESSAGE_QUEUE_ENGINE"] = "python"
try:
q = MessageQueue()
m = q.add_message("oracle path", "chat")
assert m.status == "pending"
with pytest.raises(RuntimeError, match="escape hatch retired"):
q.add_message("oracle path", "chat")
finally:
os.environ.pop("RUNE_MESSAGE_QUEUE_ENGINE", None)