From f5227a6c4d5b2ada595940ffbae623f71b9eb4a8 Mon Sep 17 00:00:00 2001 From: Daniel Ziegler <281686281+Innov8zig@users.noreply.github.com> Date: Sat, 5 Dec 2026 07:31:49 -0800 Subject: [PATCH] Direct join to a CDE network: the headline names the system entering the CDE directly and the Relate line credits Relate's in-scope classes (known quirk 1); acceptance Q1; EVIDENCE count 141 --- EVIDENCE.md | 2 +- acceptance.py | 29 +++++++++++++++++++++++++++++ explorer/data/scenarios.json | 4 ++-- scopemoat/cli.py | 7 ++++++- scopemoat/engine.py | 5 ++++- scopemoat/picture.py | 7 ++++++- scopemoat/rules_v5.py | 5 ++++- 7 files changed, 52 insertions(+), 7 deletions(-) diff --git a/EVIDENCE.md b/EVIDENCE.md index 91a699a..995855e 100644 --- a/EVIDENCE.md +++ b/EVIDENCE.md @@ -12,7 +12,7 @@ Every result ScopeMoat publishes, where its record lives, and the command that r | Relate path query agrees with the Python reference: 0 membership mismatches over 539 fixture-by-case comparisons | main | `blind/v5/reach_crosscheck.py`, `blind/v5/reach_inventory.json` | `python acceptance.py` (check K7) | | Browser explorer: Relate's WebAssembly build (1.4.0) returns the same rows as relate-db for every recorded state, 6/6 (proposal, repair, missing evidence; baseline and candidate each) | main | `explorer/` (index.html, data/scenarios.json, vendor/relate-wasm-1.4.0/) | `python -m explorer.build_export --check` (exit 0: data current), then `node explorer/parity.mjs` (expected `Parity: 6/6 states identical`) | | Transit search guard: on the pinned forwarding-clique fixture, 5 forwarding systems still BLOCK with the same Relate path; 6 and 20 are held for review by the search-size guard in under 0.2 s instead of 23 s / out of memory | main | `perf/README.md`, `perf/forwarding_clique.py`, `perf/bench.py` | `python perf/bench.py 5 6 7 20`; acceptance P1-P3 | -| Engine and gate behaviour | main | `acceptance.py` (140 required checks), `blind/v5/checks_v5.py` (67), `t3/test_t3.py` (36) | `python acceptance.py`; `python blind/v5/checks_v5.py`; `python t3/test_t3.py` | +| Engine and gate behaviour | main | `acceptance.py` (141 required checks), `blind/v5/checks_v5.py` (67), `t3/test_t3.py` (36) | `python acceptance.py`; `python blind/v5/checks_v5.py`; `python t3/test_t3.py` | ## How to read these diff --git a/acceptance.py b/acceptance.py index db89ea6..be75ff2 100644 --- a/acceptance.py +++ b/acceptance.py @@ -1931,6 +1931,35 @@ def _epr(name, edits): finally: shutil.rmtree(_edir, ignore_errors=True) +# Q: a direct join to a CDE network names the system entering the CDE in the headline and in the Relate line +# (known quirk 1: v1.0.3 printed "0 move into the CDE" and "Relate: no new path to the CDE" for this case). +_qdir = tempfile.mkdtemp(prefix="acc-quirk1-") +try: + _qr = os.path.join(_qdir, "repo") + subprocess.run(["git", "clone", "-q", HERE, _qr], capture_output=True, timeout=300) + with open(os.path.join(_qr, "deploy", "compose.yaml"), encoding="utf-8") as _f: + _qs = _f.read() + _qi = _qs.index(" bi-dashboards:") + _qj = _qs.index("networks: [bi-net]", _qi) + with open(os.path.join(_qr, "deploy", "compose.yaml"), "w", encoding="utf-8", newline="\n") as _f: + _f.write(_qs[:_qj] + "networks: [bi-net, checkout-net]" + _qs[_qj + len("networks: [bi-net]"):]) + subprocess.run(["git", "add", "deploy/compose.yaml"], cwd=_qr, capture_output=True) + _q = subprocess.run([sys.executable, "-m", "scopemoat", "gate"], cwd=_qr, capture_output=True, text=True, + encoding="utf-8", timeout=300, env={**os.environ, "PYTHONPATH": _qr}) + _qd = subprocess.run([sys.executable, "-m", "scopemoat", "check", "graph/brightline.rl", "changes/bi_to_orders.json"], + cwd=HERE, capture_output=True, text=True, encoding="utf-8", timeout=300) + check("Q1 a direct join to a CDE network: the headline names the system entering the CDE directly (no '0 move into the CDE'), " + "the Relate line credits Relate's in-scope classes instead of 'no new path to the CDE', and the demo headline is unchanged", + _q.returncode == 1 + and "VERDICT: BLOCK: 3 system(s) enter scope (1 directly into the CDE: bi-dashboards)\n" in _q.stdout + and "move into the CDE" not in _q.stdout.split("VERDICT:")[1].splitlines()[0] + and "no new path to the CDE" not in _q.stdout + and "Relate: Relate's in-scope classes put bi-dashboards in the CDE by a direct link; no new path through other systems" in _q.stdout + and "VERDICT: BLOCK: 1 system(s) enter scope, 0 move into the CDE" in _qd.stdout, + f"exit {_q.returncode}") +finally: + shutil.rmtree(_qdir, ignore_errors=True) + print("[RECORD] T3 agent repair: t3/runs/20261130T025027Z_bi_order_status (replay: python -m t3.clean_replay)") print("[RECORD] T4 benchmark: t4/runs/live1/README.md (one paid batch, blind-scored; arm B did not win)") diff --git a/explorer/data/scenarios.json b/explorer/data/scenarios.json index 7ddb837..925c361 100644 --- a/explorer/data/scenarios.json +++ b/explorer/data/scenarios.json @@ -1,6 +1,6 @@ { - "commit": "55b298b", - "engine": "scopemoat/engine.py (committed; rules v5: scopemoat/rules_v5.py sha256 7927ee145cbf)", + "commit": "5408016", + "engine": "scopemoat/engine.py (committed; rules v5: scopemoat/rules_v5.py sha256 b50aa3a2ba54)", "relate_db": "1.4.0", "scenarios": [ { diff --git a/scopemoat/cli.py b/scopemoat/cli.py index 68dcd8e..bbd68f4 100644 --- a/scopemoat/cli.py +++ b/scopemoat/cli.py @@ -203,7 +203,12 @@ def report_reach(result, out=print, explain=False, ops=None): "change applied; no such path before the change)") for t in attribution(result, row, ops): out(f"Opened by: {t}") - if not rec["new"]: + direct = sorted(n for n, f in (getattr(result, "entered_scope", None) or {}).items() + if getattr(f, "category", None) == "CDE") + if not rec["new"] and direct: + out(f"Relate: Relate's in-scope classes put {', '.join(direct)} in the CDE by a direct link; " + "no new path through other systems") + elif not rec["new"]: out("Relate: no new path to the CDE (Cypher on the Relate copy of the baseline, before and after the change)") kept = sorted(set(cand) & base & {op.get(e) for op in ops or [] for e in ("source", "target")}) if kept: diff --git a/scopemoat/engine.py b/scopemoat/engine.py index 1547d8b..126219c 100644 --- a/scopemoat/engine.py +++ b/scopemoat/engine.py @@ -406,7 +406,10 @@ def cde(scope, k): if entered or moved: verdict = BLOCK - summary = f"{len(entered)} system(s) enter scope, {len(moved)} move into the CDE" + direct = sorted(k for k, v in entered.items() if v.category == "CDE") + summary = (f"{len(entered)} system(s) enter scope" + + (f" ({len(direct)} directly into the CDE: {', '.join(direct)})" if direct else "") + + ("" if direct and not moved else f", {len(moved)} move into the CDE")) elif review: verdict = REVIEW summary = (f"{len(review)} system(s) enter scope or the CDE unless the evidence below is resolved") diff --git a/scopemoat/picture.py b/scopemoat/picture.py index 75a6e9e..73a861e 100644 --- a/scopemoat/picture.py +++ b/scopemoat/picture.py @@ -59,7 +59,12 @@ def mermaid(result, ops=None, title=None): if rec.get("error"): lines.append(f' err["Relate could not answer: REVIEW REQUIRED"]') elif not rec.get("new"): - lines.append(' none["Relate: no new path to the CDE"]') + direct = sorted(n for n, f in (getattr(result, "entered_scope", None) or {}).items() + if getattr(f, "category", None) == "CDE") + if direct: + lines.append(f' none["Relate\'s in-scope classes put {", ".join(direct)} in the CDE by a direct link, no new path through other systems"]') + else: + lines.append(' none["Relate: no new path to the CDE"]') # collect every returned path first: one declaration per system (roles merged), one edge per hop roles, edges, notes, ids = {}, {}, [], {} diff --git a/scopemoat/rules_v5.py b/scopemoat/rules_v5.py index 0e18b3b..ebb0ea6 100644 --- a/scopemoat/rules_v5.py +++ b/scopemoat/rules_v5.py @@ -1294,7 +1294,10 @@ def _relate_class(k): review_groups[head] = others review_detail[head] = [l for _, _, l in ordered] if entered or moved: - verdict, summary = E.BLOCK, f"{len(entered)} system(s) enter scope, {len(moved)} move into the CDE" + direct = sorted(k for k, v in entered.items() if v.category == "CDE") + verdict, summary = E.BLOCK, (f"{len(entered)} system(s) enter scope" + + (f" ({len(direct)} directly into the CDE: {', '.join(direct)})" if direct else "") + + ("" if direct and not moved else f", {len(moved)} move into the CDE")) elif review: verdict, summary = E.REVIEW, f"{len(review)} system(s) gain access whose effect on the CDE depends on unresolved evidence" else: