@christang/keel 5.174.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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +58 -22
- package/README.zh-CN.md +650 -128
- package/assets/bootstrap/AGENTS.md +3 -3
- package/assets/openspec/schemas/keel-spec-driven/schema.yaml +16 -15
- package/assets/openspec/schemas/keel-spec-driven/templates/tasks.md +6 -5
- package/bin/keel.js +5 -6
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/plugins/keel/.claude-plugin/plugin.json +1 -1
- package/plugins/keel/.codex-plugin/plugin.json +1 -1
- package/plugins/keel/skills/keel-debug-failure/SKILL.md +2 -2
- package/scripts/validate_plugin.py +291 -33
- package/src/core/chat/cli.js +1 -1
- package/src/core/config.js +3 -2
- package/src/core/task-contract.js +1 -4
|
@@ -51,8 +51,8 @@ REQUIRED_SCRIPTS = [
|
|
|
51
51
|
"scripts/validate_plugin.py",
|
|
52
52
|
]
|
|
53
53
|
|
|
54
|
-
PACKAGE_VERSION = "5.
|
|
55
|
-
PROTOCOL_VERSION = "5.
|
|
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
|
|
@@ -755,7 +755,6 @@ def validate_openspec_schema(errors: list[str]) -> None:
|
|
|
755
755
|
"apply:",
|
|
756
756
|
"/opsx:apply",
|
|
757
757
|
"keel-review-checklist",
|
|
758
|
-
"Owner",
|
|
759
758
|
"Mode",
|
|
760
759
|
"Covers",
|
|
761
760
|
"Read",
|
|
@@ -773,7 +772,7 @@ def validate_openspec_schema(errors: list[str]) -> None:
|
|
|
773
772
|
"A subagent is the model's choice and is treated as the main agent is",
|
|
774
773
|
"approved `tasks.md` in order",
|
|
775
774
|
"Modify only files listed under Touch",
|
|
776
|
-
"
|
|
775
|
+
"reading does not expand write authority",
|
|
777
776
|
"Out-of-scope Need",
|
|
778
777
|
"unresolved follow-ups must be owned",
|
|
779
778
|
"Task Authoring Gate",
|
|
@@ -787,7 +786,8 @@ def validate_openspec_schema(errors: list[str]) -> None:
|
|
|
787
786
|
"real-task evidence",
|
|
788
787
|
"one of pass, passed, complete, completed, ok, or done.",
|
|
789
788
|
"## Expectation Coverage",
|
|
790
|
-
"carry a
|
|
789
|
+
"carry a disposition",
|
|
790
|
+
"`Resolved here:`",
|
|
791
791
|
):
|
|
792
792
|
if required not in schema:
|
|
793
793
|
errors.append(f"OpenSpec schema.yaml missing required language: {required}")
|
|
@@ -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",
|
|
@@ -15890,7 +15890,9 @@ def validate_task_contract_core_scenario() -> int:
|
|
|
15890
15890
|
|
|
15891
15891
|
|
|
15892
15892
|
def task_capsule_expanded_fixture() -> str:
|
|
15893
|
-
|
|
15893
|
+
# No `Owner:`: since #413 the capsule carries an owner only when a task
|
|
15894
|
+
# authors one, so writing the old default is no longer the same as omitting it.
|
|
15895
|
+
return task_contract_fixture().replace(" - Owner: keel-agent\n", "", 1).replace(
|
|
15894
15896
|
"E1: public behavior",
|
|
15895
15897
|
"E1: Public behavior passes.",
|
|
15896
15898
|
).replace(
|
|
@@ -18917,9 +18919,15 @@ def validate_task_body_ends_at_heading_scenario() -> int:
|
|
|
18917
18919
|
# one, and a vertical-tdd task compiles to the identical block and the
|
|
18918
18920
|
# identical fingerprint before and after, measured both ways. So no
|
|
18919
18921
|
# existing anchor drifted; this fixture is simply a different task now.
|
|
18922
|
+
#
|
|
18923
|
+
# Moved again, deliberately and for every anchor, in 5.175.0 (#413): the
|
|
18924
|
+
# capsule dropped three prohibitions and its default owner. The drift
|
|
18925
|
+
# diagnosis names that move a compiler change, measured with an anchor
|
|
18926
|
+
# recorded by 5.174.0, and the changelog tells each repository to
|
|
18927
|
+
# re-record once.
|
|
18920
18928
|
pinned = {
|
|
18921
|
-
"1.1": "
|
|
18922
|
-
"2.1": "
|
|
18929
|
+
"1.1": "7149e77c287d08abd33aae1835e24ff4892771efdfb5d6755b791e2d78436319",
|
|
18930
|
+
"2.1": "bc2d69bcf8718e5825af8f2fb5f318518f74051ea021a61d549691b449ad5929",
|
|
18923
18931
|
}
|
|
18924
18932
|
plain = (
|
|
18925
18933
|
"# Tasks\n\n"
|
|
@@ -21625,11 +21633,8 @@ def validate_task_capsule_scenario() -> int:
|
|
|
21625
21633
|
!= [
|
|
21626
21634
|
"must not change Acceptance",
|
|
21627
21635
|
"must not commit",
|
|
21628
|
-
"must not continue to another task",
|
|
21629
|
-
"must not mark tasks complete",
|
|
21630
21636
|
"must not push",
|
|
21631
21637
|
"must not sync or archive",
|
|
21632
|
-
"must not transfer Keel ownership",
|
|
21633
21638
|
]
|
|
21634
21639
|
):
|
|
21635
21640
|
report("task-capsule omitted default or prohibition authority.")
|
|
@@ -30314,7 +30319,7 @@ def validate_continuation_docs_scenario() -> int:
|
|
|
30314
30319
|
# to spell all of it: a reader copies from the list they are shown.
|
|
30315
30320
|
for needle in (
|
|
30316
30321
|
f"accepted names: {ACCEPTED_AUTHORIZE_NAMES}",
|
|
30317
|
-
"The
|
|
30322
|
+
"The thirteen names above are the whole vocabulary.",
|
|
30318
30323
|
"`protocol-refresh`, the seventh name",
|
|
30319
30324
|
):
|
|
30320
30325
|
if needle not in readme:
|
|
@@ -32507,10 +32512,11 @@ def validate_plan_funnel_guidance_scenario() -> int:
|
|
|
32507
32512
|
)
|
|
32508
32513
|
return 1
|
|
32509
32514
|
|
|
32510
|
-
|
|
32511
|
-
|
|
32512
|
-
|
|
32513
|
-
|
|
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
|
|
32514
32520
|
|
|
32515
32521
|
if "plan-funnel-guidance" not in {name for name, _ in SCENARIOS}:
|
|
32516
32522
|
report("plan-funnel-guidance: the scenario registry does not include it.")
|
|
@@ -32582,7 +32588,7 @@ def validate_domain_execution_references_scenario() -> int:
|
|
|
32582
32588
|
)
|
|
32583
32589
|
return 1
|
|
32584
32590
|
|
|
32585
|
-
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")
|
|
32586
32592
|
if "Execution and review checks" not in readme:
|
|
32587
32593
|
report(
|
|
32588
32594
|
"domain-execution-references: README does not describe the "
|
|
@@ -32786,10 +32792,10 @@ def validate_precompact_probe_scenario() -> int:
|
|
|
32786
32792
|
report("precompact-probe: rendered capabilities lack compaction lines.")
|
|
32787
32793
|
return 1
|
|
32788
32794
|
|
|
32789
|
-
|
|
32790
|
-
|
|
32791
|
-
|
|
32792
|
-
|
|
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
|
|
32793
32799
|
registered = {name for name, _ in SCENARIOS}
|
|
32794
32800
|
for scenario in ("plugin-compaction-continuity", "precompact-probe"):
|
|
32795
32801
|
if scenario not in registered:
|
|
@@ -32858,11 +32864,12 @@ def validate_touch_guard_surface_scenario() -> int:
|
|
|
32858
32864
|
)
|
|
32859
32865
|
return 1
|
|
32860
32866
|
|
|
32861
|
-
|
|
32862
|
-
|
|
32863
|
-
|
|
32864
|
-
|
|
32865
|
-
|
|
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
|
|
32866
32873
|
bootstrap = (ROOT / "assets/bootstrap/AGENTS.md").read_text(encoding="utf-8")
|
|
32867
32874
|
# The bootstrap must tell a consumer the guard exists and how to opt out;
|
|
32868
32875
|
# it no longer spends bytes naming `keel guard clear`, which `keel --help`
|
|
@@ -34669,10 +34676,11 @@ def validate_validation_runner_scenario() -> int:
|
|
|
34669
34676
|
"invocation, not a per-scenario chain."
|
|
34670
34677
|
)
|
|
34671
34678
|
return 1
|
|
34672
|
-
|
|
34673
|
-
|
|
34674
|
-
|
|
34675
|
-
|
|
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
|
|
34676
34684
|
|
|
34677
34685
|
# The full gate must actually run somewhere other than one author's machine:
|
|
34678
34686
|
# a workflow drives the same single entry point on push and pull request,
|
|
@@ -39296,6 +39304,252 @@ def validate_native_capabilities_unrestricted_scenario() -> int:
|
|
|
39296
39304
|
return 0
|
|
39297
39305
|
|
|
39298
39306
|
|
|
39307
|
+
# Sentences the surfaces said after the code stopped saying them (#413).
|
|
39308
|
+
STALE_SURFACE_SENTENCES = (
|
|
39309
|
+
"Owner is the current Keel agent",
|
|
39310
|
+
"retry counting",
|
|
39311
|
+
"Keel Hook completion gate",
|
|
39312
|
+
"unless Touch authorizes diagnostics",
|
|
39313
|
+
"explicitly allows it",
|
|
39314
|
+
"without explicit authorization",
|
|
39315
|
+
"Commands prove Acceptance",
|
|
39316
|
+
"Acceptance, Commands, and Stop/Autonomy",
|
|
39317
|
+
"not a failed attempt",
|
|
39318
|
+
"skills and agents after",
|
|
39319
|
+
"Invoke OpenSpec through",
|
|
39320
|
+
"Remote Control off, the wake task",
|
|
39321
|
+
)
|
|
39322
|
+
|
|
39323
|
+
|
|
39324
|
+
def validate_surfaces_agree_with_code_scenario() -> int:
|
|
39325
|
+
"""Issue #413: what the model reads states what the code does.
|
|
39326
|
+
|
|
39327
|
+
#414 removed the protocol's old stance and the capsule kept it: every
|
|
39328
|
+
task-start still printed "must not continue to another task". The other
|
|
39329
|
+
sentences here contradicted the code they describe — a diagnose-only task
|
|
39330
|
+
the parser refuses unless its Touch is `none`, a completion hook no plugin
|
|
39331
|
+
declares, an authorization list ten names long beside a code list of
|
|
39332
|
+
thirteen. The names are read from `src/core/config.js`, so a name added
|
|
39333
|
+
later without its spec line fails here.
|
|
39334
|
+
"""
|
|
39335
|
+
label = "surfaces-agree-with-code:"
|
|
39336
|
+
with tempfile.TemporaryDirectory(prefix="keel-surfaces-413-") as raw:
|
|
39337
|
+
repo = Path(raw)
|
|
39338
|
+
write_text(repo / "openspec/changes/demo/tasks.md", task_capsule_compact_fixture())
|
|
39339
|
+
started = run_keel(repo, "gate", "task-start", "--change", "demo", "--task", "1.1", "--no-guard", "--json")
|
|
39340
|
+
if started.returncode != 0:
|
|
39341
|
+
report(f"{label} task-start refused the compact fixture.")
|
|
39342
|
+
report((started.stderr or started.stdout).strip())
|
|
39343
|
+
return 1
|
|
39344
|
+
capsule = json.loads(started.stdout).get("contract", {}).get("capsule", {})
|
|
39345
|
+
if "owner" in capsule:
|
|
39346
|
+
report(f"{label} a task that authors no Owner compiled to owner {capsule['owner']!r}.")
|
|
39347
|
+
return 1
|
|
39348
|
+
kept = ["must not change Acceptance", "must not commit", "must not push", "must not sync or archive"]
|
|
39349
|
+
if capsule.get("prohibitions") != kept:
|
|
39350
|
+
report(f"{label} the capsule prohibits {capsule.get('prohibitions')!r}, not {kept!r}.")
|
|
39351
|
+
return 1
|
|
39352
|
+
|
|
39353
|
+
overlays = []
|
|
39354
|
+
for action in ("apply", "archive", "sync"):
|
|
39355
|
+
overlays.append(ROOT / f".claude/commands/opsx/{action}.md")
|
|
39356
|
+
for name in ("apply-change", "archive-change", "sync-specs"):
|
|
39357
|
+
overlays.append(ROOT / f".claude/skills/openspec-{name}/SKILL.md")
|
|
39358
|
+
overlays.append(ROOT / f".codex/skills/openspec-{name}/SKILL.md")
|
|
39359
|
+
schemas = [
|
|
39360
|
+
ROOT / "assets/openspec/schemas/keel-spec-driven",
|
|
39361
|
+
ROOT / "openspec/schemas/keel-spec-driven",
|
|
39362
|
+
]
|
|
39363
|
+
required = {
|
|
39364
|
+
ROOT / "AGENTS.md": [
|
|
39365
|
+
"with `Touch: none` and no worktree writes",
|
|
39366
|
+
"a standing authorization in `keel/config.yaml` allows it",
|
|
39367
|
+
"`Verify` checks MUST verify",
|
|
39368
|
+
],
|
|
39369
|
+
ROOT / "assets/bootstrap/AGENTS.md": [
|
|
39370
|
+
"No commit, push, sync, or archive unless the task, the owner, or `keel/config.yaml` authorizes it.",
|
|
39371
|
+
],
|
|
39372
|
+
ROOT / "src/skills/keel-debug-failure/SKILL.md": ["expected rather than a stop"],
|
|
39373
|
+
ROOT / PLUGIN_ROOT / "skills/keel-debug-failure/SKILL.md": ["expected rather than a stop"],
|
|
39374
|
+
ROOT / "bin/keel.js": [],
|
|
39375
|
+
ROOT / "src/core/config.js": [],
|
|
39376
|
+
}
|
|
39377
|
+
for schema in schemas:
|
|
39378
|
+
required[schema / "schema.yaml"] = [
|
|
39379
|
+
"equivalence (which also declares `Base:` and `Fields:`)",
|
|
39380
|
+
"`Resolved here:`",
|
|
39381
|
+
"No hook gates completion",
|
|
39382
|
+
]
|
|
39383
|
+
required[schema / "templates/tasks.md"] = ["equivalence", '"Resolved here:"']
|
|
39384
|
+
for overlay in overlays:
|
|
39385
|
+
required[overlay] = ["Invoke the OpenSpec CLI as `keel openspec"]
|
|
39386
|
+
if "apply" in overlay.as_posix():
|
|
39387
|
+
required[overlay].append("Verify checks prove Acceptance")
|
|
39388
|
+
for surface, sentences in required.items():
|
|
39389
|
+
if not surface.is_file():
|
|
39390
|
+
report(f"{label} {surface.relative_to(ROOT)} is missing, so it cannot be checked.")
|
|
39391
|
+
return 1
|
|
39392
|
+
text = surface.read_text(encoding="utf-8")
|
|
39393
|
+
for phrase in STALE_SURFACE_SENTENCES:
|
|
39394
|
+
if phrase in text:
|
|
39395
|
+
report(f"{label} {surface.relative_to(ROOT)} still says {phrase!r}.")
|
|
39396
|
+
return 1
|
|
39397
|
+
for sentence in sentences:
|
|
39398
|
+
if sentence not in text:
|
|
39399
|
+
report(f"{label} {surface.relative_to(ROOT)} does not say {sentence!r}.")
|
|
39400
|
+
return 1
|
|
39401
|
+
if surface in overlays and text.count("keel openspec …") != 1:
|
|
39402
|
+
report(f"{label} {surface.relative_to(ROOT)} tells the agent to use `keel openspec` {text.count('keel openspec …')} times, not once.")
|
|
39403
|
+
return 1
|
|
39404
|
+
|
|
39405
|
+
help_text = run_keel(ROOT, "--help").stdout
|
|
39406
|
+
for command in ("keel patrol", "keel tick"):
|
|
39407
|
+
if command not in help_text:
|
|
39408
|
+
report(f"{label} keel --help does not name {command!r}.")
|
|
39409
|
+
return 1
|
|
39410
|
+
chat_help = run_keel(ROOT, "chat", "help").stdout
|
|
39411
|
+
if "post-tool-use" not in chat_help:
|
|
39412
|
+
report(f"{label} keel chat help does not name the post-tool-use hook.")
|
|
39413
|
+
return 1
|
|
39414
|
+
|
|
39415
|
+
config = (ROOT / "src/core/config.js").read_text(encoding="utf-8")
|
|
39416
|
+
declared = re.search(r"const STANDING_AUTHORIZATION_ACTIONS = \[(.*?)\];", config, re.S)
|
|
39417
|
+
names = re.findall(r'^\s*"([a-z-]+)",', declared.group(1), re.M) if declared else []
|
|
39418
|
+
if len(names) < 13:
|
|
39419
|
+
report(f"{label} read {len(names)} standing-authorization names from config.js; expected at least 13.")
|
|
39420
|
+
return 1
|
|
39421
|
+
standing = (ROOT / "openspec/specs/keel-standing-authorization/spec.md").read_text(encoding="utf-8")
|
|
39422
|
+
vocabulary = re.search(r"(?s)### Requirement: A repository declares standing authorization in a closed vocabulary\n(.*?)\n#### ", standing)
|
|
39423
|
+
if not vocabulary:
|
|
39424
|
+
report(f"{label} keel-standing-authorization has no closed-vocabulary requirement to read.")
|
|
39425
|
+
return 1
|
|
39426
|
+
for name in names:
|
|
39427
|
+
if f"`{name}`" not in vocabulary.group(1):
|
|
39428
|
+
report(f"{label} keel-standing-authorization does not list `{name}` in its closed vocabulary.")
|
|
39429
|
+
return 1
|
|
39430
|
+
for spec, phrase in (
|
|
39431
|
+
("keel-domain-lenses", "reads only the lens"),
|
|
39432
|
+
("keel-domain-lenses", "no other lens is loaded"),
|
|
39433
|
+
("keel-task-capsule", "current-agent ownership"),
|
|
39434
|
+
):
|
|
39435
|
+
if phrase in (ROOT / f"openspec/specs/{spec}/spec.md").read_text(encoding="utf-8"):
|
|
39436
|
+
report(f"{label} {spec} still says {phrase!r}.")
|
|
39437
|
+
return 1
|
|
39438
|
+
if label.rstrip(":") not in {name for name, _ in SCENARIOS}:
|
|
39439
|
+
report(f"{label} the scenario registry does not include it.")
|
|
39440
|
+
return 1
|
|
39441
|
+
report(f"{label.rstrip(':')} scenario passed.")
|
|
39442
|
+
return 0
|
|
39443
|
+
|
|
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
|
+
|
|
39299
39553
|
def validate_tdd_strategy_guide_scenario() -> int:
|
|
39300
39554
|
"""Issue #389: the skill an executor loads to plan its checks says how to choose.
|
|
39301
39555
|
|
|
@@ -41414,6 +41668,9 @@ SCENARIOS: tuple = (
|
|
|
41414
41668
|
("tdd-strategy-guide", validate_tdd_strategy_guide_scenario),
|
|
41415
41669
|
("native-capabilities-unrestricted", validate_native_capabilities_unrestricted_scenario),
|
|
41416
41670
|
("native-projections-removed", validate_native_projections_removed_scenario),
|
|
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),
|
|
41417
41674
|
(
|
|
41418
41675
|
"a-tier-declares-what-is-skipped",
|
|
41419
41676
|
validate_a_tier_declares_what_is_skipped_scenario,
|
|
@@ -41501,9 +41758,10 @@ def validate_openspec_invocable(errors: list[str]) -> None:
|
|
|
41501
41758
|
cli = (ROOT / "bin/keel.js").read_text(encoding="utf-8")
|
|
41502
41759
|
if 'options.action === "openspec"' not in cli:
|
|
41503
41760
|
errors.append("bin/keel.js must implement the `keel openspec` passthrough.")
|
|
41504
|
-
|
|
41761
|
+
# Once per overlay, in the header every action shares (#413).
|
|
41762
|
+
if cli.count("Invoke the OpenSpec CLI as `keel openspec") < 2:
|
|
41505
41763
|
errors.append(
|
|
41506
|
-
"the apply and
|
|
41764
|
+
"the apply, archive, and sync overlays must direct agents to `keel openspec` "
|
|
41507
41765
|
"in place of a bare openspec command."
|
|
41508
41766
|
)
|
|
41509
41767
|
|
package/src/core/chat/cli.js
CHANGED
|
@@ -48,7 +48,7 @@ const USAGE = [
|
|
|
48
48
|
"keel chat bot add|remove <name> | list (the Slack bots this machine holds Keychain tokens for, as bot:<name> and app:<name>)",
|
|
49
49
|
"keel chat notice (what is unread and addressed to you, for any host; always exits 0)",
|
|
50
50
|
"keel chat notice --check (for schedulers: no output; exit 0 only when something addressed to you is unread, else 1)",
|
|
51
|
-
"keel chat hook session-start|user-prompt-submit|file-changed|session-end (Claude Code hook; JSON on stdin)",
|
|
51
|
+
"keel chat hook session-start|user-prompt-submit|post-tool-use|file-changed|session-end (Claude Code hook; JSON on stdin)",
|
|
52
52
|
"keel chat wake add [--host codex] [--thread <id>] [--max-per-hour <n>] [--compact-at <tokens>] (this machine starts a Codex turn when something addressed to this worktree's role arrives)",
|
|
53
53
|
"keel chat wake remove (stop waking this worktree's role on this machine)",
|
|
54
54
|
"keel chat wake status [--json]",
|
package/src/core/config.js
CHANGED
|
@@ -36,8 +36,9 @@ const STANDING_AUTHORIZATION_ACTIONS = [
|
|
|
36
36
|
// (#319). It reaches that one session, so it takes no scope.
|
|
37
37
|
"shift-restore",
|
|
38
38
|
// A session's own four outgoing steps on the desktop app, after `keel shift
|
|
39
|
-
// ready --wake` stored its note:
|
|
40
|
-
//
|
|
39
|
+
// ready --wake` stored its note: the wake task, starting it, the rename,
|
|
40
|
+
// and the clear (#319; Remote Control stays on since #324). Never the
|
|
41
|
+
// decision to change shift.
|
|
41
42
|
"self-shift",
|
|
42
43
|
];
|
|
43
44
|
|
|
@@ -1481,7 +1481,7 @@ function compileTaskContract(repo, change, task, options = {}) {
|
|
|
1481
1481
|
id: task.id,
|
|
1482
1482
|
title: normalizeText(task.title),
|
|
1483
1483
|
},
|
|
1484
|
-
owner: normalizeText(field(task, "Owner"))
|
|
1484
|
+
...(normalizeText(field(task, "Owner")) ? { owner: normalizeText(field(task, "Owner")) } : {}),
|
|
1485
1485
|
mode,
|
|
1486
1486
|
authority,
|
|
1487
1487
|
read,
|
|
@@ -1543,11 +1543,8 @@ function compileTaskContract(repo, change, task, options = {}) {
|
|
|
1543
1543
|
// Whether the action it performed was the authorized one is a Review
|
|
1544
1544
|
// judgment; what the capsule fixes is the write posture.
|
|
1545
1545
|
...(mode === "repo-action" ? [] : ["must not commit"]),
|
|
1546
|
-
"must not continue to another task",
|
|
1547
|
-
"must not mark tasks complete",
|
|
1548
1546
|
"must not push",
|
|
1549
1547
|
"must not sync or archive",
|
|
1550
|
-
"must not transfer Keel ownership",
|
|
1551
1548
|
...(NO_WRITE_MODES.has(mode) ? ["must not write product files"] : []),
|
|
1552
1549
|
],
|
|
1553
1550
|
};
|