From ecddabb0c0656acdbb66ca2dbe6519b929604de6 Mon Sep 17 00:00:00 2001 From: Devin Phillip Davis <354534380+quantum-osiris@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:56:46 -0500 Subject: [PATCH] feat(claims): check the voice's reply against the register; register OSIRIS_ON_QPU The register was checked against the user's message only. Now every mentor reply is checked too: a not-legit (or evidence-free) claim the voice brings up that the message did not is shown under the reply with its verdict and /legit link, and the exchange is not learned (ledger row: learnable false, flagged_claims). A reference is not an endorsement, as with match(): the flag keeps the reply out of training; it does not say the reply was wrong. New entry OSIRIS_ON_QPU (OVERCLAIM): OSIRIS's model running on, trained on or integrated with quantum hardware -- three sentences qwen2.5:1.5b wrote on 2026-11-09. The core is a NumPy transformer trained on the local CPU; hardware runs are separate recorded experiments. Full suite: 1792 passed, 13 skipped, 2 failed (the same two host-specific failures as main). Co-Authored-By: Claude Opus 5.5 --- osiris_cli/claims.py | 44 ++++++++++++++++++++++++++++++++++ osiris_cli/living.py | 17 ++++++++++++-- tests/test_claims.py | 56 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 2 deletions(-) diff --git a/osiris_cli/claims.py b/osiris_cli/claims.py index b876fb06..3c111a8f 100644 --- a/osiris_cli/claims.py +++ b/osiris_cli/claims.py @@ -54,6 +54,10 @@ _DUR46 = r"(? str: (r"\bnclm\b", r"(core|osiris)[^.\n]{0,30}\blearn\w*", r"living (language )?model"), testable="A confirmatory run that replicates the training run (about 4 runs for a 0.05 " "bits/byte minimum effect), not only held-out items."), + # The voice's own most frequent invention (2026-11-09, qwen2.5:1.5b): "OSIRIS operates on a quantum + # computer with 156 qubits", "IBM Heron ... utilized in the model's training". + Claim("OSIRIS_ON_QPU", "OSIRIS (its language model) runs on, is trained on, or is integrated with quantum " + "hardware", "OVERCLAIM", + "OSIRIS's core (osiris.nclm) is a small NumPy transformer trained on this computer's CPU by " + "osiris train; its voice is a local Ollama model. Quantum hardware appears only in separate, " + "recorded experiments that OSIRIS's tools submitted (for example staggered dynamical decoupling on " + "ibm_marrakesh). No OSIRIS model has been trained or run on a quantum processor.", + (("file", "osiris_cli/train.py", "the core's trainer: NumPy on the local CPU, no quantum backend"), + ("doi", "10.5281/zenodo.23967473", "the Heron r2 decoupling campaign: an experiment, not the model")), + (_SELF + r"[^.\n]{0,60}?\b(?:operates? on|runs? on|running on|(?:is |was |been )?trained (?:on|with|" + r"using)|integrated with|built on|powered by|works? with|utiliz\w+|executes? on)\b[^.\n]{0,60}?" + _QHW, + _QHW + r"[^.\n]{0,80}?\b(?:utiliz\w*|used|employed)\b[^.\n]{0,20}?\b(?:in|for) (?:the model'?s|" + r"osiris'?s?|its) training")), Claim("NCLM_MECHANICS", "The NCLM core is a non-causal, physics-based model: pilot-wave non-local attention, " "torsion-locked attention and phase-conjugate positional encoding", "NOT_MEASURED", "Ordinary transformer parts under physics names (osiris/nclm). The core is a causal decoder: it masks " @@ -518,6 +536,32 @@ def match(text: str, limit: Optional[int] = None) -> List[Claim]: return out[:limit] if limit else out +# A reply is flagged for a claim it brings up only when the register says the claim is not legit or +# has nothing behind it; pilots and untested proposals are open questions, not errors. +FLAG_STANDINGS = ("not supported", "not legit", "not legit as worded") + + +def flagged_in_reply(reply: str, already: Sequence[Claim] = ()) -> List[Claim]: + """Not-legit (or evidence-free) claims a model's reply brings up that the user's message did not. + + Like match(), this finds references, not endorsements: a reply saying a claim was refuted is + flagged too. The flag shows the register's verdict next to the reply and keeps the reply out + of training; it does not say the reply was wrong.""" + seen = {c.id for c in already} + return [c for c in match(reply) if c.id not in seen + and (c.standing() in FLAG_STANDINGS or c.verdict == "NO_EVIDENCE")] + + +def reply_block(claims: Sequence[Claim]) -> str: + """Shown under a reply: the register's verdicts on claims the voice brought up.""" + lines = [] + for c in claims: + standing, meaning = VERDICTS[c.verdict] + lines.append(f" {MARK[standing]} {c.id}: {c.verdict} -- {standing}: {meaning}. /legit {c.id}") + return ("Claims register, on the reply (the voice brought these up; checked by OSIRIS's code):\n" + + "\n".join(lines) + "\n") + + def by_id(claim_id: str) -> Optional[Claim]: return next((c for c in REGISTER if c.id.lower() == claim_id.lower()), None) diff --git a/osiris_cli/living.py b/osiris_cli/living.py index a6ed9434..e90498f7 100644 --- a/osiris_cli/living.py +++ b/osiris_cli/living.py @@ -1080,6 +1080,7 @@ def converse(self, text: str, learnable: bool = True, sent_user = None incomplete = "" looped = False + flagged_claims: list = [] force_core = getattr(self, "force_core_voice", None) use_core_voice = bool(force_core) if force_core is not None else (os.environ.get("OSIRIS_CORE_VOICE", "1") != "0") if gate["open"] and self.core is not None and use_core_voice: @@ -1157,11 +1158,21 @@ def converse(self, text: str, learnable: bool = True, if incomplete: self.out(f" …[incomplete: {incomplete}]") self.out("\n") + if not interrupted and reply: + try: + from osiris_cli import claims as claims_mod + flagged_claims = claims_mod.flagged_in_reply(reply, self._claims_hit) + except Exception: # noqa: BLE001 - a broken register must not lose the reply + flagged_claims = [] + if flagged_claims: + self.out(claims_mod.reply_block(flagged_claims)) idx = self.stats["exchanges"] if interrupted: note = "not learned: interrupted" elif incomplete: note = "not learned: incomplete reply" + elif flagged_claims: + note = "not learned: the reply brings up claims the register marks not legit" elif effective_learnable and self.core is None: note = "recorded; no core is loaded, so nothing is learned" elif effective_learnable and idx % HELDOUT_EVERY == 0: @@ -1209,7 +1220,8 @@ def converse(self, text: str, learnable: bool = True, "t": time.strftime("%Y-%m-%dT%H:%M:%S"), "voice": voice, "heldout": heldout, - "learnable": effective_learnable and not interrupted and not incomplete, + "learnable": effective_learnable and not interrupted and not incomplete and not flagged_claims, + "flagged_claims": [c.id for c in flagged_claims] or None, "incomplete": incomplete or None, "user": text, "reply": reply, @@ -1225,7 +1237,8 @@ def converse(self, text: str, learnable: bool = True, if (resolved_transport in ("bracketed_paste", "unknown")) or not effective_learnable: self.last_paste = dict(rec_data, hash=key) self._save_stats() - if effective_learnable and not interrupted and not incomplete and voice != "core" and self.core is not None: + if effective_learnable and not interrupted and not incomplete and not flagged_claims \ + and voice != "core" and self.core is not None: self._after(lesson, reply, heldout, key, idx) return reply diff --git a/tests/test_claims.py b/tests/test_claims.py index 956316ed..1d84d1f5 100644 --- a/tests/test_claims.py +++ b/tests/test_claims.py @@ -1,4 +1,5 @@ """The claims register and physics checks: OSIRIS deciding what is legit, by code, before a model speaks.""" +import json import math import re from pathlib import Path @@ -396,3 +397,58 @@ def model(self): o.converse("does a Poynting asymmetry give propellantless thrust?") text = "".join(out) assert "RULED_OUT" in text and "no mentor model is reachable" in text + + +# ── the reply: code checks what the voice brought up ───────────────────────── + +@pytest.mark.parametrize("text", [ + "OSIRIS operates on a quantum computer with 156 qubits, utilizing the hash-chained ledger.", + "OSIRIS is designed to work with quantum hardware, such as the IBM Heron r2 with 156 qubits, which has " + "been utilized in the model's training.", + "OSIRIS is integrated with IBM Heron hardware, specifically the r2 version with 156 qubits.", +]) +def test_the_voices_own_quantum_inventions_are_registered(text): + # all three said by qwen2.5:1.5b on 2026-11-09 + assert [c.id for c in claims.flagged_in_reply(text)] == ["OSIRIS_ON_QPU"] + + +@pytest.mark.parametrize("text", [ + "OSIRIS ran the staggered decoupling experiment on ibm_marrakesh.", + "The core is a small transformer trained on this computer.", + "Quantum computers with 156 qubits exist today.", + "The model runs on your CPU with Ollama.", +]) +def test_true_statements_about_osiris_and_hardware_are_not_flagged(text): + assert claims.flagged_in_reply(text) == [] + + +def test_pilots_and_untested_claims_are_not_flagged(): + assert "NCLM_CORE" in [c.id for c in claims.match("OSIRIS is a living language model")] + assert claims.flagged_in_reply("OSIRIS is a living language model") == [] + + +def test_a_reply_bringing_up_a_not_legit_claim_shows_the_verdict_and_is_not_learned(tmp_path): + mentor = ScriptedMentor(reply="OSIRIS operates on a quantum computer with 156 qubits.") + o, out = make(tmp_path, mentor) + o.converse("tell me about yourself") + text = "".join(out) + assert text.index("156 qubits") < text.index("Claims register, on the reply") + assert "OSIRIS_ON_QPU: OVERCLAIM" in text and "/legit OSIRIS_ON_QPU" in text + assert "not learned: the reply brings up claims the register marks not legit" in text + assert o.core.learned == [] + row = json.loads(open(tmp_path / "exchanges.jsonl").read().splitlines()[-1]) + assert row["learnable"] is False and row["flagged_claims"] == ["OSIRIS_ON_QPU"] + + +def test_a_claim_the_user_raised_is_not_flagged_again_on_the_reply(tmp_path): + mentor = ScriptedMentor(reply="It was refuted: theta lock 51.843 showed no resonance.") + o, out = make(tmp_path, mentor) + o.converse("is the 51.843 theta lock real?") + text = "".join(out) + assert "REFUTED" in text and "Claims register, on the reply" not in text + + +def test_an_ordinary_reply_is_not_flagged(tmp_path): + o, out = make(tmp_path) + o.converse("hello osiris") + assert "on the reply" not in "".join(out)