@christang/keel 5.90.2 → 5.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,8 +47,8 @@ REQUIRED_SCRIPTS = [
47
47
  "scripts/validate_plugin.py",
48
48
  ]
49
49
 
50
- PACKAGE_VERSION = "5.90.2"
51
- PROTOCOL_VERSION = "5.90.2"
50
+ PACKAGE_VERSION = "5.92.0"
51
+ PROTOCOL_VERSION = "5.92.0"
52
52
  LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
53
53
  OPENSPEC_SCHEMA_NAME = "keel-spec-driven"
54
54
  # Mirrors KEEL_PACKAGE_NAME in scripts/install_to_repo.py, one of the two
@@ -29733,6 +29733,90 @@ def validate_a_quoted_span_is_not_a_claim_scenario() -> int:
29733
29733
  return 0
29734
29734
 
29735
29735
 
29736
+ def validate_a_task_field_cites_its_provenance_scenario() -> int:
29737
+ """Issue #213: a Review field naming its base failed `keel state`.
29738
+
29739
+ The contextual-hash rule matched a context word and a hash-shaped token
29740
+ anywhere on one line, and the dirty rule matched the bare word. Inside a
29741
+ task field that reads cited provenance as recorded state: the base a Scope
29742
+ check compared against (which keel-review-checklist asks it to name), the
29743
+ commit a result ran on, a cache buffer's `dirty groups`, and a negation
29744
+ about another checkout. Each accepted line below is one rtl_ppa_prj wrote,
29745
+ shortened; line 262's shape is an Acceptance criterion of a checked task,
29746
+ so rewording it would move a recorded fingerprint.
29747
+ """
29748
+ label = "a-task-field-cites-its-provenance"
29749
+ task = "- [x] A1 implementation\n"
29750
+ accepted = (
29751
+ ("a Scope check naming its base",
29752
+ " - Evidence:\n - Review:\n - Scope check: git diff against task-start "
29753
+ "base 1f3a6b0 changes only the declared TB. Frozen input hashes identify "
29754
+ "actual 211dfb5 RTL.\n"),
29755
+ ("an Acceptance check naming the commit it ran on",
29756
+ " - Evidence:\n - Review:\n - Acceptance check: P2 55/55 on dec4d6e. "
29757
+ "All 15 manifests match current source hashes.\n"),
29758
+ ("an Acceptance criterion bounding scope by a base",
29759
+ " - Acceptance:\n - Only declared files change after synchronized base "
29760
+ "dec4d6e. Capture shared HEAD and reject unexpected staged scope before commit.\n"),
29761
+ ("a domain term",
29762
+ " - Evidence:\n - M2: pass. All 24 resource traces end with no dirty groups.\n"),
29763
+ ("a negation about another checkout",
29764
+ " - Evidence:\n - Review:\n - Scope check: no design edits were authored "
29765
+ "or copied from uncommitted Claude changes.\n"),
29766
+ )
29767
+ refused = (
29768
+ ("a commit recorded in a field",
29769
+ " - Evidence:\n - M1: pass, committed to main as a1b2c3d.\n"),
29770
+ ("HEAD recorded in a field", " - Evidence:\n - M1: HEAD is at a1b2c3d.\n"),
29771
+ ("a merge recorded in Chinese", " - Evidence:\n - M1: 已合入 a1b2c3d。\n"),
29772
+ ("work state stated in a field",
29773
+ " - Evidence:\n - M1: pass, but the work is still uncommitted.\n"),
29774
+ ("a Status value", " - Evidence:\n - Status: dirty\n"),
29775
+ )
29776
+
29777
+ with tempfile.TemporaryDirectory(prefix="keel-task-field-") as raw:
29778
+ check, failure = _tasks_semantics_probe(raw)
29779
+ if failure is not None:
29780
+ report(f"{label}: keel --install failed while building the fixture.")
29781
+ report(failure)
29782
+ return 1
29783
+ for description, body in accepted:
29784
+ state, errors = check(task + body)
29785
+ if state == "unreported":
29786
+ report(f"{label}: keel --check reported no state at all on {description}.")
29787
+ return 1
29788
+ if state != "ok":
29789
+ report(f"{label}: {description} was refused as recorded state. A task "
29790
+ "field cites its provenance, and the only repair open to the "
29791
+ "author is to leave the evidence out.")
29792
+ for error in errors:
29793
+ report(f" {error}")
29794
+ return 1
29795
+ # The boundary: a bound claim inside a field, and any claim outside one.
29796
+ for description, body in (*refused, (
29797
+ "a title line carrying a context word and a hash apart",
29798
+ "- [x] A1 done on main, see a1b2c3d\n - Touch:\n - src/a.js\n",
29799
+ )):
29800
+ text = body if body.startswith("- [") else task + body
29801
+ state, errors = check(text)
29802
+ if state == "unreported":
29803
+ report(f"{label}: keel --check reported no state at all on {description}.")
29804
+ return 1
29805
+ if state != "failed":
29806
+ report(f"{label}: {description} was accepted. Binding the rule to a "
29807
+ "claim must not stop it refusing the claim.")
29808
+ return 1
29809
+ if not [error for error in errors if "tasks.md:" in error]:
29810
+ report(f"{label}: the refusal of {description} named no line.")
29811
+ return 1
29812
+
29813
+ if label not in {name for name, _ in SCENARIOS}:
29814
+ report(f"{label}: the scenario registry does not include it.")
29815
+ return 1
29816
+ report(f"{label} scenario passed.")
29817
+ return 0
29818
+
29819
+
29736
29820
  def validate_a_covers_citation_is_not_a_record_scenario() -> int:
29737
29821
  """Issue #65 §4: the rule refused a tasks.md that cited it.
29738
29822
 
@@ -35166,6 +35250,376 @@ def validate_codex_receiving_scenario() -> int:
35166
35250
  return result.returncode
35167
35251
 
35168
35252
 
35253
+ EXTERNAL_AGENT_FACT_FIELDS = {
35254
+ "name", "source", "executable", "resolved", "allowed",
35255
+ "command", "sandbox", "sendsTo", "pitfalls",
35256
+ }
35257
+
35258
+
35259
+ def _external_agents_env(base: Path) -> tuple[dict[str, str], Path]:
35260
+ """An environment whose Keel home and PATH belong to the fixture.
35261
+
35262
+ The stub `codex` stands in for the real one so resolution is checked against
35263
+ a path the scenario controls; it records any invocation, because a catalog
35264
+ or a brief that launched the agent would be the one thing Keel promised not
35265
+ to do.
35266
+ """
35267
+ home = base / "home"
35268
+ home.mkdir()
35269
+ stub_bin = base / "bin"
35270
+ stub_bin.mkdir()
35271
+ calls = base / "calls.log"
35272
+ for name in ("codex", "dsh"):
35273
+ stub = stub_bin / name
35274
+ stub.write_text(f"#!/bin/sh\necho {name} \"$@\" >> '{calls}'\n", encoding="utf-8")
35275
+ stub.chmod(0o755)
35276
+ env = dict(os.environ)
35277
+ env["KEEL_HOME"] = str(home)
35278
+ env["PATH"] = f"{stub_bin}{os.pathsep}{env.get('PATH', '')}"
35279
+ return env, calls
35280
+
35281
+
35282
+ def validate_external_agent_catalog_scenario() -> int:
35283
+ """The catalog records facts, merges the machine file, and stays on demand.
35284
+
35285
+ #219: an external model CLI writes outside the host's write guard and sends
35286
+ the repository to another provider. What Keel offers about one is facts a
35287
+ reader can check — template, sandboxes, destination, dated pitfalls — and
35288
+ never a judgement of what it is good at, because a judgement resident in the
35289
+ session steers the agent that reads it (owner, 2026-10-04).
35290
+ """
35291
+ label = "external-agent-catalog:"
35292
+ with tempfile.TemporaryDirectory(prefix="keel-agents-") as raw:
35293
+ base = Path(raw)
35294
+ env, calls = _external_agents_env(base)
35295
+ repo = base / "repo"
35296
+ repo.mkdir()
35297
+ write_gate_fixture(repo, standing_authorization_task())
35298
+ write_authorize_config(repo, "external_agents:\n allow:\n - codex\n")
35299
+
35300
+ def listing() -> dict | None:
35301
+ result = run_keel(repo, "agents", "--json", env=env)
35302
+ try:
35303
+ return json.loads(result.stdout)
35304
+ except json.JSONDecodeError:
35305
+ report(f"{label} `keel agents --json` printed no JSON: "
35306
+ f"{(result.stdout + result.stderr).strip()[:400]}")
35307
+ return None
35308
+
35309
+ payload = listing()
35310
+ if payload is None:
35311
+ return 1
35312
+ agents = {item.get("name"): item for item in payload.get("agents") or []}
35313
+ for name in ("codex", "dsh"):
35314
+ if agents.get(name, {}).get("source") != "bundled":
35315
+ report(f"{label} {name} is not listed as a bundled entry: {agents.get(name)}")
35316
+ return 1
35317
+ stub = str(base / "bin" / "codex")
35318
+ if agents["codex"].get("resolved") != stub:
35319
+ report(f"{label} codex resolved to {agents['codex'].get('resolved')!r}, not the stub on PATH.")
35320
+ return 1
35321
+ dsh_path = agents["dsh"].get("executable")
35322
+ expected = dsh_path if dsh_path and Path(dsh_path).exists() else None
35323
+ if agents["dsh"].get("resolved") != expected:
35324
+ report(f"{label} dsh resolution {agents['dsh'].get('resolved')!r} disagrees with "
35325
+ f"whether {dsh_path!r} exists.")
35326
+ return 1
35327
+ if agents["codex"].get("allowed") is not True or agents["dsh"].get("allowed") is not False:
35328
+ report(f"{label} allowance is not read from external_agents: allow: "
35329
+ f"codex={agents['codex'].get('allowed')!r} dsh={agents['dsh'].get('allowed')!r}")
35330
+ return 1
35331
+ for name, item in agents.items():
35332
+ extra = set(item) - EXTERNAL_AGENT_FACT_FIELDS
35333
+ if extra:
35334
+ report(f"{label} {name} carries fields outside the fact fields: {sorted(extra)}. "
35335
+ "The catalog records facts, not a judgement of what an agent suits.")
35336
+ return 1
35337
+ pitfalls = item.get("pitfalls") or []
35338
+ if not pitfalls:
35339
+ report(f"{label} {name} records no pitfall.")
35340
+ return 1
35341
+ for pitfall in pitfalls:
35342
+ if not re.fullmatch(r"\d{4}-\d{2}-\d{2}", str(pitfall.get("date", ""))) \
35343
+ or not str(pitfall.get("source", "")).strip():
35344
+ report(f"{label} {name} has a pitfall without a date and a source: {pitfall}")
35345
+ return 1
35346
+
35347
+ shown = run_keel(repo, "agents", "codex", env=env)
35348
+ text = shown.stdout
35349
+ codex = agents["codex"]
35350
+ for needle in (codex.get("command"), "read-only", "workspace-write", codex.get("sendsTo"),
35351
+ *[p["text"] for p in codex["pitfalls"]],
35352
+ *[p["date"] for p in codex["pitfalls"]]):
35353
+ if not needle:
35354
+ report(f"{label} the codex entry has an empty command, destination, or pitfall.")
35355
+ return 1
35356
+ if needle not in text:
35357
+ report(f"{label} `keel agents codex` does not print {needle!r}.")
35358
+ return 1
35359
+
35360
+ # A machine entry declaring one field overrides that field only.
35361
+ custom = base / "bin" / "dsh"
35362
+ (base / "home" / "agents.json").write_text(
35363
+ json.dumps({"agents": {"dsh": {"executable": str(custom)}}}), encoding="utf-8")
35364
+ payload = listing()
35365
+ if payload is None:
35366
+ return 1
35367
+ dsh = {item.get("name"): item for item in payload.get("agents") or []}.get("dsh") or {}
35368
+ if dsh.get("source") != "machine" or dsh.get("executable") != str(custom):
35369
+ report(f"{label} the machine entry did not override dsh: {dsh}")
35370
+ return 1
35371
+ if dsh.get("command") != agents["dsh"].get("command"):
35372
+ report(f"{label} a machine entry declaring only an executable replaced the bundled template.")
35373
+ return 1
35374
+
35375
+ # A malformed machine file is named and none of it is used.
35376
+ (base / "home" / "agents.json").write_text("{not json", encoding="utf-8")
35377
+ payload = listing()
35378
+ if payload is None:
35379
+ return 1
35380
+ problems = " ".join(payload.get("problems") or [])
35381
+ if "agents.json" not in problems:
35382
+ report(f"{label} a malformed agents.json was not reported: {payload.get('problems')}")
35383
+ return 1
35384
+ sources = {item.get("source") for item in payload.get("agents") or []}
35385
+ if sources != {"bundled"}:
35386
+ report(f"{label} a malformed agents.json still contributed entries: {sources}")
35387
+ return 1
35388
+
35389
+ # Session start carries no catalog.
35390
+ context = run_keel(repo, "context", env=env)
35391
+ for needle in ("dsh", "DeepSeek", "/dev/null", "workspace-write"):
35392
+ if needle in context.stdout:
35393
+ report(f"{label} `keel context` carries catalog text {needle!r}.")
35394
+ return 1
35395
+ if calls.exists():
35396
+ report(f"{label} an agent was launched: {calls.read_text(encoding='utf-8').strip()}")
35397
+ return 1
35398
+
35399
+ report("external-agent-catalog scenario passed.")
35400
+ return 0
35401
+
35402
+
35403
+ def external_agent_brief_task() -> str:
35404
+ return (
35405
+ "- [ ] 1.1 Speed up the parser\n"
35406
+ " - Covers:\n"
35407
+ " - E1: public behavior\n"
35408
+ " - Read:\n"
35409
+ " - docs/spec.md\n"
35410
+ " - secrets/vendor.key\n"
35411
+ " - Touch:\n"
35412
+ " - src/feature.js\n"
35413
+ " - Verify:\n"
35414
+ " - Strategy: evidence-first\n"
35415
+ " - Reason: this is a gate fixture; it exercises contract structure and has no executable behavior that can fail first\n"
35416
+ " - M1: node test.js proves the parser is faster\n"
35417
+ " - Evidence:\n"
35418
+ " - Contract: pending\n"
35419
+ " - M1: pending\n"
35420
+ " - Review:\n"
35421
+ " - Status: pending\n"
35422
+ " - Acceptance check: pending\n"
35423
+ " - Scope check: pending\n"
35424
+ " - Findings: pending\n"
35425
+ " - Blocker: none\n"
35426
+ )
35427
+
35428
+
35429
+ def validate_external_agent_brief_scenario() -> int:
35430
+ """The brief is the delegation brief, checked for egress and write boundary.
35431
+
35432
+ #219: Keel compiles what the external agent is handed and prints the command;
35433
+ the session runs it. The brief refuses what the project has not allowed, a
35434
+ path the project said must not leave, and any write into the session's own
35435
+ checkout, because the host's write guard never sees an external process.
35436
+ """
35437
+ label = "external-agent-brief:"
35438
+ with tempfile.TemporaryDirectory(prefix="keel-agent-brief-") as raw:
35439
+ base = Path(raw)
35440
+ env, calls = _external_agents_env(base)
35441
+ repo = base / "repo"
35442
+ repo.mkdir()
35443
+ write_gate_fixture(repo, external_agent_brief_task())
35444
+ write_text(repo / "docs/spec.md", "spec\n")
35445
+ write_text(repo / "secrets/vendor.key", "key\n")
35446
+ write_text(repo / "src/feature.js", "// feature\n")
35447
+ for command in (["init", "-q"], ["add", "-A"],
35448
+ ["-c", "user.email=k@example.com", "-c", "user.name=k",
35449
+ "commit", "-q", "-m", "fixture"]):
35450
+ subprocess.run(["git", *command], cwd=repo, check=True, capture_output=True)
35451
+ prompt = base / "brief.md"
35452
+
35453
+ def brief(name: str, mode: str, directory: Path) -> tuple[dict, str]:
35454
+ if prompt.exists():
35455
+ prompt.unlink()
35456
+ result = run_keel(repo, "agents", "brief", name, "--mode", mode,
35457
+ "--dir", str(directory), "--out", str(prompt),
35458
+ "--change", "demo", "--task", "1.1", "--json", env=env)
35459
+ try:
35460
+ return json.loads(result.stdout), result.stdout + result.stderr
35461
+ except json.JSONDecodeError:
35462
+ return {}, result.stdout + result.stderr
35463
+
35464
+ def refused(payload: dict, output: str, *needles: str, what: str) -> bool:
35465
+ reasons = " ".join(payload.get("reasons") or [])
35466
+ if payload.get("status") != "blocked":
35467
+ report(f"{label} {what} was not refused: {output.strip()[:400]}")
35468
+ return False
35469
+ for needle in needles:
35470
+ if needle not in reasons:
35471
+ report(f"{label} {what} was refused without naming {needle!r}: {reasons}")
35472
+ return False
35473
+ if prompt.exists():
35474
+ report(f"{label} {what} was refused but still wrote a prompt file.")
35475
+ return False
35476
+ return True
35477
+
35478
+ # Absent declaration allows nothing, and says how to declare.
35479
+ payload, out = brief("codex", "helper", repo)
35480
+ if not refused(payload, out, "external_agents:", "allow:", what="an undeclared project"):
35481
+ return 1
35482
+ # An agent outside allow.
35483
+ write_authorize_config(repo, "external_agents:\n allow:\n - codex\n")
35484
+ payload, out = brief("dsh", "helper", repo)
35485
+ if not refused(payload, out, "dsh", "codex", what="an agent outside allow"):
35486
+ return 1
35487
+ # A deny entry without a reason refuses every brief.
35488
+ write_authorize_config(repo, "external_agents:\n allow:\n - codex\n"
35489
+ " egress_deny:\n - secrets/**\n")
35490
+ payload, out = brief("codex", "helper", repo)
35491
+ if not refused(payload, out, "secrets/**", what="a deny entry without a reason"):
35492
+ return 1
35493
+ # A denied Read path refuses, naming path, pattern and reason.
35494
+ write_authorize_config(repo, "external_agents:\n allow: [codex, dsh]\n"
35495
+ " egress_deny:\n - secrets/**: vendor NDA keys\n")
35496
+ payload, out = brief("codex", "helper", repo)
35497
+ if not refused(payload, out, "secrets/vendor.key", "secrets/**", "vendor NDA keys",
35498
+ what="a denied Read path"):
35499
+ return 1
35500
+ # A clean helper brief.
35501
+ write_authorize_config(repo, "external_agents:\n allow: [codex, dsh]\n"
35502
+ " egress_deny:\n - private/**: customer data\n")
35503
+ payload, out = brief("codex", "helper", repo)
35504
+ if payload.get("status") != "ready":
35505
+ report(f"{label} a clean helper brief was refused: {out.strip()[:600]}")
35506
+ return 1
35507
+ if not prompt.exists():
35508
+ report(f"{label} a clean helper brief reported ready but wrote no prompt file.")
35509
+ return 1
35510
+ text = prompt.read_text(encoding="utf-8")
35511
+ for needle in ("Speed up the parser", "docs/spec.md", "secrets/vendor.key",
35512
+ "M1: node test.js", "commit", "push", "OpenSpec"):
35513
+ if needle not in text:
35514
+ report(f"{label} the prompt file does not carry {needle!r}.")
35515
+ return 1
35516
+ command = payload.get("run") or ""
35517
+ for needle in ("read-only", str(repo), str(prompt)):
35518
+ if needle not in command:
35519
+ report(f"{label} the printed command does not name {needle!r}: {command}")
35520
+ return 1
35521
+ if "cannot observe" not in " ".join(payload.get("warnings") or []):
35522
+ report(f"{label} the brief does not say Keel cannot observe what the agent reads.")
35523
+ return 1
35524
+ # A helper with no sandbox over the session's own checkout.
35525
+ payload, out = brief("dsh", "helper", repo)
35526
+ if not refused(payload, out, "sandbox", "worktree", what="a dsh helper over the checkout"):
35527
+ return 1
35528
+ # Implementation with no guard: the projection's own reason.
35529
+ projected = run_keel(repo, "project", "--target", "claude", "--event", "subagent-start",
35530
+ "--subagent-mode", "implementation", "--change", "demo",
35531
+ "--task", "1.1", "--json", env=env)
35532
+ expected = " ".join(json.loads(projected.stdout).get("reasons") or [])
35533
+ payload, out = brief("codex", "implementation", repo)
35534
+ if not expected:
35535
+ report(f"{label} the projection gave no reason to compare against: {projected.stdout[:400]}")
35536
+ return 1
35537
+ if not refused(payload, out, expected, what="an unguarded implementation"):
35538
+ return 1
35539
+ started = run_keel(repo, "gate", "task-start", "--change", "demo", "--task", "1.1",
35540
+ "--record", "--json", env=env)
35541
+ if json.loads(started.stdout).get("status") != "pass":
35542
+ report(f"{label} the fixture task did not start: {started.stdout[:400]}")
35543
+ return 1
35544
+ payload, out = brief("codex", "implementation", repo)
35545
+ if not refused(payload, out, "worktree", what="an implementation over the checkout"):
35546
+ return 1
35547
+ worktree = base / "agent-wt"
35548
+ subprocess.run(["git", "worktree", "add", "-q", "--detach", str(worktree)],
35549
+ cwd=repo, check=True, capture_output=True)
35550
+ payload, out = brief("codex", "implementation", worktree)
35551
+ if payload.get("status") != "ready":
35552
+ report(f"{label} an implementation brief over a separate worktree was refused: "
35553
+ f"{out.strip()[:600]}")
35554
+ return 1
35555
+ if not prompt.exists():
35556
+ report(f"{label} an implementation brief reported ready but wrote no prompt file.")
35557
+ return 1
35558
+ command = payload.get("run") or ""
35559
+ for needle in ("workspace-write", str(worktree)):
35560
+ if needle not in command:
35561
+ report(f"{label} the implementation command does not name {needle!r}: {command}")
35562
+ return 1
35563
+ if calls.exists():
35564
+ report(f"{label} an agent was launched: {calls.read_text(encoding='utf-8').strip()}")
35565
+ return 1
35566
+
35567
+ report("external-agent-brief scenario passed.")
35568
+ return 0
35569
+
35570
+
35571
+ def validate_external_agents_are_documented_scenario() -> int:
35572
+ """The command reaches the protocol, the READMEs, and the privacy policy.
35573
+
35574
+ #219: an agent that never reads the README must still learn that external
35575
+ model CLIs are delegates with a compiled brief, so the bootstrap block and
35576
+ this repository's protocol name it. The privacy policy lists what leaves the
35577
+ machine, and handing a repository to codex or dsh is now one of those ways.
35578
+ """
35579
+ label = "external-agents-are-documented:"
35580
+
35581
+ def flat(path: Path) -> str:
35582
+ return re.sub(r"\s+", " ", path.read_text(encoding="utf-8"))
35583
+
35584
+ protocol = flat(ROOT / "AGENTS.md")
35585
+ if "keel agents brief" not in protocol:
35586
+ report(f"{label} AGENTS.md does not name `keel agents brief`.")
35587
+ return 1
35588
+ if "launches nothing" not in protocol:
35589
+ report(f"{label} AGENTS.md does not say Keel launches nothing.")
35590
+ return 1
35591
+ # The installed bootstrap spends its byte budget only on rules every session
35592
+ # uses; `external_agents:` is inert until declared, as delegation is, so it
35593
+ # reaches an agent where it is declared instead (D9).
35594
+ if "keel agents" in flat(ROOT / "assets/bootstrap/AGENTS.md"):
35595
+ report(f"{label} the bootstrap block names `keel agents`, spending its budget on a "
35596
+ "declaration that is inert until a project makes it.")
35597
+ return 1
35598
+ for path in (ROOT / "README.md", ROOT / "README.zh-CN.md"):
35599
+ text = path.read_text(encoding="utf-8")
35600
+ blocks = re.findall(r"```bash\n(.*?)```", text, re.S)
35601
+ if not any("keel agents" in block for block in blocks):
35602
+ report(f"{label} {path.name} lists no `keel agents` in a command block.")
35603
+ return 1
35604
+ yaml_blocks = re.findall(r"```yaml\n(.*?)```", text, re.S)
35605
+ example = next((block for block in yaml_blocks if "external_agents:" in block), "")
35606
+ if not example:
35607
+ report(f"{label} {path.name} shows no `external_agents:` example.")
35608
+ return 1
35609
+ for key in ("allow:", "egress_deny:"):
35610
+ if key not in example:
35611
+ report(f"{label} {path.name}'s external_agents example has no {key}.")
35612
+ return 1
35613
+ privacy = (ROOT / "PRIVACY.md").read_text(encoding="utf-8")
35614
+ leaves = privacy.split("## What leaves your machine", 1)[-1].split("\n## ", 1)[0]
35615
+ if "External model CLIs" not in leaves:
35616
+ report(f"{label} PRIVACY.md does not list external model CLIs under what leaves the machine.")
35617
+ return 1
35618
+
35619
+ report("external-agents-are-documented scenario passed.")
35620
+ return 0
35621
+
35622
+
35169
35623
  SCENARIOS: tuple = (
35170
35624
  ("stateless-continuity", validate_stateless_continuity_scenario),
35171
35625
  ("core-gates", validate_core_gates_scenario),
@@ -35606,6 +36060,13 @@ SCENARIOS: tuple = (
35606
36060
  "a-covers-citation-is-not-a-record",
35607
36061
  validate_a_covers_citation_is_not_a_record_scenario,
35608
36062
  ),
36063
+ (
36064
+ "a-task-field-cites-its-provenance",
36065
+ validate_a_task_field_cites_its_provenance_scenario,
36066
+ ),
36067
+ ("external-agent-catalog", validate_external_agent_catalog_scenario),
36068
+ ("external-agent-brief", validate_external_agent_brief_scenario),
36069
+ ("external-agents-are-documented", validate_external_agents_are_documented_scenario),
35609
36070
  ("validation-runner", validate_validation_runner_scenario),
35610
36071
  ("section-boundary", validate_section_boundary_scenario),
35611
36072
  ("review-entry-extent", validate_review_entry_extent_scenario),