@christang/keel 5.136.0 → 5.136.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,4 +1,4 @@
1
- <!-- keel:start version=5.136.0 -->
1
+ <!-- keel:start version=5.136.1 -->
2
2
  ## Keel Bootstrap
3
3
 
4
4
  - Start every session with `keel context`; OpenSpec artifacts and Git are the only durable authority — never native memory, goals, or transcripts.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@christang/keel",
3
- "version": "5.136.0",
3
+ "version": "5.136.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@christang/keel",
9
- "version": "5.136.0",
9
+ "version": "5.136.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.136.0",
5
+ "version": "5.136.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.136.0",
3
+ "version": "5.136.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.136.0",
3
+ "version": "5.136.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",
@@ -47,8 +47,8 @@ REQUIRED_SCRIPTS = [
47
47
  "scripts/validate_plugin.py",
48
48
  ]
49
49
 
50
- PACKAGE_VERSION = "5.136.0"
51
- PROTOCOL_VERSION = "5.136.0"
50
+ PACKAGE_VERSION = "5.136.1"
51
+ PROTOCOL_VERSION = "5.136.1"
52
52
  LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
53
53
  OPENSPEC_SCHEMA_NAME = "keel-spec-driven"
54
54
  # Mirrors KEEL_PACKAGE_NAME in scripts/install_to_repo.py, one of the two
@@ -6965,6 +6965,57 @@ def validate_shift_await_clear_scenario() -> int:
6965
6965
  return 0
6966
6966
 
6967
6967
 
6968
+ def validate_shift_start_desktop_scenario() -> int:
6969
+ """`keel shift start` names the wake step for a note written on the desktop app.
6970
+
6971
+ A desktop session with no running process sees no chat record, so the
6972
+ start record alone wakes nobody there (#320, D1 of
6973
+ shift-start-desktop-wake). Elsewhere the output is unchanged.
6974
+ """
6975
+ label = "shift-start-desktop:"
6976
+ with tempfile.TemporaryDirectory(prefix="keel-shift-start-desktop-") as raw:
6977
+ base = Path(raw)
6978
+ rtl, verify, env, _ = shift_scratch(base)
6979
+ desktop = {**env, "CLAUDE_CODE_ENTRYPOINT": "claude-desktop", "CLAUDE_CODE_HOST_SESSION_ID": "local_test-320", "KEEL_SHIFT_DESKTOP_PID": "4242"}
6980
+ ready = run_keel(verify, "shift", "ready", "verify note: next is R030", env=desktop)
6981
+ if ready.returncode != 0:
6982
+ report(f"{label} ready on the desktop app failed: {ready.stderr.strip()}")
6983
+ return 1
6984
+ started = run_keel(rtl, "shift", "start", "verify", env=env)
6985
+ if started.returncode != 0:
6986
+ report(f"{label} start failed: {started.stderr.strip()}")
6987
+ return 1
6988
+ read = run_keel(verify, "chat", "read", "dm-rtl--verify", env=env)
6989
+ if "keel shift resume" not in read.stdout:
6990
+ report(f"{label} the start record did not reach dm-rtl--verify: {read.stdout.strip()} {read.stderr.strip()}")
6991
+ return 1
6992
+ for needle in ("send_message", "get_session", "unarchive_session", "local_test-320", "keel shift resume"):
6993
+ if needle not in started.stdout:
6994
+ report(f"{label} start for a desktop note does not name {needle}: {started.stdout.strip()}")
6995
+ return 1
6996
+ if "Woke" in started.stdout:
6997
+ report(f"{label} start for a desktop note still says it woke the role: {started.stdout.strip()}")
6998
+ return 1
6999
+ run_keel(verify, "shift", "resume", env=env)
7000
+ plain = run_keel(verify, "shift", "ready", "verify note: next is R031", env=env)
7001
+ if plain.returncode != 0:
7002
+ report(f"{label} ready outside the desktop app failed: {plain.stderr.strip()}")
7003
+ return 1
7004
+ other = run_keel(rtl, "shift", "start", "verify", env=env)
7005
+ if "Woke verify" not in other.stdout or "send_message" in other.stdout:
7006
+ report(f"{label} start for a note with no desktop session changed: {other.stdout.strip()}")
7007
+ return 1
7008
+ for relative, word in (("docs/shift-change.md", "#320"), ("docs/shift-change.zh-CN.md", "#320")):
7009
+ if word not in (ROOT / relative).read_text(encoding="utf-8"):
7010
+ report(f"{label} {relative} does not mention {word}.")
7011
+ return 1
7012
+ if "shift-start-desktop" not in {name for name, _ in SCENARIOS}:
7013
+ report(f"{label} scenario is not registered.")
7014
+ return 1
7015
+ report("shift-start-desktop scenario passed.")
7016
+ return 0
7017
+
7018
+
6968
7019
  def validate_shift_desktop_wake_overdue_scenario() -> int:
6969
7020
  """`keel shift status` flags a desktop note whose wake is overdue.
6970
7021
 
@@ -40697,6 +40748,7 @@ SCENARIOS: tuple = (
40697
40748
  ("shift-without-role", validate_shift_without_role_scenario),
40698
40749
  ("shift-desktop-wake", validate_shift_desktop_wake_scenario),
40699
40750
  ("shift-desktop-wake-overdue", validate_shift_desktop_wake_overdue_scenario),
40751
+ ("shift-start-desktop", validate_shift_start_desktop_scenario),
40700
40752
  ("shift-await-clear", validate_shift_await_clear_scenario),
40701
40753
  ("shift-restore-authorization", validate_shift_restore_authorization_scenario),
40702
40754
  ("self-shift-authorization", validate_self_shift_authorization_scenario),
package/src/core/shift.js CHANGED
@@ -557,7 +557,10 @@ function start(where, role, text) {
557
557
  `${role}: your new shift starts now. First run \`keel context\`, then \`keel shift resume\` to read the note your previous shift left, then continue from it.`,
558
558
  text ? `Next: ${text}` : "",
559
559
  ].filter(Boolean).join("\n");
560
- return store.post(where, { group, text: body, refs: [REF] });
560
+ // A note written on the Claude desktop app names its session: there a
561
+ // session with no running process sees no chat record (#320 D1).
562
+ const desktop = (fs.readFileSync(notePath(where, role), "utf8").match(/^Desktop session: (\S+?)\.$/m) || [])[1] || null;
563
+ return { record: store.post(where, { group, text: body, refs: [REF] }), body, desktop };
561
564
  }
562
565
 
563
566
  // `--role` reads a role's note from a worktree bound to no other role (#293 D5).
@@ -903,8 +906,17 @@ function runShift(argv) {
903
906
  }
904
907
  case "start": {
905
908
  if (!rest[0]) throw new ShiftError("keel shift start needs the role.");
906
- const record = start(where, rest[0], rest.slice(1).join(" "));
907
- out({ id: record.id, group: record.group, role: rest[0] }, `Woke ${rest[0]} to start its new shift (${record.id} in ${record.group}).`);
909
+ const { record, body, desktop } = start(where, rest[0], rest.slice(1).join(" "));
910
+ const posted = `(${record.id} in ${record.group})`;
911
+ out(
912
+ { id: record.id, group: record.group, role: rest[0], desktop },
913
+ desktop
914
+ ? [
915
+ `Posted the start for ${rest[0]} ${posted}. Its note was written on the Claude desktop app, where a session with no running process sees no chat record (#320), so this alone wakes nothing.`,
916
+ `Wake it: call \`get_session\` on \`${desktop}\`; when it reports the session archived, call \`unarchive_session\` on it; then call \`send_message\` to \`${desktop}\` with: '${body.replace(/\n/g, " ")}'`,
917
+ ].join("\n")
918
+ : `Woke ${rest[0]} to start its new shift ${posted}.`,
919
+ );
908
920
  return 0;
909
921
  }
910
922
  case "resume": {