@christang/keel 5.187.0 → 5.189.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.187.0",
3
+ "version": "5.189.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.187.0 -->
1
+ <!-- keel:start version=5.189.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.187.0",
3
+ "version": "5.189.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@christang/keel",
9
- "version": "5.187.0",
9
+ "version": "5.189.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.187.0",
5
+ "version": "5.189.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.187.0",
3
+ "version": "5.189.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.187.0",
3
+ "version": "5.189.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",
@@ -9,6 +9,8 @@ description: Create, validate, or clear the optional keel-handoff/v1 pointer ove
9
9
 
10
10
  Use this skill only when `keel context` is ambiguous or blocked because human intent cannot be inferred, or when the user explicitly asks to set or clear an override. HANDOFF is not session state or a startup summary, and it is not a durable follow-up owner.
11
11
 
12
+ The shift note that `keel shift ready` stores is a different thing: it hands working context to the role's next session and selects no task. HANDOFF overrides which task `keel context` selects. Neither holds task state; OpenSpec does.
13
+
12
14
  ## Context to read
13
15
 
14
16
  Run `keel context --json`, then read the returned paths and the intended durable OpenSpec owner under `openspec/changes/<change>/`.
@@ -23,7 +23,6 @@ Read the selected OpenSpec proposal, design, specs, tasks, diff, and command evi
23
23
  - A failure message must **name the actual cause** of what it reports. Watch for one condition guarding **two distinct failures** — `if result is None or result["status"] != expected` reports the first failure's message when the second one happened, sending the reader to a place with no problem in it. Split the condition. No gate can judge this: deciding whether a sentence misleads needs a model, so it stays here.
24
24
  - When two tasks in the change declared the same Touch set under a red-green strategy — `keel gate task-start` warns about this — ask whether they turned out to be **one behavior** split in half. The tell is that the first task's minimal implementation was wrong in the field, or that the second had no honest red left because the first already made its checks pass. The gate can only see the shape; by completion you can see the outcome, which is the only point at which this is answerable.
25
25
  - Scope attribution is now the gate's job by default: `keel gate task-complete` compares the worktree against the dirty set `task-start` recorded and refuses a path outside Touch, so a `pass` is evidence about scope rather than silence about it. Two cases still need you. When the gate reports paths as *unattributed* — no recorded set, because the manifest predates the field or the guard was cleared — nothing was checked and the review is the only scope evidence. And a path already dirty when the task started stays unattributed only while its content matches what was recorded then; if the task changed it again, the gate attributes it — so read the gate's silence about such a path as evidence its content was never touched again, not as an unconditional exemption.
26
- - For `Coupling: required`, confirm one complete candidate reached its completion gate and generated artifacts are aligned.
27
26
 
28
27
  ## Semantic Review
29
28
 
@@ -51,10 +50,6 @@ happened.
51
50
 
52
51
  The Review remains in tasks.md. A user-facing Report summarizes delivery but is not hidden gate state. Do not let Core or this checklist write evidence automatically.
53
52
 
54
- ## Domain lenses
55
-
56
- When the change's artifacts or Touch extensions signal a domain, consult the matching lens's `Execution and review checks` section from `keel/lenses/` — the lens whose `Applies when:` header matches — before concluding the review. When no lens matches, load nothing.
57
-
58
53
  ## Expectation and follow-up ownership
59
54
 
60
55
  Each related critical expectation needs behavior evidence, a durable follow-up owner, or an explicit discard reason. Relevant `D<n>`, `F<n>`, `A<n>`, and `Q<n>` references in Covers must agree with their OpenSpec basis and resolution owner. Unresolved authority returns to OpenSpec authoring.
@@ -68,21 +63,9 @@ its verdict rests on.
68
63
 
69
64
  `keel/HANDOFF.md` is an optional pointer override and cannot own findings, critical expectation state, evidence details, or follow-ups.
70
65
 
71
- ## Skill change review
72
-
73
- For a new or materially expanded dedicated skill, confirm the authoring evidence
74
- identifies authoritative sources, provenance and license implications, realistic
75
- positive and negative trigger cases, and real-task evidence. Confirm detailed
76
- conditional knowledge uses progressive references when it is not needed on
77
- every activation.
78
-
79
- The canonical portable `SKILL.md` must agree with every declared target
80
- projection. Target metadata may be additive, but it must not redefine skill
81
- behavior or make Keel the authority for target-native discovery or activation.
82
-
83
- ## Planning artifact funnel
66
+ ## Conditional checks
84
67
 
85
- When the work followed an accepted native plan-mode artifact, confirm its decisions affecting scope, Acceptance, completion, or execution boundaries were recorded in proposal, design, specs, or tasks before implementation. A material decision found only in session state is missing authority and returns to OpenSpec authoring; the session plan file is never execution authority.
68
+ Read `conditional-checks.md` beside this file only when a task declares `Coupling: required`, a `keel/lenses/` lens matches the change's domain, the change adds or materially expands a dedicated skill, or the work followed an accepted native plan-mode artifact. Each of its sections states the criterion for one of these.
86
69
 
87
70
  ## Output
88
71
 
@@ -0,0 +1,29 @@
1
+ # keel-review-checklist: conditional checks
2
+
3
+ Read the section whose condition holds, as `SKILL.md` lists them. Each states a criterion of the review.
4
+
5
+ ## Coupled execution
6
+
7
+ Applies when a task declares `Coupling: required`.
8
+
9
+ - For `Coupling: required`, confirm one complete candidate reached its completion gate and generated artifacts are aligned.
10
+
11
+ ## Domain lenses
12
+
13
+ When the change's artifacts or Touch extensions signal a domain, consult the matching lens's `Execution and review checks` section from `keel/lenses/` — the lens whose `Applies when:` header matches — before concluding the review. When no lens matches, load nothing.
14
+
15
+ ## Skill change review
16
+
17
+ For a new or materially expanded dedicated skill, confirm the authoring evidence
18
+ identifies authoritative sources, provenance and license implications, realistic
19
+ positive and negative trigger cases, and real-task evidence. Confirm detailed
20
+ conditional knowledge uses progressive references when it is not needed on
21
+ every activation.
22
+
23
+ The canonical portable `SKILL.md` must agree with every declared target
24
+ projection. Target metadata may be additive, but it must not redefine skill
25
+ behavior or make Keel the authority for target-native discovery or activation.
26
+
27
+ ## Planning artifact funnel
28
+
29
+ When the work followed an accepted native plan-mode artifact, confirm its decisions affecting scope, Acceptance, completion, or execution boundaries were recorded in proposal, design, specs, or tasks before implementation. A material decision found only in session state is missing authority and returns to OpenSpec authoring; the session plan file is never execution authority.
@@ -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.187.0"
38
+ PACKAGE_VERSION = "5.189.0"
39
39
 
40
40
 
41
- PROTOCOL_VERSION = "5.187.0"
41
+ PROTOCOL_VERSION = "5.189.0"
42
42
 
43
43
 
44
44
  LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
@@ -213,6 +213,17 @@ SKILL_DOC_REQUIREMENTS = [
213
213
  "behavior evidence",
214
214
  "explicit discard reason",
215
215
  "evidence details",
216
+ "## Conditional checks",
217
+ "conditional-checks.md",
218
+ ],
219
+ },
220
+ {
221
+ # #411: criteria that apply only under a condition, read on demand.
222
+ "name": "review-checklist conditional checks",
223
+ "path": "src/skills/keel-review-checklist/conditional-checks.md",
224
+ "required": [
225
+ "Coupling: required",
226
+ "## Domain lenses",
216
227
  "## Skill change review",
217
228
  "authoritative sources",
218
229
  "provenance and license",
@@ -220,6 +231,7 @@ SKILL_DOC_REQUIREMENTS = [
220
231
  "real-task evidence",
221
232
  "portable `SKILL.md`",
222
233
  "target-native discovery",
234
+ "## Planning artifact funnel",
223
235
  ],
224
236
  },
225
237
  {
@@ -243,6 +255,8 @@ SKILL_DOC_REQUIREMENTS = [
243
255
  "byte-for-byte",
244
256
  "keel context --clear-handoff",
245
257
  "## Standalone use",
258
+ # #411: the override is not the shift note.
259
+ "keel shift ready",
246
260
  ],
247
261
  },
248
262
  {
@@ -693,9 +693,10 @@ def validate_continuation_docs_scenario() -> int:
693
693
 
694
694
 
695
695
  def validate_plan_funnel_guidance_scenario() -> int:
696
+ # The funnel is a conditional check, read on demand since #411.
696
697
  skill_copies = (
697
- ROOT / "src/skills/keel-review-checklist/SKILL.md",
698
- ROOT / PLUGIN_ROOT / "skills/keel-review-checklist/SKILL.md",
698
+ ROOT / "src/skills/keel-review-checklist/conditional-checks.md",
699
+ ROOT / PLUGIN_ROOT / "skills/keel-review-checklist/conditional-checks.md",
699
700
  )
700
701
  for copy in skill_copies:
701
702
  text = copy.read_text(encoding="utf-8")
@@ -1813,3 +1814,53 @@ def validate_external_agents_are_documented_scenario() -> int:
1813
1814
 
1814
1815
  report("external-agents-are-documented scenario passed.")
1815
1816
  return 0
1817
+
1818
+
1819
+ def validate_review_checklist_conditional_checks_scenario() -> int:
1820
+ """Issue #411 rows 7 and 8 (owner, 2026-10-21): a short base checklist, conditions on demand.
1821
+
1822
+ Four review-checklist sections apply only under a condition — a coupled
1823
+ task, a matching lens, a new or expanded skill, a plan-mode artifact — yet
1824
+ every activation read them. They live in `conditional-checks.md`, read
1825
+ when a condition applies. The handoff skill tells its override apart from
1826
+ the shift note, which selects no task.
1827
+ """
1828
+ label = "review-checklist-conditional-checks:"
1829
+ skill_dir = ROOT / "src/skills/keel-review-checklist"
1830
+ base = (skill_dir / "SKILL.md").read_text(encoding="utf-8")
1831
+ conditional_path = skill_dir / "conditional-checks.md"
1832
+ if "conditional-checks.md" not in base:
1833
+ report(f"{label} the review checklist does not name conditional-checks.md.")
1834
+ return 1
1835
+ for condition in ("Coupling: required", "lens", "skill", "plan-mode"):
1836
+ if condition not in base.split("## Conditional checks", 1)[-1]:
1837
+ report(f"{label} the checklist's conditional-checks section does not name the {condition!r} condition.")
1838
+ return 1
1839
+ for moved in ("## Skill change review", "## Planning artifact funnel"):
1840
+ if moved in base:
1841
+ report(f"{label} the base checklist still holds {moved!r}, which applies only under a condition.")
1842
+ return 1
1843
+ lines = len(base.splitlines())
1844
+ if lines >= 80:
1845
+ report(f"{label} the base checklist is {lines} lines, not under 80.")
1846
+ return 1
1847
+ if not conditional_path.is_file():
1848
+ report(f"{label} conditional-checks.md is missing beside the checklist.")
1849
+ return 1
1850
+ conditional = conditional_path.read_text(encoding="utf-8")
1851
+ for needle in ("## Skill change review", "## Planning artifact funnel", "Coupling: required", "Execution and review checks"):
1852
+ if needle not in conditional:
1853
+ report(f"{label} conditional-checks.md does not hold {needle!r}.")
1854
+ return 1
1855
+ handoff = (ROOT / "src/skills/keel-handoff/SKILL.md").read_text(encoding="utf-8")
1856
+ if "keel shift ready" not in handoff:
1857
+ report(f"{label} the handoff skill does not name the shift note's `keel shift ready`.")
1858
+ return 1
1859
+ if "selects no task" not in handoff:
1860
+ report(f"{label} the handoff skill does not say the shift note selects no task.")
1861
+ return 1
1862
+ if label.rstrip(":") not in {name for name, _ in registry.SCENARIOS}:
1863
+ report(f"{label} the scenario registry does not include it.")
1864
+ return 1
1865
+ report(f"{label.rstrip(':')} scenario passed: the base checklist is {lines} lines.")
1866
+ return 0
@@ -6,8 +6,8 @@ directory, a hook payload — and none of it against a real one. Every
6
6
  registered scenario is classified as deterministic or stand-in host, from
7
7
  markers derived from Keel's own sources, through the validation helpers and
8
8
  scripts it reaches. The classification is static and over-approximates: a
9
- scenario that only mentions a marker counts as stand-in host, which claims
10
- less real evidence, never more.
9
+ scenario that sets a marker counts as stand-in host even when the value is
10
+ never used, which claims less real evidence, never more.
11
11
  """
12
12
  from __future__ import annotations
13
13
 
@@ -76,16 +76,25 @@ def reached_text(function: str, found: dict[str, tuple[set[str], str]]) -> tuple
76
76
  return text, seen
77
77
 
78
78
 
79
+ def sets(mark: str) -> re.Pattern:
80
+ """Where code sets a marker rather than names it: a dict key, an item
81
+ assignment, `NAME=` in shell or keyword form, or an attribute assignment.
82
+ Naming a variable to remove or read it is not a stand-in (5.188.0)."""
83
+ name = re.escape(mark)
84
+ return re.compile(r"[\"']" + name + r"[\"']\s*:|\[\s*[\"']" + name + r"[\"']\s*\]\s*=|\b" + name + r"=|\." + name + r"\s*=")
85
+
86
+
79
87
  def classify(scenarios) -> dict:
80
88
  """{"markers", "stand-in host", "deterministic", "can skip"} for the registered scenarios, in registry order."""
81
89
  marks = markers()
90
+ setters = [sets(mark) for mark in marks]
82
91
  found = definitions()
83
92
  standin, deterministic, skippable = [], [], []
84
93
  for name, function in scenarios:
85
94
  defined = getattr(function, "__name__", None)
86
95
  text, seen = reached_text(defined, found) if defined in found else ("", set())
87
96
  # A scenario whose code cannot be read cannot be shown deterministic.
88
- if defined not in found or any(mark in text for mark in marks) or SHADOWED_PROGRAM.search(text):
97
+ if defined not in found or any(setter.search(text) for setter in setters) or SHADOWED_PROGRAM.search(text):
89
98
  standin.append(name)
90
99
  else:
91
100
  deterministic.append(name)
@@ -859,37 +859,27 @@ def validate_native_plugin_manifests_scenario() -> int:
859
859
  )
860
860
  return 1
861
861
  for skill_name in PLUGIN_SKILLS:
862
- plugin_skill = skills_root / skill_name / "SKILL.md"
863
- canonical_skill = ROOT / "src/skills" / skill_name / "SKILL.md"
864
- if plugin_skill.read_text(encoding="utf-8") != canonical_skill.read_text(
865
- encoding="utf-8"
866
- ):
862
+ # Every file a skill's body may name travels with it — `guidance.md`,
863
+ # `conditional-checks.md`, whatever is split out next (#411). The host
864
+ # reads the plugin copy directly, so a file the parity check ignored
865
+ # could drift from the criteria it was split out of, invisibly.
866
+ canonical_dir = ROOT / "src/skills" / skill_name
867
+ plugin_dir = skills_root / skill_name
868
+ canonical_files = sorted(p.relative_to(canonical_dir).as_posix() for p in canonical_dir.rglob("*") if p.is_file())
869
+ plugin_files = sorted(p.relative_to(plugin_dir).as_posix() for p in plugin_dir.rglob("*") if p.is_file())
870
+ for missing in sorted(set(canonical_files) - set(plugin_files)):
867
871
  report(
868
- "native-plugin-manifests plugin skill diverges from canonical "
869
- f"source: {skill_name}"
872
+ f"native-plugin-manifests plugin copy of {skill_name} lacks {missing}, "
873
+ "so a reference to it resolves to nothing"
870
874
  )
871
875
  return 1
872
- # A referenced `guidance.md` travels with the body that names it. The
873
- # host reads the plugin copy directly, so a guidance file the parity
874
- # check ignored could drift from the criteria it was split out of, and
875
- # the drift would be invisible to everything except a reader.
876
- canonical_guidance = canonical_skill.parent / "guidance.md"
877
- plugin_guidance = plugin_skill.parent / "guidance.md"
878
- if canonical_guidance.is_file() and not plugin_guidance.is_file():
879
- report(
880
- "native-plugin-manifests guidance file diverges from canonical "
881
- f"source: {skill_name} has guidance.md that the plugin does not "
882
- "ship, so the body's reference resolves to nothing"
883
- )
884
- return 1
885
- if canonical_guidance.is_file() and plugin_guidance.read_text(
886
- encoding="utf-8"
887
- ) != canonical_guidance.read_text(encoding="utf-8"):
888
- report(
889
- "native-plugin-manifests guidance file diverges from canonical "
890
- f"source: {skill_name}"
891
- )
876
+ for extra in sorted(set(plugin_files) - set(canonical_files)):
877
+ report(f"native-plugin-manifests plugin copy of {skill_name} has {extra}, which the source does not")
892
878
  return 1
879
+ for name in canonical_files:
880
+ if (plugin_dir / name).read_bytes() != (canonical_dir / name).read_bytes():
881
+ report(f"native-plugin-manifests plugin copy diverges from canonical source: {skill_name}/{name}")
882
+ return 1
893
883
  lenses_root = ROOT / "assets/lenses"
894
884
  for template in ("web.md", "hardware.md", "hardware-dsl.md"):
895
885
  if not (lenses_root / template).is_file():
@@ -3173,6 +3173,10 @@ def validate_domain_execution_references_scenario() -> int:
3173
3173
  for root in roots:
3174
3174
  for skill in consuming_skills:
3175
3175
  text = (root / skill / "SKILL.md").read_text(encoding="utf-8")
3176
+ # A skill may keep the step among its conditional checks (#411).
3177
+ conditional = root / skill / "conditional-checks.md"
3178
+ if conditional.is_file():
3179
+ text += "\n" + conditional.read_text(encoding="utf-8")
3176
3180
  for needle in (
3177
3181
  "keel/lenses/",
3178
3182
  "Execution and review checks",
@@ -511,6 +511,7 @@ SCENARIOS: tuple = (
511
511
  ("domain-lens-scaffold", install.validate_domain_lens_scaffold_scenario),
512
512
  ("domain-lens-doctor", install.validate_domain_lens_doctor_scenario),
513
513
  ("plan-funnel-guidance", docs.validate_plan_funnel_guidance_scenario),
514
+ ("review-checklist-conditional-checks", docs.validate_review_checklist_conditional_checks_scenario),
514
515
  (
515
516
  "declared-paths-are-read-whole",
516
517
  contract.validate_declared_paths_are_read_whole_scenario,
@@ -1497,6 +1497,11 @@ def validate_release_evidence_classes_scenario() -> int:
1497
1497
  if "version-alignment" not in deterministic:
1498
1498
  report(f"{label} version-alignment is not counted as deterministic.")
1499
1499
  return 1
1500
+ # chat-core reaches the host's variables only through chat_environment,
1501
+ # which names them to remove them: a mention is not a stand-in (5.188.0).
1502
+ if "chat-core" not in deterministic:
1503
+ report(f"{label} chat-core is counted as run against a stand-in host for removing host variables.")
1504
+ return 1
1500
1505
  registered = {name for name, _ in registry.SCENARIOS}
1501
1506
  if standin & deterministic:
1502
1507
  report(f"{label} scenarios are counted in both classes: {sorted(standin & deterministic)!r}")