@christang/keel 5.197.0 → 5.197.1

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.197.1",
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.197.1 -->
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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@christang/keel",
3
- "version": "5.197.0",
3
+ "version": "5.197.1",
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.197.1",
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.197.1",
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.197.1",
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.197.1",
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.197.1"
39
39
 
40
40
 
41
- PROTOCOL_VERSION = "5.197.0"
41
+ PROTOCOL_VERSION = "5.197.1"
42
42
 
43
43
 
44
44
  LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
@@ -3015,6 +3015,15 @@ OVERLAY_BLOCK_RE = re.compile(
3015
3015
  )
3016
3016
 
3017
3017
 
3018
+ # The host-query limit the `keel --update` scenarios set (#452). Every stand-in
3019
+ # host, the ones meant to answer as well as the one meant to hang, is a node
3020
+ # program that must start and answer inside it. Under the full suite's own
3021
+ # parallel load, starting one took longer than 2–4 s, so the limit is set well
3022
+ # above that, and the hung stand-in sleeps well past two of them.
3023
+ QUERY_LIMIT_S = 12
3024
+ QUERY_LIMIT_MS = str(QUERY_LIMIT_S * 1000)
3025
+
3026
+
3018
3027
  def validate_update_host_query_timeout_scenario() -> int:
3019
3028
  """Issue #354: a hung or failed host query is `failed`, never `absent`.
3020
3029
 
@@ -3073,12 +3082,12 @@ def validate_update_host_query_timeout_scenario() -> int:
3073
3082
  return 1
3074
3083
 
3075
3084
  # 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"})
3085
+ result, calls, took = update(env_extra={"FAKE_LIST_SLEEP_CODEX": "40", "KEEL_UPDATE_QUERY_TIMEOUT_MS": QUERY_LIMIT_MS})
3077
3086
  codex = line(result.stdout, "codex plugin")
3078
3087
  if "absent" in codex:
3079
3088
  report(f"{label} a hung codex plugin list --json was reported absent: {codex!r}")
3080
3089
  return 1
3081
- for needle in ("failed", "codex plugin list --json", "4 s"):
3090
+ for needle in ("failed", "codex plugin list --json", f"{QUERY_LIMIT_S} s"):
3082
3091
  if needle not in codex:
3083
3092
  report(f"{label} the hung-query line does not name {needle!r}: {codex!r}")
3084
3093
  return 1
@@ -3091,8 +3100,8 @@ def validate_update_host_query_timeout_scenario() -> int:
3091
3100
  if result.returncode == 0:
3092
3101
  report(f"{label} a failed query left keel --update exiting 0.")
3093
3102
  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.")
3103
+ if took > 2 * QUERY_LIMIT_S + 15:
3104
+ report(f"{label} the hung query held keel --update for {took:.1f} s, past two {QUERY_LIMIT_S} s attempts.")
3096
3105
  return 1
3097
3106
 
3098
3107
  result, _, _ = update(env_extra={"KEEL_UPDATE_CODEX": str(tmp / "no-such-codex")})
@@ -3100,7 +3109,7 @@ def validate_update_host_query_timeout_scenario() -> int:
3100
3109
  report(f"{label} a missing codex executable no longer reads absent: {result.stdout!r}")
3101
3110
  return 1
3102
3111
 
3103
- result, _, _ = update("--dry-run", env_extra={"FAKE_LIST_SLEEP_CODEX": "15", "KEEL_UPDATE_QUERY_TIMEOUT_MS": "4000"})
3112
+ result, _, _ = update("--dry-run", env_extra={"FAKE_LIST_SLEEP_CODEX": "40", "KEEL_UPDATE_QUERY_TIMEOUT_MS": QUERY_LIMIT_MS})
3104
3113
  if result.returncode != 0:
3105
3114
  report(f"{label} --dry-run with a hung query exited {result.returncode}: {result.stdout!r}")
3106
3115
  return 1
@@ -3150,7 +3159,7 @@ def validate_update_codex_from_disk_scenario() -> int:
3150
3159
  env.update({
3151
3160
  "KEEL_UPDATE_NPM": str(launchers["npm"]), "KEEL_UPDATE_CLAUDE": str(launchers["claude"]),
3152
3161
  "KEEL_UPDATE_CODEX": str(launchers["codex"]), "CODEX_HOME": str(codex_home),
3153
- "KEEL_UPDATE_QUERY_TIMEOUT_MS": "2000", "FAKE_LIST_SLEEP_CODEX": "15",
3162
+ "KEEL_UPDATE_QUERY_TIMEOUT_MS": QUERY_LIMIT_MS, "FAKE_LIST_SLEEP_CODEX": "40",
3154
3163
  "FAKE_LOG": str(log), "FAKE_STATE": str(state), "FAKE_CODEX_SOURCE": str(tmp / "codex-source"),
3155
3164
  "FAKE_CODEX_CACHE": str(cache),
3156
3165
  })
@@ -3319,10 +3328,10 @@ def validate_update_host_query_retry_scenario() -> int:
3319
3328
  env = dict(os.environ)
3320
3329
  env.update({
3321
3330
  "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",
3331
+ "KEEL_UPDATE_CODEX": str(launchers["codex"]), "KEEL_UPDATE_QUERY_TIMEOUT_MS": QUERY_LIMIT_MS,
3323
3332
  "CODEX_HOME": str(tmp / "codex-home"), "FAKE_LOG": str(log), "FAKE_STATE": str(state),
3324
3333
  "FAKE_CODEX_SOURCE": str(source),
3325
- "FAKE_LIST_SLEEP_CODEX": "15", "FAKE_LIST_SLEEP_TIMES_CODEX": times,
3334
+ "FAKE_LIST_SLEEP_CODEX": "40", "FAKE_LIST_SLEEP_TIMES_CODEX": times,
3326
3335
  })
3327
3336
  env.pop("KEEL_UPDATE_SOURCE", None)
3328
3337
  started = time.monotonic()
@@ -3341,7 +3350,7 @@ def validate_update_host_query_retry_scenario() -> int:
3341
3350
  return 1
3342
3351
 
3343
3352
  result, calls, line, took = update("9")
3344
- for needle in ("failed", "codex plugin list --json", "timed out twice", "4 s"):
3353
+ for needle in ("failed", "codex plugin list --json", "timed out twice", f"{QUERY_LIMIT_S} s"):
3345
3354
  if needle not in line:
3346
3355
  report(f"{label} a lasting hang's line does not name {needle!r}: {line!r}")
3347
3356
  return 1
@@ -3349,8 +3358,8 @@ def validate_update_host_query_retry_scenario() -> int:
3349
3358
  if runs != 2:
3350
3359
  report(f"{label} a lasting hang ran the query {runs} time(s), not 2: {calls!r}")
3351
3360
  return 1
3352
- if took > 25:
3353
- report(f"{label} two 4 s attempts held keel --update for {took:.1f} s.")
3361
+ if took > 2 * QUERY_LIMIT_S + 15:
3362
+ report(f"{label} two {QUERY_LIMIT_S} s attempts held keel --update for {took:.1f} s.")
3354
3363
  return 1
3355
3364
  if "update-host-query-retry" not in {name for name, _ in registry.SCENARIOS}:
3356
3365
  report(f"{label} scenario is not registered.")
@@ -584,6 +584,7 @@ SCENARIOS: tuple = (
584
584
  ("external-agents-are-documented", docs.validate_external_agents_are_documented_scenario),
585
585
  ("external-agent-exit-status", guard.validate_external_agent_exit_status_scenario),
586
586
  ("validation-runner", selfcheck.validate_validation_runner_scenario),
587
+ ("runner-refuses-what-it-would-not-run", selfcheck.validate_runner_refuses_what_it_would_not_run_scenario),
587
588
  ("section-boundary", contract.validate_section_boundary_scenario),
588
589
  ("review-entry-extent", contract.validate_review_entry_extent_scenario),
589
590
  ("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.")