Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EVIDENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
29 changes: 29 additions & 0 deletions acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)")

Expand Down
4 changes: 2 additions & 2 deletions explorer/data/scenarios.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
7 changes: 6 additions & 1 deletion scopemoat/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion scopemoat/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 6 additions & 1 deletion scopemoat/picture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}, {}, [], {}

Expand Down
5 changes: 4 additions & 1 deletion scopemoat/rules_v5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading