@christang/keel 5.209.0 → 5.211.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.209.0",
3
+ "version": "5.211.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",
package/README.md CHANGED
@@ -1003,6 +1003,11 @@ owner_language: zh
1003
1003
 
1004
1004
  ## Commands
1005
1005
 
1006
+ `keel/HANDOFF.md`, when present, overrides which task `keel context` selects. It is YAML front matter
1007
+ and nothing else: `schema: keel-handoff/v1`, `owner` (a pointer into `openspec/changes/<change>/`),
1008
+ `action` (`discuss`, `author`, `task-start`, `task-complete`, or `change-close`), and `reason`.
1009
+ `keel context` validates it and `keel context --clear-handoff` removes it.
1010
+
1006
1011
  ```bash
1007
1012
  # Continuity — recompute what to do (stateless)
1008
1013
  keel context [--json] [--change <c> --task <t>]
package/README.zh-CN.md CHANGED
@@ -836,6 +836,10 @@ owner_language: zh
836
836
 
837
837
  ## 命令参考
838
838
 
839
+ `keel/HANDOFF.md` 存在时,会覆盖 `keel context` 选中的任务。它只有 YAML front matter:`schema: keel-handoff/v1`、
840
+ `owner`(指向 `openspec/changes/<change>/` 下的文件)、`action`(`discuss`、`author`、`task-start`、`task-complete`
841
+ 或 `change-close`)和 `reason`。`keel context` 会校验它,`keel context --clear-handoff` 删除它。
842
+
839
843
  ```bash
840
844
  # 连续性 —— 无状态重算「现在该做什么」
841
845
  keel context [--json] [--change <c> --task <t>]
@@ -1,4 +1,4 @@
1
- <!-- keel:start version=5.209.0 -->
1
+ <!-- keel:start version=5.211.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
@@ -51,7 +51,6 @@ const VALID_TARGETS = new Set(["claude", "codex", "opencode", "both"]);
51
51
  const KEEL_SKILLS = [
52
52
  "align-expectations",
53
53
  "debug-failure",
54
- "handoff",
55
54
  "review-checklist",
56
55
  "tdd-or-test-first",
57
56
  ];
@@ -123,7 +122,10 @@ Defaults:
123
122
 
124
123
  Project layout:
125
124
  continuity is recomputed from OpenSpec on every invocation.
126
- keel/HANDOFF.md is an optional keel-handoff/v1 pointer override.
125
+ keel/HANDOFF.md is an optional pointer override: YAML front matter holding
126
+ schema: keel-handoff/v1, owner (a pointer into openspec/changes/<change>/),
127
+ action (discuss, author, task-start, task-complete, or change-close), and
128
+ reason, and no other field. keel context --clear-handoff removes it.
127
129
  keel-* behavioral skills are delivered by the installed Keel plugin, not by the CLI.
128
130
  repeat keel --install to refresh project protocol files.
129
131
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@christang/keel",
3
- "version": "5.209.0",
3
+ "version": "5.211.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@christang/keel",
9
- "version": "5.209.0",
9
+ "version": "5.211.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.209.0",
5
+ "version": "5.211.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.209.0",
3
+ "version": "5.211.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.209.0",
3
+ "version": "5.211.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",
@@ -19,7 +19,7 @@
19
19
  "interface": {
20
20
  "displayName": "Keel",
21
21
  "shortDescription": "OpenSpec execution discipline for coding agents",
22
- "longDescription": "Keel packages reusable OpenSpec authoring and execution skills: expectation alignment before specs and tasks finalize, task-capsule discipline, deterministic gate usage, review, debugging, and handoff hygiene. The separately installed keel CLI owns context, gates, schema, and overlays.",
22
+ "longDescription": "Keel packages reusable OpenSpec authoring and execution skills: expectation alignment before specs and tasks finalize, task-capsule discipline, deterministic gate usage, review, and debugging. The separately installed keel CLI owns context, gates, schema, and overlays.",
23
23
  "developerName": "TanglmChris",
24
24
  "category": "Productivity",
25
25
  "capabilities": [
@@ -180,6 +180,9 @@ function repoRelative(repo, target) {
180
180
  // check standing: a broken declaration fails toward more checking (D3).
181
181
 
182
182
  const EXPLICIT_FORM = "`git push origin <branch>`";
183
+ // A push after `cd` may run in another repository than the one whose config
184
+ // is read, so the form to use names the directory instead (#486).
185
+ const DIRECTORY_FORM = "`git -C <directory> push <remote> <branch>`";
183
186
 
184
187
  function gitOut(cwd, args) {
185
188
  const result = spawnSync("git", ["-C", cwd, ...args], { encoding: "utf8", timeout: 3000 });
@@ -460,9 +463,13 @@ function pushDestination(dir) {
460
463
  return remote ? rest.slice(remote.length + 1) : null;
461
464
  }
462
465
 
463
- // Target branches of one push, or { undetermined: reason }.
466
+ // Target branches of one push, or { undetermined: reason[, form] }.
464
467
  function pushTargets(push) {
465
468
  if (push.undetermined) return push;
469
+ // Whatever the refspec, the repository it pushes is unknown here (#486 D1).
470
+ if (push.cdBefore) {
471
+ return { undetermined: "a `cd` or `pushd` runs before this `git push`, so the repository it pushes is unknown here", form: DIRECTORY_FORM };
472
+ }
466
473
  const positionals = [];
467
474
  let deleting = false;
468
475
  let followTags = null;
@@ -506,13 +513,7 @@ function pushTargets(push) {
506
513
  tags = "`push.followTags`";
507
514
  }
508
515
  const refspecs = positionals.slice(1);
509
- const needsCurrent = () => {
510
- if (push.cdBefore) return { undetermined: "the directory changes before it, so its branch is unknown here" };
511
- return null;
512
- };
513
516
  if (!refspecs.length) {
514
- const unknown = needsCurrent();
515
- if (unknown) return unknown;
516
517
  const branch = pushDestination(push.dir);
517
518
  return branch ? { targets: [branch], tags } : { undetermined: "the branch has no configured push destination" };
518
519
  }
@@ -524,8 +525,6 @@ function pushTargets(push) {
524
525
  else if (spec.startsWith(":")) dst = spec.slice(1);
525
526
  if (!dst) return { undetermined: `\`${raw}\` names no destination` };
526
527
  if (dst === "HEAD" || dst === "@") {
527
- const unknown = needsCurrent();
528
- if (unknown) return unknown;
529
528
  dst = currentBranch(push.dir);
530
529
  if (!dst) return { undetermined: "HEAD is detached" };
531
530
  }
@@ -553,6 +552,14 @@ function checkPushes(event) {
553
552
  ...protectedEntries.map((e) => `\`push-protected:${e.glob}${e.role ? `@${e.role}` : ""}\``),
554
553
  ].join(", ");
555
554
  const result = pushTargets(push);
555
+ if (result.form) {
556
+ // Which repository it pushes is the unknown, not its branch (#486 D2).
557
+ deny(
558
+ `Keel push guard: ${result.undetermined}, so this repository's push rules in keel/config.yaml `
559
+ + `cannot be applied to it. Push without changing directory, as ${result.form}.`
560
+ );
561
+ return 0;
562
+ }
556
563
  if (result.undetermined) {
557
564
  deny(
558
565
  `Keel push guard: keel/config.yaml limits push to ${declared}, and the `
@@ -52,7 +52,6 @@ REQUIRED_SCRIPTS = [
52
52
  CORE_KEEL_SKILLS = {
53
53
  "align-expectations",
54
54
  "debug-failure",
55
- "handoff",
56
55
  "review-checklist",
57
56
  "tdd-or-test-first",
58
57
  }
@@ -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.209.0"
38
+ PACKAGE_VERSION = "5.211.0"
39
39
 
40
40
 
41
- PROTOCOL_VERSION = "5.209.0"
41
+ PROTOCOL_VERSION = "5.211.0"
42
42
 
43
43
 
44
44
  LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
@@ -234,31 +234,6 @@ SKILL_DOC_REQUIREMENTS = [
234
234
  "## Planning artifact funnel",
235
235
  ],
236
236
  },
237
- {
238
- "name": "handoff skill",
239
- "path": "src/skills/handoff/SKILL.md",
240
- "required": [
241
- "Lite mode does not create HANDOFF",
242
- "not a durable follow-up owner",
243
- "## Context to read",
244
- "openspec/changes",
245
- "discard reason",
246
- "keel-handoff/v1",
247
- "schema",
248
- "owner",
249
- "action",
250
- "reason",
251
- "`active-backlog`",
252
- "`head=...`",
253
- "expectation state",
254
- "evidence details",
255
- "byte-for-byte",
256
- "keel context --clear-handoff",
257
- "## Standalone use",
258
- # #411: the override is not the shift note.
259
- "keel shift ready",
260
- ],
261
- },
262
237
  {
263
238
  # Contract anchors traceable to keel-expectation-alignment; the
264
239
  # expectation-alignment-skill scenario owns the full structural and
@@ -1229,11 +1229,12 @@ def validate_expectation_completion_gates_scenario() -> int:
1229
1229
  "- Findings:",
1230
1230
  "Discard rationale:",
1231
1231
  ]
1232
+ # The handoff skill is retired (#485); `keel --help` carries the format.
1232
1233
  handoff_skill_snippets = [
1233
- "keel-handoff/v1",
1234
- "expectation state",
1235
- "evidence details",
1236
- "durable OpenSpec",
1234
+ "schema: keel-handoff/v1",
1235
+ "owner (a pointer into openspec/changes/",
1236
+ "change-close",
1237
+ "no other field",
1237
1238
  ]
1238
1239
  handoff_template_snippets = [
1239
1240
  "schema: keel-handoff/v1",
@@ -1267,7 +1268,7 @@ def validate_expectation_completion_gates_scenario() -> int:
1267
1268
  ROOT / "assets/openspec/schemas/keel-spec-driven/templates/tasks.md",
1268
1269
  task_template_review_snippets,
1269
1270
  ),
1270
- ("source handoff skill", ROOT / "src/skills/handoff/SKILL.md", handoff_skill_snippets),
1271
+ ("keel --help HANDOFF format", ROOT / "bin/keel.js", handoff_skill_snippets),
1271
1272
  ("OpenSpec archive overlay generator", ROOT / "bin/keel.js", archive_overlay_snippets),
1272
1273
  ]
1273
1274
 
@@ -1818,14 +1818,44 @@ def validate_external_agents_are_documented_scenario() -> int:
1818
1818
  return 0
1819
1819
 
1820
1820
 
1821
+ def validate_handoff_format_in_help_scenario() -> int:
1822
+ """Issue #485: the HANDOFF format stays documented once the handoff skill is gone.
1823
+
1824
+ The skill was the only user-facing place that listed the four fields and
1825
+ the five actions; `keel --help` and both READMEs now carry them.
1826
+ """
1827
+ label = "handoff-format-in-help:"
1828
+ actions = ("discuss", "author", "task-start", "task-complete", "change-close")
1829
+ helped = run_keel(ROOT, "--help")
1830
+ if helped.returncode != 0:
1831
+ report(f"{label} keel --help exited {helped.returncode}: {helped.stderr!r}")
1832
+ return 1
1833
+ layout = helped.stdout.split("Project layout:", 1)[-1].split("Examples:", 1)[0]
1834
+ for needle in ("keel-handoff/v1", "owner", "action", "reason", *actions):
1835
+ if needle not in layout:
1836
+ report(f"{label} keel --help's Project layout does not name {needle!r}: {layout!r}")
1837
+ return 1
1838
+ for readme in ("README.md", "README.zh-CN.md"):
1839
+ text = (ROOT / readme).read_text(encoding="utf-8")
1840
+ for needle in ("keel-handoff/v1", *actions):
1841
+ if needle not in text:
1842
+ report(f"{label} {readme} does not name {needle!r}.")
1843
+ return 1
1844
+ if label.rstrip(":") not in {name for name, _ in registry.SCENARIOS}:
1845
+ report(f"{label} the scenario registry does not include it.")
1846
+ return 1
1847
+ report(f"{label.rstrip(':')} scenario passed.")
1848
+ return 0
1849
+
1850
+
1821
1851
  def validate_review_checklist_conditional_checks_scenario() -> int:
1822
1852
  """Issue #411 rows 7 and 8 (owner, 2026-10-21): a short base checklist, conditions on demand.
1823
1853
 
1824
1854
  Four review-checklist sections apply only under a condition — a coupled
1825
1855
  task, a matching lens, a new or expanded skill, a plan-mode artifact — yet
1826
1856
  every activation read them. They live in `conditional-checks.md`, read
1827
- when a condition applies. The handoff skill tells its override apart from
1828
- the shift note, which selects no task.
1857
+ when a condition applies. `docs/shift-change.md` tells the shift note apart
1858
+ from the HANDOFF override, which `keel context` reads (#485).
1829
1859
  """
1830
1860
  label = "review-checklist-conditional-checks:"
1831
1861
  skill_dir = ROOT / "src/skills/review-checklist"
@@ -1854,12 +1884,13 @@ def validate_review_checklist_conditional_checks_scenario() -> int:
1854
1884
  if needle not in conditional:
1855
1885
  report(f"{label} conditional-checks.md does not hold {needle!r}.")
1856
1886
  return 1
1857
- handoff = (ROOT / "src/skills/handoff/SKILL.md").read_text(encoding="utf-8")
1858
- if "keel shift ready" not in handoff:
1859
- report(f"{label} the handoff skill does not name the shift note's `keel shift ready`.")
1887
+ # The handoff skill is retired (#485); the shift-change guide tells the two apart.
1888
+ shift_doc = (ROOT / "docs/shift-change.md").read_text(encoding="utf-8")
1889
+ if "It is not `keel/HANDOFF.md` either" not in shift_doc:
1890
+ report(f"{label} docs/shift-change.md does not say the shift note is not `keel/HANDOFF.md`.")
1860
1891
  return 1
1861
- if "selects no task" not in handoff:
1862
- report(f"{label} the handoff skill does not say the shift note selects no task.")
1892
+ if "`keel context` does not read it" not in shift_doc:
1893
+ report(f"{label} docs/shift-change.md does not say `keel context` does not read the shift note.")
1863
1894
  return 1
1864
1895
  if label.rstrip(":") not in {name for name, _ in registry.SCENARIOS}:
1865
1896
  report(f"{label} the scenario registry does not include it.")
@@ -3903,6 +3903,61 @@ def validate_push_branch_guard_scenario() -> int:
3903
3903
  return 0
3904
3904
 
3905
3905
 
3906
+ def validate_push_guard_cd_before_push_scenario() -> int:
3907
+ """Issue #486: a `cd` before a push leaves its repository unknown, whatever the refspec.
3908
+
3909
+ The guard reads the push scope of the session's repository. kaiwu-layout's
3910
+ `cd <export dir> && git push <url> main:main` was judged by kaiwu-ip's
3911
+ `push-protected:main@kaiwu-chief`, though it pushed another repository.
3912
+ The refusal now names `git -C <directory> push`, which is judged by the
3913
+ repository it names.
3914
+ """
3915
+ label = "push-guard-cd-before-push:"
3916
+ with tempfile.TemporaryDirectory(prefix="keel-push-cd-486-") as raw:
3917
+ base = Path(raw)
3918
+ repo = base / "repo"
3919
+ other = base / "export"
3920
+
3921
+ def git(*args: str, cwd: Path) -> None:
3922
+ subprocess.run(["git", *args], cwd=cwd, check=True, capture_output=True, text=True)
3923
+
3924
+ for tree in (repo, other):
3925
+ git("init", "-q", "-b", "main", str(tree), cwd=base)
3926
+ git("-c", "user.name=t", "-c", "user.email=t@t", "commit", "-q", "--allow-empty", "-m", "init", cwd=tree)
3927
+ (repo / "sub").mkdir()
3928
+ write_authorize_config(repo, "authorize:\n - push:claude/*\n - push-protected:main@chief\n")
3929
+
3930
+ def decide(command: str) -> dict | None:
3931
+ event = {"tool_name": "Bash", "tool_input": {"command": command}, "cwd": str(repo)}
3932
+ return pretooluse_decision(run_pretooluse_guard_hook(repo, event))
3933
+
3934
+ url = "https://example.invalid/acme/export.git"
3935
+ for what, command in (
3936
+ ("a push in another repository after cd", f"cd {other} && git push {url} main:main"),
3937
+ ("a push to a declared branch after cd", "cd sub && git push origin claude/fix"),
3938
+ ):
3939
+ decision = decide(command)
3940
+ if not decision or decision.get("permissionDecision") != "deny":
3941
+ report(f"{label} {what} ({command!r}) was not denied: {decision!r}")
3942
+ return 1
3943
+ reason = decision.get("permissionDecisionReason", "")
3944
+ if "git -C <directory> push" not in reason:
3945
+ report(f"{label} {what} was denied without naming `git -C <directory> push`: {reason!r}")
3946
+ return 1
3947
+ if "chief" in reason:
3948
+ report(f"{label} {what} was judged by the session repository's protected branch: {reason!r}")
3949
+ return 1
3950
+ decision = decide(f"git -C {other} push {url} main:main")
3951
+ if decision is not None:
3952
+ report(f"{label} `git -C` into a repository that declares nothing got a decision: {decision!r}")
3953
+ return 1
3954
+ if label.rstrip(":") not in {name for name, _ in registry.SCENARIOS}:
3955
+ report(f"{label} the scenario registry does not include it.")
3956
+ return 1
3957
+ report(f"{label.rstrip(':')} scenario passed.")
3958
+ return 0
3959
+
3960
+
3906
3961
  def validate_authorize_role_scoped_scenario() -> int:
3907
3962
  """Issue #378: a scoped grant may name the roles it applies to.
3908
3963
 
@@ -796,13 +796,12 @@ def validate_runtime_versions_are_checked_scenario() -> int:
796
796
  PLUGIN_SKILLS = (
797
797
  "align-expectations",
798
798
  "debug-failure",
799
- "handoff",
800
799
  "review-checklist",
801
800
  "tdd-or-test-first",
802
801
  )
803
802
 
804
803
 
805
- SLASH_SKILLS = ("align-expectations", "debug-failure", "handoff", "review-checklist", "tdd-or-test-first")
804
+ SLASH_SKILLS = ("align-expectations", "debug-failure", "review-checklist", "tdd-or-test-first")
806
805
  MODEL_ONLY_SKILLS = ("debug-failure", "review-checklist", "tdd-or-test-first")
807
806
 
808
807
 
@@ -851,7 +850,7 @@ def validate_slash_menu_ships_scenario() -> int:
851
850
  # archived evidence file keeps its name (`…-v1.md`), as does the
852
851
  # `keel-handoff/v1` format.
853
852
  prefix = "keel" + "-"
854
- old = re.compile(re.escape(prefix) + r"(?:" + "|".join(re.escape(n) for n in SLASH_SKILLS if n != "handoff") + r")\b(?!-v\d)|"
853
+ old = re.compile(re.escape(prefix) + r"(?:" + "|".join(re.escape(n) for n in SLASH_SKILLS) + r")\b(?!-v\d)|"
855
854
  + re.escape(prefix) + r"handoff(?!/v1)(?!-)")
856
855
  tracked = subprocess.run(["git", "ls-files", "-z"], cwd=ROOT, text=True, capture_output=True, check=True).stdout.split("\0")
857
856
  stale = []
@@ -886,10 +885,16 @@ def validate_slash_menu_ships_scenario() -> int:
886
885
  if not path.is_file():
887
886
  report(f"{label} {doc} does not exist.")
888
887
  return 1
889
- missing = [name for name in invocable if f"/keel:{name}" not in path.read_text(encoding="utf-8")]
888
+ text = path.read_text(encoding="utf-8")
889
+ missing = [name for name in invocable if f"/keel:{name}" not in text]
890
890
  if missing:
891
891
  report(f"{label} {doc} does not list {', '.join(f'/keel:{name}' for name in missing)}.")
892
892
  return 1
893
+ # A retired entry, such as `/keel:handoff` (#485), is not listed.
894
+ extra = sorted(set(re.findall(r"/keel:([a-z][a-z-]*)", text)) - set(invocable))
895
+ if extra:
896
+ report(f"{label} {doc} lists {', '.join(f'/keel:{name}' for name in extra)}, which a person cannot invoke.")
897
+ return 1
893
898
  claude = shutil.which("claude")
894
899
  if claude:
895
900
  validated = subprocess.run([claude, "plugin", "validate", str(ROOT / PLUGIN_ROOT)], text=True, capture_output=True, timeout=120)
@@ -504,6 +504,7 @@ SCENARIOS: tuple = (
504
504
  ("native-plugin-install-matrix", hosts.validate_native_plugin_install_matrix_scenario),
505
505
  ("touch-write-guard", guard.validate_touch_write_guard_scenario),
506
506
  ("push-branch-guard", guard.validate_push_branch_guard_scenario),
507
+ ("push-guard-cd-before-push", guard.validate_push_guard_cd_before_push_scenario),
507
508
  ("push-guard-redirects", guard.validate_push_guard_redirects_scenario),
508
509
  ("push-guard-follow-tags", guard.validate_push_guard_follow_tags_scenario),
509
510
  ("push-protected-guard", guard.validate_push_protected_guard_scenario),
@@ -545,6 +546,7 @@ SCENARIOS: tuple = (
545
546
  ("domain-lens-doctor", install.validate_domain_lens_doctor_scenario),
546
547
  ("plan-funnel-guidance", docs.validate_plan_funnel_guidance_scenario),
547
548
  ("review-checklist-conditional-checks", docs.validate_review_checklist_conditional_checks_scenario),
549
+ ("handoff-format-in-help", docs.validate_handoff_format_in_help_scenario),
548
550
  (
549
551
  "declared-paths-are-read-whole",
550
552
  contract.validate_declared_paths_are_read_whole_scenario,
@@ -1,48 +0,0 @@
1
- ---
2
- name: handoff
3
- description: Create, validate, or clear the optional keel-handoff/v1 pointer override when human intent cannot be inferred uniquely.
4
- argument-hint: "[create | validate | clear]"
5
- ---
6
-
7
- # handoff
8
-
9
- ## Purpose
10
-
11
- 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.
12
-
13
- 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.
14
-
15
- ## Context to read
16
-
17
- Run `keel context --json`, then read the returned paths and the intended durable OpenSpec owner under `openspec/changes/<change>/`.
18
-
19
- ## Override contract
20
-
21
- Write `keel/HANDOFF.md` with YAML front matter only:
22
-
23
- ```yaml
24
- ---
25
- schema: keel-handoff/v1
26
- owner: openspec/changes/<change>/tasks.md#<task>
27
- action: task-start
28
- reason: Concise reason automatic inference is insufficient
29
- ---
30
- ```
31
-
32
- The only fields are `schema`, `owner`, `action`, and `reason`. The owner must be a durable OpenSpec proposal, design, or tasks pointer. Supported actions are `discuss`, `author`, `task-start`, `task-complete`, and `change-close`.
33
-
34
- Never copy task progress, expectation state, evidence details, risks, conversation summaries, `active-backlog`, or `head=...`. Those belong to OpenSpec, archive evidence, or an explicit discard reason.
35
-
36
- ## Legacy and clearing
37
-
38
- Do not rewrite a pre-v1 HANDOFF heuristically. Preserve it byte-for-byte and report the explicit choices: migrate it manually to the v1 contract or run `keel context --clear-handoff`.
39
-
40
- Clearing removes only the override; it does not modify the durable owner. Run `keel context --clear-handoff --json`, then verify normal inference resumes.
41
-
42
- ## Lite boundary
43
-
44
- Lite mode does not create HANDOFF for routine cross-session continuity. Use the same optional override contract only when explicit human intent must supersede inference.
45
-
46
- ## Standalone use
47
-
48
- Validate the intended owner first, write or clear only the override, run `keel context --json`, and report the resulting source and next action.