@christang/keel 5.197.0 → 5.198.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keel",
3
- "version": "5.197.0",
3
+ "version": "5.198.0",
4
4
  "description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Codex and Claude Code.",
5
5
  "author": {
6
6
  "name": "TanglmChris",
@@ -1,4 +1,4 @@
1
- <!-- keel:start version=5.197.0 -->
1
+ <!-- keel:start version=5.198.0 -->
2
2
  ## Keel Bootstrap
3
3
 
4
4
  - Start every session with `keel context`; OpenSpec artifacts and Git are the durable authority, and memory or transcripts may only inform.
package/bin/keel.js CHANGED
@@ -1300,6 +1300,27 @@ function updateCodexPlugin(options) {
1300
1300
  return true;
1301
1301
  }
1302
1302
 
1303
+ // The version the global prefix holds (#459 D1): what `npm install -g` wrote,
1304
+ // read rather than assumed, since an install that exits 0 once left the
1305
+ // prefix a release behind while the line said `updated`.
1306
+ function installedCli(npm) {
1307
+ const root = spawnSync(npm, ["root", "-g"], {
1308
+ encoding: "utf8",
1309
+ shell: process.platform === "win32",
1310
+ timeout: Number(process.env.KEEL_UPDATE_QUERY_TIMEOUT_MS) || 30 * 1000,
1311
+ });
1312
+ const dir = String(root.stdout || "").trim().split(/\r?\n/).pop();
1313
+ if (root.error || root.status !== 0 || !dir) {
1314
+ return { version: null, why: `npm root -g ${root.error ? root.error.message : `exited ${root.status} with ${dir ? "output" : "no output"}`}` };
1315
+ }
1316
+ const file = path.join(dir, "@christang", "keel", "package.json");
1317
+ try {
1318
+ return { version: JSON.parse(fs.readFileSync(file, "utf8")).version || null, file, why: `${file} names no version` };
1319
+ } catch (error) {
1320
+ return { version: null, file, why: `${file} cannot be read (${error.code || error.message})` };
1321
+ }
1322
+ }
1323
+
1303
1324
  function updateGlobalCli(options, npm, source) {
1304
1325
  if (options.dryRun) {
1305
1326
  process.stdout.write(
@@ -1321,6 +1342,7 @@ function updateGlobalCli(options, npm, source) {
1321
1342
  return true;
1322
1343
  }
1323
1344
 
1345
+ const before = installedCli(npm);
1324
1346
  const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "keel-update-"));
1325
1347
  try {
1326
1348
  const packArgs = [
@@ -1358,10 +1380,17 @@ function updateGlobalCli(options, npm, source) {
1358
1380
  const latest = packed && source === DEFAULT_UPDATE_SOURCE
1359
1381
  ? `the npm registry's latest here is ${packed[1]}; `
1360
1382
  : "";
1383
+ // What the prefix holds now decides the line (#459 D2–D4).
1384
+ const after = installedCli(npm);
1385
+ if (after.version && packed && after.version !== packed[1]) {
1386
+ updateLine("cli", "failed", `npm install -g ${path.basename(tarball)} exited 0, but ${after.file} holds ${after.version}`);
1387
+ return false;
1388
+ }
1389
+ const unverified = after.version ? "" : `; not verified: ${after.why}`;
1361
1390
  updateLine(
1362
1391
  "cli",
1363
- versionChange(PACKAGE_JSON.version, packed ? packed[1] : null),
1364
- `${latest}applies to the next command that runs keel`
1392
+ versionChange(before.version || PACKAGE_JSON.version, after.version || (packed ? packed[1] : null)),
1393
+ `${latest}applies to the next command that runs keel${unverified}`
1365
1394
  );
1366
1395
  return true;
1367
1396
  } catch (error) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@christang/keel",
3
- "version": "5.197.0",
3
+ "version": "5.198.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@christang/keel",
9
- "version": "5.197.0",
9
+ "version": "5.198.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@fission-ai/openspec": "^1.4.1"
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@christang/keel",
3
3
  "displayName": "Keel",
4
4
  "description": "Keel OpenSpec execution discipline CLI for Claude Code, Codex, and OpenCode.",
5
- "version": "5.197.0",
5
+ "version": "5.198.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keel",
3
- "version": "5.197.0",
3
+ "version": "5.198.0",
4
4
  "description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Codex and Claude Code.",
5
5
  "author": {
6
6
  "name": "TanglmChris",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keel",
3
- "version": "5.197.0",
3
+ "version": "5.198.0",
4
4
  "description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Codex and Claude Code.",
5
5
  "author": {
6
6
  "name": "TanglmChris",
@@ -145,13 +145,27 @@ def run_group(group: str, jobs: int) -> int:
145
145
 
146
146
 
147
147
  def main() -> int:
148
- if len(sys.argv) == 3 and sys.argv[1] == "--scenario":
148
+ # One or more `--scenario NAME` pairs (#444): each named scenario runs, and
149
+ # the result fails when any of them does.
150
+ if sys.argv[1:2] == ["--scenario"]:
151
+ rest = sys.argv[1:]
152
+ if len(rest) % 2 or any(flag != "--scenario" for flag in rest[0::2]):
153
+ report(f"usage: validate_plugin.py --scenario NAME [--scenario NAME ...], got: {' '.join(rest)}")
154
+ return 2
149
155
  registry = dict(SCENARIOS)
150
- runner = registry.get(sys.argv[2])
151
- if runner is None:
152
- report(f"unknown validation scenario: {sys.argv[2]}")
156
+ names = rest[1::2]
157
+ unknown = [name for name in names if name not in registry]
158
+ if unknown:
159
+ report(f"unknown validation scenario: {', '.join(unknown)}")
153
160
  return 2
154
- return runner()
161
+ if len(names) == 1:
162
+ return registry[names[0]]()
163
+ failures = [name for name in names if registry[name]() != 0]
164
+ if failures:
165
+ report(f"validation --scenario failed for: {', '.join(failures)}")
166
+ return 1
167
+ report(f"validation --scenario passed: {len(names)} scenarios.")
168
+ return 0
155
169
 
156
170
  if len(sys.argv) >= 2 and sys.argv[1] == "--all":
157
171
  jobs = os.cpu_count() or 2
@@ -182,6 +196,11 @@ def main() -> int:
182
196
  print(evidence.render_markdown(classes) if rest else evidence.render(classes))
183
197
  return 0
184
198
 
199
+ # Only no arguments at all means the baseline: an argument it does not
200
+ # recognize used to fall through here and exit 0 having run nothing asked (#444).
201
+ if sys.argv[1:]:
202
+ report(f"usage: validate_plugin.py [--all [--jobs N] | --group NAME [--jobs N] | --scenario NAME ... | --evidence [--markdown]], got: {' '.join(sys.argv[1:])}")
203
+ return 2
185
204
  return run_baseline()
186
205
 
187
206
 
@@ -35,10 +35,10 @@ os.environ["KEEL_UPDATE_CLAUDE"] = str(Path(tempfile.gettempdir()) / "keel-suite
35
35
  os.environ["KEEL_UPDATE_CODEX"] = str(Path(tempfile.gettempdir()) / "keel-suite-has-no-codex")
36
36
 
37
37
 
38
- PACKAGE_VERSION = "5.197.0"
38
+ PACKAGE_VERSION = "5.198.0"
39
39
 
40
40
 
41
- PROTOCOL_VERSION = "5.197.0"
41
+ PROTOCOL_VERSION = "5.198.0"
42
42
 
43
43
 
44
44
  LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
@@ -484,8 +484,15 @@ def validate_update_pack_install_scenario() -> int:
484
484
  for line in call_log.read_text(encoding="utf-8").splitlines()
485
485
  if line.strip()
486
486
  ]
487
+ # `npm root -g` is read before packing and after installing (#459), and
488
+ # changes nothing; the calls that change something are still two.
489
+ reads = [call for call in calls if call[:2] == ["root", "-g"]]
490
+ calls = [call for call in calls if call[:2] != ["root", "-g"]]
491
+ if len(reads) != 2:
492
+ report(f"update-pack-install scenario read the global prefix {len(reads)} time(s), not before and after.")
493
+ return 1
487
494
  if len(calls) != 2:
488
- report("update-pack-install scenario expected exactly two npm calls.")
495
+ report("update-pack-install scenario expected exactly two npm calls that change something.")
489
496
  report(json.dumps(calls, indent=2))
490
497
  return 1
491
498
 
@@ -2568,6 +2575,14 @@ if (host === "npm") {
2568
2575
  fs.writeFileSync(path.join(dest, "christang-keel-5.1.0.tgz"), "");
2569
2576
  process.stdout.write(JSON.stringify([{ filename: "christang-keel-5.1.0.tgz" }]));
2570
2577
  }
2578
+ // FAKE_NPM_ROOT is the global prefix `npm root -g` names, and an
2579
+ // `install -g` writes the version FAKE_NPM_INSTALLS names there (#459).
2580
+ if (args[0] === "root" && process.env.FAKE_NPM_ROOT) process.stdout.write(`${process.env.FAKE_NPM_ROOT}\n`);
2581
+ if (args[0] === "install" && process.env.FAKE_NPM_ROOT && process.env.FAKE_NPM_INSTALLS) {
2582
+ const dir = path.join(process.env.FAKE_NPM_ROOT, "@christang", "keel");
2583
+ fs.mkdirSync(dir, { recursive: true });
2584
+ fs.writeFileSync(path.join(dir, "package.json"), JSON.stringify({ name: "@christang/keel", version: process.env.FAKE_NPM_INSTALLS }));
2585
+ }
2571
2586
  // FAKE_NPM_LATEST is what `npm view <package> version` prints, and
2572
2587
  // FAKE_NPM_VIEW_EXIT makes it exit with that status instead (#421).
2573
2588
  if (args[0] === "view") {
@@ -2821,7 +2836,7 @@ def validate_update_covers_installed_hosts_scenario() -> int:
2821
2836
 
2822
2837
  result, calls = update()
2823
2838
  expected = [
2824
- ["npm", "pack"], ["npm", "install", "-g"],
2839
+ ["npm", "root", "-g"], ["npm", "pack"], ["npm", "install", "-g"], ["npm", "root", "-g"],
2825
2840
  ["claude", "plugin", "marketplace", "update", "keel-marketplace"],
2826
2841
  ["claude", "plugin", "update", "keel@keel-marketplace"],
2827
2842
  ["codex", "plugin", "marketplace", "upgrade", "keel-marketplace"],
@@ -3015,6 +3030,15 @@ OVERLAY_BLOCK_RE = re.compile(
3015
3030
  )
3016
3031
 
3017
3032
 
3033
+ # The host-query limit the `keel --update` scenarios set (#452). Every stand-in
3034
+ # host, the ones meant to answer as well as the one meant to hang, is a node
3035
+ # program that must start and answer inside it. Under the full suite's own
3036
+ # parallel load, starting one took longer than 2–4 s, so the limit is set well
3037
+ # above that, and the hung stand-in sleeps well past two of them.
3038
+ QUERY_LIMIT_S = 12
3039
+ QUERY_LIMIT_MS = str(QUERY_LIMIT_S * 1000)
3040
+
3041
+
3018
3042
  def validate_update_host_query_timeout_scenario() -> int:
3019
3043
  """Issue #354: a hung or failed host query is `failed`, never `absent`.
3020
3044
 
@@ -3073,12 +3097,12 @@ def validate_update_host_query_timeout_scenario() -> int:
3073
3097
  return 1
3074
3098
 
3075
3099
  # Only the hung case needs a short limit; the others keep 30 s, so load cannot trip them.
3076
- result, calls, took = update(env_extra={"FAKE_LIST_SLEEP_CODEX": "15", "KEEL_UPDATE_QUERY_TIMEOUT_MS": "4000"})
3100
+ result, calls, took = update(env_extra={"FAKE_LIST_SLEEP_CODEX": "40", "KEEL_UPDATE_QUERY_TIMEOUT_MS": QUERY_LIMIT_MS})
3077
3101
  codex = line(result.stdout, "codex plugin")
3078
3102
  if "absent" in codex:
3079
3103
  report(f"{label} a hung codex plugin list --json was reported absent: {codex!r}")
3080
3104
  return 1
3081
- for needle in ("failed", "codex plugin list --json", "4 s"):
3105
+ for needle in ("failed", "codex plugin list --json", f"{QUERY_LIMIT_S} s"):
3082
3106
  if needle not in codex:
3083
3107
  report(f"{label} the hung-query line does not name {needle!r}: {codex!r}")
3084
3108
  return 1
@@ -3091,8 +3115,8 @@ def validate_update_host_query_timeout_scenario() -> int:
3091
3115
  if result.returncode == 0:
3092
3116
  report(f"{label} a failed query left keel --update exiting 0.")
3093
3117
  return 1
3094
- if took > 20:
3095
- report(f"{label} the hung query held keel --update for {took:.1f} s, past two 4 s attempts.")
3118
+ if took > 2 * QUERY_LIMIT_S + 15:
3119
+ report(f"{label} the hung query held keel --update for {took:.1f} s, past two {QUERY_LIMIT_S} s attempts.")
3096
3120
  return 1
3097
3121
 
3098
3122
  result, _, _ = update(env_extra={"KEEL_UPDATE_CODEX": str(tmp / "no-such-codex")})
@@ -3100,7 +3124,7 @@ def validate_update_host_query_timeout_scenario() -> int:
3100
3124
  report(f"{label} a missing codex executable no longer reads absent: {result.stdout!r}")
3101
3125
  return 1
3102
3126
 
3103
- result, _, _ = update("--dry-run", env_extra={"FAKE_LIST_SLEEP_CODEX": "15", "KEEL_UPDATE_QUERY_TIMEOUT_MS": "4000"})
3127
+ result, _, _ = update("--dry-run", env_extra={"FAKE_LIST_SLEEP_CODEX": "40", "KEEL_UPDATE_QUERY_TIMEOUT_MS": QUERY_LIMIT_MS})
3104
3128
  if result.returncode != 0:
3105
3129
  report(f"{label} --dry-run with a hung query exited {result.returncode}: {result.stdout!r}")
3106
3130
  return 1
@@ -3150,7 +3174,7 @@ def validate_update_codex_from_disk_scenario() -> int:
3150
3174
  env.update({
3151
3175
  "KEEL_UPDATE_NPM": str(launchers["npm"]), "KEEL_UPDATE_CLAUDE": str(launchers["claude"]),
3152
3176
  "KEEL_UPDATE_CODEX": str(launchers["codex"]), "CODEX_HOME": str(codex_home),
3153
- "KEEL_UPDATE_QUERY_TIMEOUT_MS": "2000", "FAKE_LIST_SLEEP_CODEX": "15",
3177
+ "KEEL_UPDATE_QUERY_TIMEOUT_MS": QUERY_LIMIT_MS, "FAKE_LIST_SLEEP_CODEX": "40",
3154
3178
  "FAKE_LOG": str(log), "FAKE_STATE": str(state), "FAKE_CODEX_SOURCE": str(tmp / "codex-source"),
3155
3179
  "FAKE_CODEX_CACHE": str(cache),
3156
3180
  })
@@ -3288,6 +3312,60 @@ def validate_update_claude_refresh_retry_scenario() -> int:
3288
3312
  return 0
3289
3313
 
3290
3314
 
3315
+ def validate_update_verifies_installed_cli_scenario() -> int:
3316
+ """Issue #459: the CLI line reports what the global prefix holds.
3317
+
3318
+ An `npm install -g` that exits 0 while the prefix keeps another version
3319
+ is a failure, and the before version comes from the prefix, not from the
3320
+ copy of keel that happens to be running.
3321
+ """
3322
+ label = "update-verifies-installed-cli:"
3323
+ with tempfile.TemporaryDirectory(prefix="keel-update-459-", ignore_cleanup_errors=True) as raw:
3324
+ tmp = Path(raw)
3325
+ fake = tmp / "fake.js"
3326
+ write_text(fake, UPDATE_FAKE)
3327
+ npm = tmp / "fake-npm"
3328
+ write_text(npm, f'#!/bin/sh\nFAKE_HOST=npm exec node "{fake}" "$@"\n')
3329
+ npm.chmod(0o755)
3330
+ prefix = tmp / "global"
3331
+ installed = prefix / "@christang" / "keel" / "package.json"
3332
+
3333
+ def update(installs: str) -> tuple[subprocess.CompletedProcess[str], str]:
3334
+ write_text(installed, json.dumps({"name": "@christang/keel", "version": "5.0.0"}))
3335
+ env = dict(os.environ)
3336
+ env.update({
3337
+ "KEEL_UPDATE_NPM": str(npm), "KEEL_UPDATE_CLAUDE": str(tmp / "no-claude"),
3338
+ "KEEL_UPDATE_CODEX": str(tmp / "no-codex"), "FAKE_LOG": str(tmp / "log.jsonl"),
3339
+ "FAKE_STATE": str(tmp / "state.json"), "FAKE_NPM_ROOT": str(prefix), "FAKE_NPM_INSTALLS": installs,
3340
+ })
3341
+ env.pop("KEEL_UPDATE_SOURCE", None)
3342
+ result = subprocess.run(["node", str(ROOT / "bin/keel.js"), "--update"], cwd=tmp, env=env,
3343
+ text=True, capture_output=True, check=False, timeout=120)
3344
+ line = next((l for l in result.stdout.splitlines() if l.startswith("keel update: cli:")), "")
3345
+ return result, line
3346
+
3347
+ result, line = update("5.0.9")
3348
+ if "failed" not in line:
3349
+ report(f"{label} an install that left the prefix at 5.0.9 does not read failed: {line!r}")
3350
+ return 1
3351
+ for needle in (str(installed), "5.0.9"):
3352
+ if needle not in line:
3353
+ report(f"{label} the failed line does not name {needle!r}: {line!r}")
3354
+ return 1
3355
+ if result.returncode == 0:
3356
+ report(f"{label} an install that did not take left keel --update exiting 0.")
3357
+ return 1
3358
+ result, line = update("5.1.0")
3359
+ if "updated 5.0.0 -> 5.1.0" not in line:
3360
+ report(f"{label} an install that took does not read updated 5.0.0 -> 5.1.0: {line!r}")
3361
+ return 1
3362
+ if result.returncode != 0:
3363
+ report(f"{label} an install that took left keel --update exiting {result.returncode}: {result.stdout!r}")
3364
+ return 1
3365
+ report("update-verifies-installed-cli scenario passed.")
3366
+ return 0
3367
+
3368
+
3291
3369
  def validate_update_host_query_retry_scenario() -> int:
3292
3370
  """Issue #365: `codex plugin list --json` usually answers in about 1 s and
3293
3371
  sometimes took 58 s through the owner's proxy.
@@ -3319,10 +3397,10 @@ def validate_update_host_query_retry_scenario() -> int:
3319
3397
  env = dict(os.environ)
3320
3398
  env.update({
3321
3399
  "KEEL_UPDATE_NPM": str(launchers["npm"]), "KEEL_UPDATE_CLAUDE": str(launchers["claude"]),
3322
- "KEEL_UPDATE_CODEX": str(launchers["codex"]), "KEEL_UPDATE_QUERY_TIMEOUT_MS": "4000",
3400
+ "KEEL_UPDATE_CODEX": str(launchers["codex"]), "KEEL_UPDATE_QUERY_TIMEOUT_MS": QUERY_LIMIT_MS,
3323
3401
  "CODEX_HOME": str(tmp / "codex-home"), "FAKE_LOG": str(log), "FAKE_STATE": str(state),
3324
3402
  "FAKE_CODEX_SOURCE": str(source),
3325
- "FAKE_LIST_SLEEP_CODEX": "15", "FAKE_LIST_SLEEP_TIMES_CODEX": times,
3403
+ "FAKE_LIST_SLEEP_CODEX": "40", "FAKE_LIST_SLEEP_TIMES_CODEX": times,
3326
3404
  })
3327
3405
  env.pop("KEEL_UPDATE_SOURCE", None)
3328
3406
  started = time.monotonic()
@@ -3341,7 +3419,7 @@ def validate_update_host_query_retry_scenario() -> int:
3341
3419
  return 1
3342
3420
 
3343
3421
  result, calls, line, took = update("9")
3344
- for needle in ("failed", "codex plugin list --json", "timed out twice", "4 s"):
3422
+ for needle in ("failed", "codex plugin list --json", "timed out twice", f"{QUERY_LIMIT_S} s"):
3345
3423
  if needle not in line:
3346
3424
  report(f"{label} a lasting hang's line does not name {needle!r}: {line!r}")
3347
3425
  return 1
@@ -3349,8 +3427,8 @@ def validate_update_host_query_retry_scenario() -> int:
3349
3427
  if runs != 2:
3350
3428
  report(f"{label} a lasting hang ran the query {runs} time(s), not 2: {calls!r}")
3351
3429
  return 1
3352
- if took > 25:
3353
- report(f"{label} two 4 s attempts held keel --update for {took:.1f} s.")
3430
+ if took > 2 * QUERY_LIMIT_S + 15:
3431
+ report(f"{label} two {QUERY_LIMIT_S} s attempts held keel --update for {took:.1f} s.")
3354
3432
  return 1
3355
3433
  if "update-host-query-retry" not in {name for name, _ in registry.SCENARIOS}:
3356
3434
  report(f"{label} scenario is not registered.")
@@ -395,6 +395,7 @@ SCENARIOS: tuple = (
395
395
  ("update-covers-installed-hosts", hosts.validate_update_covers_installed_hosts_scenario),
396
396
  ("update-codex-refresh-retry", hosts.validate_update_codex_refresh_retry_scenario),
397
397
  ("update-host-query-retry", hosts.validate_update_host_query_retry_scenario),
398
+ ("update-verifies-installed-cli", hosts.validate_update_verifies_installed_cli_scenario),
398
399
  ("update-claude-refresh-retry", hosts.validate_update_claude_refresh_retry_scenario),
399
400
  ("update-host-query-timeout", hosts.validate_update_host_query_timeout_scenario),
400
401
  ("update-codex-from-disk", hosts.validate_update_codex_from_disk_scenario),
@@ -584,6 +585,7 @@ SCENARIOS: tuple = (
584
585
  ("external-agents-are-documented", docs.validate_external_agents_are_documented_scenario),
585
586
  ("external-agent-exit-status", guard.validate_external_agent_exit_status_scenario),
586
587
  ("validation-runner", selfcheck.validate_validation_runner_scenario),
588
+ ("runner-refuses-what-it-would-not-run", selfcheck.validate_runner_refuses_what_it_would_not_run_scenario),
587
589
  ("section-boundary", contract.validate_section_boundary_scenario),
588
590
  ("review-entry-extent", contract.validate_review_entry_extent_scenario),
589
591
  ("reauthorizations-shape", contract.validate_reauthorizations_shape_scenario),
@@ -785,6 +785,40 @@ def validation_modules() -> list:
785
785
  ]
786
786
 
787
787
 
788
+ def validate_runner_refuses_what_it_would_not_run_scenario() -> int:
789
+ """Issue #444: the runner never reports a pass for scenarios it did not run.
790
+
791
+ Several `--scenario NAME` pairs run each named scenario; anything it does
792
+ not recognize exits 2 with a usage line instead of falling through to the
793
+ baseline, which used to exit 0 having run nothing that was asked for.
794
+ """
795
+ label = "runner-refuses-what-it-would-not-run:"
796
+
797
+ def run(*args: str) -> subprocess.CompletedProcess[str]:
798
+ return subprocess.run([sys.executable, str(ROOT / "scripts" / "validate_plugin.py"), *args],
799
+ cwd=ROOT, text=True, capture_output=True, check=False, timeout=300)
800
+
801
+ both = run("--scenario", "version-alignment", "--scenario", "readme-zh-matches-english")
802
+ if both.returncode != 0:
803
+ report(f"{label} two passing scenarios exited {both.returncode}: {both.stdout!r} {both.stderr!r}")
804
+ return 1
805
+ for name in ("version-alignment", "readme-zh-matches-english"):
806
+ if f"{name} scenario passed" not in both.stdout:
807
+ report(f"{label} two --scenario pairs did not run {name}: {both.stdout!r}")
808
+ return 1
809
+ for args in (("--scenarios", "version-alignment"), ("--scenario", "version-alignment", "--jobs", "2"),
810
+ ("--scenario", "version-alignment", "--scenario", "no-such-scenario")):
811
+ refused = run(*args)
812
+ if refused.returncode != 2:
813
+ report(f"{label} {' '.join(args)} exited {refused.returncode}, not 2: {refused.stdout!r}")
814
+ return 1
815
+ if "baseline validation passed" in refused.stdout:
816
+ report(f"{label} {' '.join(args)} fell through to the baseline: {refused.stdout!r}")
817
+ return 1
818
+ report("runner-refuses-what-it-would-not-run scenario passed.")
819
+ return 0
820
+
821
+
788
822
  def validate_validation_runner_scenario() -> int:
789
823
  if not getattr(registry, "SCENARIOS", None):
790
824
  report("validation-runner: the scenario registry is missing.")