diff --git a/tools/corpus_engine.py b/tools/corpus_engine.py index 183e7c0f..28fedbf1 100755 --- a/tools/corpus_engine.py +++ b/tools/corpus_engine.py @@ -32,6 +32,14 @@ RETIRED_RE = re.compile( r"DESIGN[.]md amendment|^Constitution:", re.I | re.M, ) +RETIRED_RUNTIME_SYMBOL_RE = re.compile( + r"\b(?:submit_ops_job|OperationsState|PendingOpsJob|OpsJobKind)\b" +) +RETIRED_RUNTIME_HISTORY_RE = re.compile( + r"\b(?:former|retir(?:ed|ement)|legacy|supersed(?:e|ed|es|ing)|" + r"histor(?:y|ical)|migrat(?:e|ed|es|ing|ion)|no longer|removed)\b", + re.I, +) BINDING_DOORWAY_RE = re.compile( r"^Type: (law|spec)$|^Status:|^## Decisions log|^## Acceptance criteria", re.M, @@ -250,6 +258,37 @@ class Engine: if count == 0: self.bad(f"{rel} has no Depends on references; use 'Depends on: none'") + def validate_retired_runtime_authority(self, rel: str, text: str) -> None: + paragraphs = re.finditer( + r"(?:^|\n[ \t]*\n)(.*?)(?=\n[ \t]*\n|\Z)", text, re.S + ) + for paragraph in paragraphs: + body = paragraph.group(1) + symbol = RETIRED_RUNTIME_SYMBOL_RE.search(body) + if symbol is None or RETIRED_RUNTIME_HISTORY_RE.search(body): + continue + line = text.count("\n", 0, paragraph.start(1) + symbol.start()) + 1 + self.bad( + f"{rel}:{line} names retired live-runtime symbol " + f"'{symbol.group(0)}' without explicit historical context" + ) + + def validate_retired_runtime_code(self) -> None: + candidates: list[Path] = [] + for root_name in ("crates", "src"): + root = self.root / root_name + if root.is_dir(): + candidates.extend(root.rglob("*.rs")) + for path in sorted(candidates): + text = self.read(path) + for symbol in RETIRED_RUNTIME_SYMBOL_RE.finditer(text): + rel = path.relative_to(self.root).as_posix() + line = text.count("\n", 0, symbol.start()) + 1 + self.bad( + f"{rel}:{line} contains retired live-runtime symbol " + f"'{symbol.group(0)}'" + ) + def run_corpus(self) -> int: for path in self.wiki_md_files(): rel = path.relative_to(self.root).as_posix() @@ -261,6 +300,9 @@ class Engine: self.bad(f"{rel} must declare exactly one supported Type:") continue + if types[0] in {"law", "spec"}: + self.validate_retired_runtime_authority(rel, text) + generated = GENERATED_LINE_RE.findall(self.metadata_block(text)) if len(generated) > 1: self.bad(f"{rel} must declare at most one Generated:") @@ -299,6 +341,8 @@ class Engine: self.validate_design_refs(rel, text) self.validate_depends_refs(rel, text) + self.validate_retired_runtime_code() + design = self.root / "DESIGN.md" if not design.is_file(): self.bad("DESIGN.md missing") diff --git a/tools/test_corpus_engine.sh b/tools/test_corpus_engine.sh index 994a3533..24b96543 100755 --- a/tools/test_corpus_engine.sh +++ b/tools/test_corpus_engine.sh @@ -346,6 +346,51 @@ echo "$out" | grep -q 'retired single-file-authority language' || { fail=1 } +echo "=== fixture: retired live-runtime Rust symbol ===" +root=$tmp/retired-runtime-rust +setup_base "$root" +mkdir -p "$root/crates/core/src" +cat > "$root/crates/core/src/lib.rs" <<'EOF' +// Stale call path: submit_ops_job queues this work. +pub fn current_runtime() {} +EOF +assert_fails retired-runtime-rust --root "$root" --corpus +out=$(python3 "$engine" --root "$root" --corpus 2>&1 || true) +echo "$out" | grep -q "contains retired live-runtime symbol 'submit_ops_job'" || { + echo "FAIL: retired-runtime Rust diagnostic missing" + echo "$out" + fail=1 +} + +echo "=== fixture: retired live-runtime authority claim ===" +root=$tmp/retired-runtime-authority +setup_base "$root" +cat >> "$root/wiki/process/good.md" <<'EOF' + +The active runtime queues each operation as a `PendingOpsJob`. +EOF +assert_fails retired-runtime-authority --root "$root" --corpus +out=$(python3 "$engine" --root "$root" --corpus 2>&1 || true) +echo "$out" | grep -q "names retired live-runtime symbol 'PendingOpsJob' without explicit historical context" || { + echo "FAIL: retired-runtime authority diagnostic missing" + echo "$out" + fail=1 +} + +echo "=== fixture: explicit retired history and legacy migration names ===" +root=$tmp/retired-runtime-history +setup_base "$root" +cat >> "$root/wiki/process/good.md" <<'EOF' + +The retired `PendingOpsJob` model is kept here as superseded history only. +EOF +mkdir -p "$root/crates/core/src" +cat > "$root/crates/core/src/lib.rs" <<'EOF' +struct LegacyPendingOpsJob; +enum LegacyOpsJobKind { Retired } +EOF +assert_ok retired-runtime-history --root "$root" --corpus + if [ "$fail" -ne 0 ]; then echo "corpus engine fixtures: FAILED" exit 1 diff --git a/wiki/log/2026-07-11-retired-runtime-identifier-gate.md b/wiki/log/2026-07-11-retired-runtime-identifier-gate.md new file mode 100644 index 00000000..cfddc12d --- /dev/null +++ b/wiki/log/2026-07-11-retired-runtime-identifier-gate.md @@ -0,0 +1,40 @@ +# Retired Operations identifiers become a corpus gate + +``` +Type: log +``` + +## Intent + +Consume the oldest tick-ledger finding after stale Operations-docket language +recurred in both the simulation corpus and a live Rust comment. + +## Finding + +The current tree no longer contained bare retired runtime symbols in Rust. +Binding pages still named `PendingOpsJob`, but every surviving use was +explicitly marked former, superseded history, migration context, or no longer +live. Legacy save types use distinct `Legacy*` names and plot compatibility +uses the lower-case `operations_demand` serde alias. + +## Change + +The one-pass corpus engine now rejects `submit_ops_job`, `OperationsState`, +`PendingOpsJob`, and `OpsJobKind` from Rust source or comments. In Type law and +Type spec pages, an exact retired symbol is accepted only in a paragraph with +explicit historical context. Fixtures prove a stale Rust comment and a live +authority claim fail while retired prose and `LegacyPendingOpsJob` continue to +pass. + +## Checks + +- `bash tools/test_corpus_engine.sh` +- `python3 tools/corpus_engine.py --corpus` +- `./tools/check.sh --docs` + +## Defense + +[The tick intake contract](../process/agent-scale.md#12-persistent-tick-intake-memory) +promotes recurring mechanical findings into corpus-engine checks. This gate +prevents removed execution models from silently returning as present-tense +code or authority while preserving explicit migration and design history. diff --git a/wiki/log/DEVLOG.md b/wiki/log/DEVLOG.md index 9374b698..bad379dd 100644 --- a/wiki/log/DEVLOG.md +++ b/wiki/log/DEVLOG.md @@ -106,6 +106,11 @@ add or amend a session log, then re-run the generator. - Intent: (see session log) - Log: [wiki/log/2026-07-11-runtime-bound-plot-templates.md](2026-07-11-runtime-bound-plot-templates.md) +## 2026-07-11 - Retired Operations identifiers become a corpus gate + +- Intent: Consume the oldest tick-ledger finding after stale Operations-docket language recurred in both the simulation corpus and a live Rust comment. +- Log: [wiki/log/2026-07-11-retired-runtime-identifier-gate.md](2026-07-11-retired-runtime-identifier-gate.md) + ## 2026-07-11 - Operations dockets retire into Thought reservoirs - Intent: Finish the save-class machine-work slice: remove live `OperationsState` / `PendingOpsJob` / `OpsJobKind` runtime machinery, so every player-authored effect opens a physical Thought reservoir or tap at the real target or carrier. diff --git a/wiki/process/agent-scale.md b/wiki/process/agent-scale.md index 0c02063d..759bfec4 100644 --- a/wiki/process/agent-scale.md +++ b/wiki/process/agent-scale.md @@ -267,7 +267,12 @@ tools/test_corpus_engine.sh # fixture suite (also in check.sh docs path) Requires `python3` (same as ledger_index.sh). Any page with a valid `Generated:` metadata owner is skipped for link checks so a derived, truncated blurb cannot false-fail; the corpus gate verifies that the generator target -exists. +exists. The same pass rejects the retired live-runtime symbols +`submit_ops_job`, `OperationsState`, `PendingOpsJob`, and `OpsJobKind` from +Rust source and comments. Binding law/spec pages may name those exact symbols +only inside a paragraph that explicitly marks the reference former, retired, +legacy, superseded, historical, migrated, no longer live, or removed. Legacy- +prefixed save migration types remain valid because they are distinct symbols. ### Acceptance criteria (slice E) — HELD 2026-07-10 @@ -275,7 +280,8 @@ exists. HELD (~0.3s each for wiki + corpus on ~200 pages). 2. Fixture tests cover reachability, links, Design and dependency anchors, exact roles/status, generated owners, doorway bounds/structure, and retired - authority wording — HELD (`tools/test_corpus_engine.sh`). + authority/runtime wording, including explicit historical and migration + exemptions — HELD (`tools/test_corpus_engine.sh`). 3. Existing hooks and the fast CI workflow still call `tools/wiki_gate.sh` and `tools/corpus_gate.sh` — HELD. diff --git a/wiki/process/tick-ledger.md b/wiki/process/tick-ledger.md index f29f7ee5..2a2b48e4 100644 --- a/wiki/process/tick-ledger.md +++ b/wiki/process/tick-ledger.md @@ -20,6 +20,7 @@ Verdicts: **clean** (slice and code agree), **finding** (acted this tick), | Slice | Last audited | Verdict | Trace | |---|---|---|---| +| retired Operations runtime identifiers | 2026-07-11 | finding | [log](../log/2026-07-11-retired-runtime-identifier-gate.md) | | `wiki/mechanics/reach.md` + `building.md` | 2026-07-11 | finding | runtime and tests agree with the contracts; repaired `digital_reach`'s stale `submit_ops_job` comment to name target-local Thought reservoirs | | `wiki/mechanics/messages.md` | 2026-07-11 | clean | delivery/read cadence, authored traffic, filing carrier, capture gates, and processing tests agree with current runtime | | `wiki/mechanics/sim-mechanics.md` | 2026-07-11 | finding | [log](../log/2026-07-11-tick-sim-no-dockets.md) | @@ -41,5 +42,3 @@ Format: `- YYYY-MM-DD · type · slice · one-line statement of the finding`. Types are the five from [tick.md](tick.md): violation, contradiction, question, bug, insecurity — plus `gate` for a checker owed to the recurrence-promotes-to-the-gate rule. - -- 2026-07-11 · gate · retired runtime identifiers · Add a mechanical check rejecting removed live-runtime identifiers such as `submit_ops_job` in current code/comments and authority pages; the same stale Operations wording previously appeared in `sim-mechanics.md`.