@christang/keel 5.175.0 → 5.176.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,4 +1,4 @@
1
- <!-- keel:start version=5.175.0 -->
1
+ <!-- keel:start version=5.176.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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@christang/keel",
3
- "version": "5.175.0",
3
+ "version": "5.176.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@christang/keel",
9
- "version": "5.175.0",
9
+ "version": "5.176.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.175.0",
5
+ "version": "5.176.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.175.0",
3
+ "version": "5.176.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.175.0",
3
+ "version": "5.176.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",
@@ -51,8 +51,8 @@ REQUIRED_SCRIPTS = [
51
51
  "scripts/validate_plugin.py",
52
52
  ]
53
53
 
54
- PACKAGE_VERSION = "5.175.0"
55
- PROTOCOL_VERSION = "5.175.0"
54
+ PACKAGE_VERSION = "5.176.0"
55
+ PROTOCOL_VERSION = "5.176.0"
56
56
  LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
57
57
  OPENSPEC_SCHEMA_NAME = "keel-spec-driven"
58
58
  # Mirrors KEEL_PACKAGE_NAME in scripts/install_to_repo.py, one of the two
@@ -1126,7 +1126,7 @@ def validate_skill_portability_policy_scenario() -> int:
1126
1126
  validate_resident_blocks(policy_errors)
1127
1127
  validate_openspec_schema(policy_errors)
1128
1128
  validate_skill_docs(policy_errors)
1129
- for path in (ROOT / "AGENTS.md", ROOT / "README.zh-CN.md"):
1129
+ for path in (ROOT / "AGENTS.md", ROOT / "README.md", ROOT / "README.zh-CN.md"):
1130
1130
  content = path.read_text(encoding="utf-8")
1131
1131
  for snippet in (
1132
1132
  "authoritative source",
@@ -30319,7 +30319,7 @@ def validate_continuation_docs_scenario() -> int:
30319
30319
  # to spell all of it: a reader copies from the list they are shown.
30320
30320
  for needle in (
30321
30321
  f"accepted names: {ACCEPTED_AUTHORIZE_NAMES}",
30322
- "The eleven names above are the whole vocabulary.",
30322
+ "The thirteen names above are the whole vocabulary.",
30323
30323
  "`protocol-refresh`, the seventh name",
30324
30324
  ):
30325
30325
  if needle not in readme:
@@ -32512,10 +32512,11 @@ def validate_plan_funnel_guidance_scenario() -> int:
32512
32512
  )
32513
32513
  return 1
32514
32514
 
32515
- readme = (ROOT / "README.zh-CN.md").read_text(encoding="utf-8")
32516
- if "plan mode" not in readme or "proposal/design/specs/tasks" not in readme:
32517
- report("plan-funnel-guidance: README lacks the plan-mode funnel rule.")
32518
- return 1
32515
+ for name in ("README.md", "README.zh-CN.md"):
32516
+ readme = (ROOT / name).read_text(encoding="utf-8")
32517
+ if "plan mode" not in readme or "proposal/design/specs/tasks" not in readme:
32518
+ report(f"plan-funnel-guidance: {name} lacks the plan-mode funnel rule.")
32519
+ return 1
32519
32520
 
32520
32521
  if "plan-funnel-guidance" not in {name for name, _ in SCENARIOS}:
32521
32522
  report("plan-funnel-guidance: the scenario registry does not include it.")
@@ -32587,7 +32588,7 @@ def validate_domain_execution_references_scenario() -> int:
32587
32588
  )
32588
32589
  return 1
32589
32590
 
32590
- readme = (ROOT / "README.zh-CN.md").read_text(encoding="utf-8")
32591
+ readme = (ROOT / "README.zh-CN.md").read_text(encoding="utf-8") + (ROOT / "README.md").read_text(encoding="utf-8")
32591
32592
  if "Execution and review checks" not in readme:
32592
32593
  report(
32593
32594
  "domain-execution-references: README does not describe the "
@@ -32791,10 +32792,10 @@ def validate_precompact_probe_scenario() -> int:
32791
32792
  report("precompact-probe: rendered capabilities lack compaction lines.")
32792
32793
  return 1
32793
32794
 
32794
- readme = (ROOT / "README.zh-CN.md").read_text(encoding="utf-8")
32795
- if "--event compaction" not in readme:
32796
- report("precompact-probe: README lacks the manual compaction command.")
32797
- return 1
32795
+ for name in ("README.md", "README.zh-CN.md"):
32796
+ if "--event compaction" not in (ROOT / name).read_text(encoding="utf-8"):
32797
+ report(f"precompact-probe: {name} lacks the manual compaction command.")
32798
+ return 1
32798
32799
  registered = {name for name, _ in SCENARIOS}
32799
32800
  for scenario in ("plugin-compaction-continuity", "precompact-probe"):
32800
32801
  if scenario not in registered:
@@ -32863,11 +32864,12 @@ def validate_touch_guard_surface_scenario() -> int:
32863
32864
  )
32864
32865
  return 1
32865
32866
 
32866
- readme = (ROOT / "README.zh-CN.md").read_text(encoding="utf-8")
32867
- for needle in ("keel guard start", "keel guard clear", "guard.json", "Bash"):
32868
- if needle not in readme:
32869
- report(f"touch-guard-surface: README lacks guard guidance: {needle}.")
32870
- return 1
32867
+ for name in ("README.md", "README.zh-CN.md"):
32868
+ readme = (ROOT / name).read_text(encoding="utf-8")
32869
+ for needle in ("keel guard start", "keel guard clear", "guard.json", "Bash"):
32870
+ if needle not in readme:
32871
+ report(f"touch-guard-surface: {name} lacks guard guidance: {needle}.")
32872
+ return 1
32871
32873
  bootstrap = (ROOT / "assets/bootstrap/AGENTS.md").read_text(encoding="utf-8")
32872
32874
  # The bootstrap must tell a consumer the guard exists and how to opt out;
32873
32875
  # it no longer spends bytes naming `keel guard clear`, which `keel --help`
@@ -34674,10 +34676,11 @@ def validate_validation_runner_scenario() -> int:
34674
34676
  "invocation, not a per-scenario chain."
34675
34677
  )
34676
34678
  return 1
34677
- readme = (ROOT / "README.zh-CN.md").read_text(encoding="utf-8")
34678
- if "--all" not in readme or "--jobs" not in readme:
34679
- report("validation-runner: README does not document the parallel runner.")
34680
- return 1
34679
+ for name in ("README.md", "README.zh-CN.md"):
34680
+ readme = (ROOT / name).read_text(encoding="utf-8")
34681
+ if "--all" not in readme or "--jobs" not in readme:
34682
+ report(f"validation-runner: {name} does not document the parallel runner.")
34683
+ return 1
34681
34684
 
34682
34685
  # The full gate must actually run somewhere other than one author's machine:
34683
34686
  # a workflow drives the same single entry point on push and pull request,
@@ -39439,6 +39442,114 @@ def validate_surfaces_agree_with_code_scenario() -> int:
39439
39442
  return 0
39440
39443
 
39441
39444
 
39445
+ COUNT_WORDS = {13: "thirteen", 14: "fourteen", 15: "fifteen", 16: "sixteen"}
39446
+
39447
+
39448
+ def readme_cli_problem(readme: Path, exit_label: str, count_phrase) -> str | None:
39449
+ """What a README fails to state about the CLI, or None (#413).
39450
+
39451
+ Every list is read from the CLI or the code, so a command, flag, or
39452
+ authorization name added later without its README line fails here.
39453
+ """
39454
+ text = readme.read_text(encoding="utf-8")
39455
+ usage = run_keel(ROOT, "--help").stdout.split("Usage:", 1)[-1].split("\n\n", 1)[0]
39456
+ commands = sorted(set(re.findall(r"^\s*keel ([a-z][a-z-]*)", usage, re.M)))
39457
+ flags = sorted(set(re.findall(r"(?<![\w-])(--[a-z][a-z-]*)", usage)))
39458
+ if len(commands) < 16 or len(flags) < 30:
39459
+ return f"read {len(commands)} commands and {len(flags)} flags from keel --help; expected at least 16 and 30."
39460
+ for command in commands:
39461
+ if f"keel {command}" not in text:
39462
+ return f"{readme.name} does not name `keel {command}`."
39463
+ for flag in flags:
39464
+ if not re.search(r"(?<![\w-])" + re.escape(flag) + r"(?![\w-])", text):
39465
+ return f"{readme.name} does not name `{flag}`."
39466
+ config = (ROOT / "src/core/config.js").read_text(encoding="utf-8")
39467
+ declared = re.search(r"const STANDING_AUTHORIZATION_ACTIONS = \[(.*?)\];", config, re.S)
39468
+ names = re.findall(r'^\s*"([a-z-]+)",', declared.group(1), re.M) if declared else []
39469
+ if len(names) < 13:
39470
+ return f"read {len(names)} standing-authorization names from config.js; expected at least 13."
39471
+ for name in names:
39472
+ if not re.search(r"(?<![\w-])" + re.escape(name) + r"(?![\w-])", text):
39473
+ return f"{readme.name} does not name the standing authorization `{name}`."
39474
+ phrase = count_phrase(len(names))
39475
+ if phrase not in text:
39476
+ return f"{readme.name} does not say {phrase!r}, the count of names config.js accepts."
39477
+ # The line that lists them, wherever else the word appears in prose.
39478
+ exit_lines = [line for line in text.splitlines() if exit_label in line]
39479
+ if not exit_lines:
39480
+ return f"{readme.name} has no line containing {exit_label!r}."
39481
+ listed = max(exit_lines, key=lambda line: sum(f"`{code}`" in line for code in range(5)))
39482
+ for code in range(5):
39483
+ if f"`{code}`" not in listed:
39484
+ return f"{readme.name} does not describe exit code {code} on its {exit_label!r} line."
39485
+ return None
39486
+
39487
+
39488
+ README_STALE_SENTENCES = (
39489
+ "skills and agents follow",
39490
+ "The eleven names",
39491
+ "load only that one lens",
39492
+ "(pick one task)",
39493
+ "`keel --init` writes only",
39494
+ "--doctor | --uninstall [--target <t>] [--dry-run]",
39495
+ "full command and workflow reference",
39496
+ )
39497
+
39498
+
39499
+ def validate_readme_states_the_cli_scenario() -> int:
39500
+ """Issue #413: the English README states what the CLI does."""
39501
+ label = "readme-states-the-cli:"
39502
+ readme = ROOT / "README.md"
39503
+ problem = readme_cli_problem(readme, "Exit codes", lambda n: f"{COUNT_WORDS.get(n, n)} names")
39504
+ if problem:
39505
+ report(f"{label} {problem}")
39506
+ return 1
39507
+ text = readme.read_text(encoding="utf-8")
39508
+ for phrase in README_STALE_SENTENCES:
39509
+ if phrase in text:
39510
+ report(f"{label} README.md still says {phrase!r}.")
39511
+ return 1
39512
+ if label.rstrip(":") not in {name for name, _ in SCENARIOS}:
39513
+ report(f"{label} the scenario registry does not include it.")
39514
+ return 1
39515
+ report(f"{label.rstrip(':')} scenario passed.")
39516
+ return 0
39517
+
39518
+
39519
+ def validate_readme_zh_matches_english_scenario() -> int:
39520
+ """Issue #413: the Chinese README is the English one's counterpart.
39521
+
39522
+ It was 355 lines against 1000 and lacked thirteen sections, while the
39523
+ English README called it the full reference. The command and name checks
39524
+ are the English ones; section parity is a heading count, the one
39525
+ structural measure that needs no translation table.
39526
+ """
39527
+ label = "readme-zh-matches-english:"
39528
+ zh = ROOT / "README.zh-CN.md"
39529
+ problem = readme_cli_problem(zh, "退出码", lambda n: f"{n} 个名字")
39530
+ if problem:
39531
+ report(f"{label} {problem}")
39532
+ return 1
39533
+ english = (ROOT / "README.md").read_text(encoding="utf-8")
39534
+ chinese = zh.read_text(encoding="utf-8")
39535
+ for level in ("## ", "### "):
39536
+ counts = [
39537
+ sum(1 for line in text.splitlines() if line.startswith(level))
39538
+ for text in (english, chinese)
39539
+ ]
39540
+ if counts[0] != counts[1]:
39541
+ report(f"{label} README.md has {counts[0]} `{level.strip()}` headings and README.zh-CN.md has {counts[1]}.")
39542
+ return 1
39543
+ if "装配时的 `keel --init`" in chinese:
39544
+ report(f"{label} README.zh-CN.md still names `keel --init` as the one setup command.")
39545
+ return 1
39546
+ if label.rstrip(":") not in {name for name, _ in SCENARIOS}:
39547
+ report(f"{label} the scenario registry does not include it.")
39548
+ return 1
39549
+ report(f"{label.rstrip(':')} scenario passed.")
39550
+ return 0
39551
+
39552
+
39442
39553
  def validate_tdd_strategy_guide_scenario() -> int:
39443
39554
  """Issue #389: the skill an executor loads to plan its checks says how to choose.
39444
39555
 
@@ -41558,6 +41669,8 @@ SCENARIOS: tuple = (
41558
41669
  ("native-capabilities-unrestricted", validate_native_capabilities_unrestricted_scenario),
41559
41670
  ("native-projections-removed", validate_native_projections_removed_scenario),
41560
41671
  ("surfaces-agree-with-code", validate_surfaces_agree_with_code_scenario),
41672
+ ("readme-states-the-cli", validate_readme_states_the_cli_scenario),
41673
+ ("readme-zh-matches-english", validate_readme_zh_matches_english_scenario),
41561
41674
  (
41562
41675
  "a-tier-declares-what-is-skipped",
41563
41676
  validate_a_tier_declares_what_is_skipped_scenario,