@christang/keel 5.133.0 → 5.134.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/README.md CHANGED
@@ -236,16 +236,15 @@ refused too. Declaring it turns the push check on by itself, and a bare `push` b
236
236
  refused.
237
237
 
238
238
  `shift-restore` (#319) covers the two things a session started by a shift change on the Claude
239
- desktop app must do right after `keel shift resume`: turn its own Remote Control back on, and rename
240
- itself back to its working title. A clear there keeps neither. Without the declaration, the woken
239
+ desktop app must do right after `keel shift resume`: turn its own Remote Control back on if it came
240
+ back off, and rename itself back to its working title. A clear there keeps no title. Without the declaration, the woken
241
241
  session reads that restore as another session's request and stops to ask you. It reaches only that
242
242
  session, so it takes no scope, and it covers no other session, no clear or archive, and no repository
243
243
  action.
244
244
 
245
- `self-shift` (#319) is its outgoing counterpart: the four steps `keel shift ready --wake` prints on
246
- the desktop app once the note is stored — turn the session's own Remote Control off and wait, create
247
- the one-shot wake task (which unarchives the session first if needed, #326), rename the session,
248
- clear it. It does not
245
+ `self-shift` (#319) is its outgoing counterpart: the three steps `keel shift ready --wake` prints on
246
+ the desktop app once the note is stored — create the one-shot wake task (which unarchives the
247
+ session first if needed, #326), rename the session, clear it. Remote Control stays on (#324). It does not
249
248
  decide that a shift happens; that stays with the task-boundary rule and the coordinator. It takes no
250
249
  scope.
251
250
 
@@ -1,4 +1,4 @@
1
- <!-- keel:start version=5.133.0 -->
1
+ <!-- keel:start version=5.134.0 -->
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.133.0",
3
+ "version": "5.134.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@christang/keel",
9
- "version": "5.133.0",
9
+ "version": "5.134.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.133.0",
5
+ "version": "5.134.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.133.0",
3
+ "version": "5.134.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.133.0",
3
+ "version": "5.134.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",
@@ -47,8 +47,8 @@ REQUIRED_SCRIPTS = [
47
47
  "scripts/validate_plugin.py",
48
48
  ]
49
49
 
50
- PACKAGE_VERSION = "5.133.0"
51
- PROTOCOL_VERSION = "5.133.0"
50
+ PACKAGE_VERSION = "5.134.0"
51
+ PROTOCOL_VERSION = "5.134.0"
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
@@ -6789,7 +6789,7 @@ def validate_shift_change_scenario() -> int:
6789
6789
 
6790
6790
 
6791
6791
  def validate_self_shift_authorization_scenario() -> int:
6792
- """Issue #319: `self-shift` lets a desktop session take its own four steps.
6792
+ """Issue #319: `self-shift` lets a desktop session take its own three steps.
6793
6793
 
6794
6794
  The name is read and listed by `--doctor`, a scoped form is refused, and a
6795
6795
  desktop `keel shift ready --wake` says the steps are standing-authorized
@@ -6816,9 +6816,9 @@ def validate_self_shift_authorization_scenario() -> int:
6816
6816
  if "Standing-authorized by `self-shift`" not in granted.stdout:
6817
6817
  report(f"{label} a desktop ready --wake with self-shift declared does not say the steps are standing-authorized: {granted.stdout.strip()} {granted.stderr.strip()}")
6818
6818
  return 1
6819
- # Four again once the PR-dismiss step went (#326).
6820
- if "take these four steps now" not in granted.stdout:
6821
- report(f"{label} a desktop ready --wake with self-shift declared does not cover four steps: {granted.stdout.strip()}")
6819
+ # Three once the Remote Control step went (#324).
6820
+ if "take these three steps now" not in granted.stdout:
6821
+ report(f"{label} a desktop ready --wake with self-shift declared does not cover three steps: {granted.stdout.strip()}")
6822
6822
  return 1
6823
6823
  run_keel(verify, "shift", "resume", env=desktop)
6824
6824
 
@@ -6932,16 +6932,25 @@ def validate_shift_desktop_wake_scenario() -> int:
6932
6932
  if "Desktop session: local_test-319" not in note.read_text(encoding="utf-8"):
6933
6933
  report(f"{label} the note does not record the desktop session id.")
6934
6934
  return 1
6935
- # Remote Control off, then the task, so the wake cannot fire before the
6936
- # clear; then rename and clear (#319 comments 6143435530, 6144856601).
6935
+ # Remote Control stays on: a clear is accepted with it on, and turning it
6936
+ # off waits for a person's approval (#324 comments 6164793777, 6165454422).
6937
+ for needle in ('set_remote_control("self", false)', "cannot be cleared"):
6938
+ if needle in armed.stdout:
6939
+ report(f"{label} the desktop clear hint still says {needle}: {armed.stdout.strip()}")
6940
+ return 1
6941
+ # The task, then rename and clear at once, so the wake cannot fire
6942
+ # before the clear (#319 comments 6143435530, 6144856601).
6937
6943
  for needle in ("create_scheduled_task", "send_message", "local_test-319", "set_session_title",
6938
6944
  "mcp__ccd_session_mgmt__set_remote_control", "shift-restore"):
6939
6945
  if needle not in armed.stdout:
6940
6946
  report(f"{label} the desktop clear hint does not name {needle}: {armed.stdout.strip()}")
6941
6947
  return 1
6942
- off = armed.stdout.find('set_remote_control("self", false)')
6943
- if off == -1 or off > armed.stdout.find("create_scheduled_task"):
6944
- report(f"{label} the desktop clear hint does not turn Remote Control off before create_scheduled_task: {armed.stdout.strip()}")
6948
+ task = armed.stdout.find("create_scheduled_task")
6949
+ if not task < armed.stdout.find("set_session_title", task) < armed.stdout.find("clear_session", task):
6950
+ report(f"{label} the desktop clear hint does not order create_scheduled_task, set_session_title, clear_session: {armed.stdout.strip()}")
6951
+ return 1
6952
+ if "new address" not in armed.stdout:
6953
+ report(f"{label} the desktop clear hint does not say Remote Control reconnects under a new address: {armed.stdout.strip()}")
6945
6954
  return 1
6946
6955
  # Dismissing bound PRs did not keep the app's auto-archive off the
6947
6956
  # cleared session: the engine archives on every PR the session ever
@@ -6973,8 +6982,8 @@ def validate_shift_desktop_wake_scenario() -> int:
6973
6982
  if "next is R011" not in resumed.stdout:
6974
6983
  report(f"{label} resume on the desktop app did not print the note: {resumed.stdout.strip()} {resumed.stderr.strip()}")
6975
6984
  return 1
6976
- if "set_remote_control" not in resumed.stdout:
6977
- report(f"{label} resume on the desktop app does not say to turn Remote Control back on: {resumed.stdout.strip()}")
6985
+ if "set_remote_control" not in resumed.stdout or "get_session" not in resumed.stdout:
6986
+ report(f"{label} resume on the desktop app does not say to check Remote Control and turn it back on if off: {resumed.stdout.strip()}")
6978
6987
  return 1
6979
6988
  if "set_session_title" not in resumed.stdout:
6980
6989
  report(f"{label} resume on the desktop app does not say to rename the session back: {resumed.stdout.strip()}")
@@ -7002,9 +7011,10 @@ def validate_shift_desktop_wake_scenario() -> int:
7002
7011
 
7003
7012
  for relative in ("docs/shift-change.md", "docs/shift-change.zh-CN.md"):
7004
7013
  text = (ROOT / relative).read_text(encoding="utf-8")
7005
- if "unbind_pr" in text:
7006
- report(f"{label} {relative} still names unbind_pr for the desktop app.")
7007
- return 1
7014
+ for stale in ("unbind_pr", "cannot be cleared"):
7015
+ if stale in text:
7016
+ report(f"{label} {relative} still says {stale}.")
7017
+ return 1
7008
7018
  for needle in ("send_message", "set_remote_control", "set_session_title", "shift-restore",
7009
7019
  "get_session", "unarchive_session"):
7010
7020
  if needle not in text:
package/src/core/shift.js CHANGED
@@ -730,7 +730,6 @@ function describe(row) {
730
730
 
731
731
  const CLEAR_HINT = [
732
732
  "Session state a clear destroys — scheduled jobs, Remote Control — is not in Keel; if the note does not say how to re-create it, add that first.",
733
- "A session serving Remote Control cannot be cleared: turn Remote Control off, clear, then turn it back on.",
734
733
  "Now clear this session:",
735
734
  "- Claude desktop app: call `clear_session(\"self\")` (the owner approves it), or type /clear;",
736
735
  "- Claude Code CLI: /clear;",
@@ -743,32 +742,33 @@ function clearHint(result) {
743
742
  let last;
744
743
  if (!result.role) last = `Without a chat role nothing wakes the new session; ${result.startedBy} — tell it to run \`keel shift resume\`.`;
745
744
  else if (result.waiter && result.desktop) {
746
- // Nothing starts a cleared desktop session but a prompt (#319 D3). The task
747
- // comes after Remote Control is off, which can block for hours while the
748
- // session is followed remotely; a wake that fires first is queued, and the
749
- // app then refuses the clear to keep it (#319 D1 of shift-desktop-wake-order).
745
+ // Nothing starts a cleared desktop session but a prompt (#319 D3). A wake
746
+ // that fires before the clear is queued, and the app then refuses the clear
747
+ // to keep it, so rename and clear follow the task at once. Remote Control
748
+ // stays on: the clear is accepted with it on, and turning it off waits for
749
+ // a person's approval (#324 D1, D2 of shift-desktop-keep-remote-control).
750
750
  last = [
751
- "On the Claude desktop app a clear starts no session until a prompt arrives, so the waiter alone wakes nothing (#319). Do these in order:",
752
- '1. Turn Remote Control off with set_remote_control("self", false), and wait for that call to return; it can take long while someone follows this session remotely.',
751
+ "On the Claude desktop app a clear starts no session until a prompt arrives, so the waiter alone wakes nothing (#319). "
752
+ + "Leave Remote Control on: the clear is accepted with it on, and the app reconnects it after the clear under a new address, which a remote viewer has to open (#324). Do these in order:",
753
753
  // The app's auto-archive can take the cleared, idle session before the
754
754
  // wake, on every PR it ever had; dismissing bound PRs did not stop it, so
755
755
  // the wake unarchives first (#326 D1, D2 of shift-desktop-unarchive-wake).
756
- "2. Only then create a one-shot scheduled task with the host's `create_scheduled_task`, firing about three minutes later, "
756
+ "1. Create a one-shot scheduled task with the host's `create_scheduled_task`, firing about three minutes later, "
757
757
  + `whose prompt first calls \`get_session\` on session \`${result.desktop}\` and, when it reports the session archived, calls \`unarchive_session\` on it; `
758
758
  + `then calls \`send_message\` to it with: "${result.role}: your new shift starts now. `
759
759
  + "Run `keel context` and `keel shift resume`, then restore Remote Control and this session's title as `keel shift resume` says.\" "
760
760
  + "If that send is still refused because the session is archived, it unarchives it and sends once more, and it says which path it took. "
761
761
  + "The app's auto-archive can archive the cleared session before the wake (#326); unarchiving brings back its worktree. "
762
- + "A task created earlier can fire first, and the app then refuses the clear to keep its message.",
763
- `3. Rename this session with \`set_session_title\` (for example "${result.role} · shifted ${store.isoLocal(new Date()).slice(0, 16)}"), so it reads as between shifts until the woken session renames it back.`,
764
- '4. Call clear_session("self").',
762
+ + "A task that fires before the clear gets the clear refused, so take the next two steps at once.",
763
+ `2. Rename this session with \`set_session_title\` (for example "${result.role} · shifted ${store.isoLocal(new Date()).slice(0, 16)}"), so it reads as between shifts until the woken session renames it back.`,
764
+ '3. Call clear_session("self").',
765
765
  "Keel creates no task. Running unattended needs `mcp__ccd_session_mgmt__set_remote_control`, `mcp__ccd_session_mgmt__get_session` "
766
766
  + "and `mcp__ccd_session_mgmt__unarchive_session` in `permissions.allow`, "
767
767
  + "and `shift-restore` under `authorize:` in keel/config.yaml so the woken session does not stop to ask.",
768
768
  // The outgoing side's confirmation is the repository's to waive (#319).
769
769
  require("./config").readStandingAuthorization(result.worktree).scopes.has("self-shift")
770
- ? "Standing-authorized by `self-shift` in keel/config.yaml: take these four steps now, without asking."
771
- : "Declaring `self-shift` under authorize: in keel/config.yaml lets a session take these four steps without asking.",
770
+ ? "Standing-authorized by `self-shift` in keel/config.yaml: take these three steps now, without asking."
771
+ : "Declaring `self-shift` under authorize: in keel/config.yaml lets a session take these three steps without asking.",
772
772
  ].join("\n");
773
773
  } else if (result.waiter) {
774
774
  last = `The wake is armed: once ${result.role}'s next session starts (after a clear or a fresh start), it gets one message to run \`keel shift resume\`. The waiter gives up after two hours.`;
@@ -850,15 +850,16 @@ function runShift(argv) {
850
850
  // A new coordinator learns whom its previous shift left unstarted (#289 D2).
851
851
  const waiting = (result.waiting || []).map((w) => w.role);
852
852
  const still = waiting.length ? `\n\nStill waiting for \`keel shift start\`: ${waiting.join(", ")}.` : "";
853
- // A clear on the desktop app keeps neither Remote Control nor the title (#319).
853
+ // A clear on the desktop app keeps no title (#319), and a session it
854
+ // leaves may come back with Remote Control off (#324 D3).
854
855
  const { readStandingAuthorization } = require("./config");
855
856
  const restore = readStandingAuthorization(where.worktree).scopes.has("shift-restore");
856
857
  const remote = desktopSession() && restore
857
- ? "\n\nStanding-authorized by `shift-restore` in keel/config.yaml: turn Remote Control back on with "
858
- + "`set_remote_control(\"self\", true)` and rename this session back to its working title with `set_session_title`, now, without asking."
858
+ ? "\n\nStanding-authorized by `shift-restore` in keel/config.yaml: if `get_session(\"self\")` reports Remote Control off, turn it back on with "
859
+ + "`set_remote_control(\"self\", true)`; and rename this session back to its working title with `set_session_title`, now, without asking."
859
860
  : desktopSession()
860
- ? "\n\nOn the Claude desktop app a clear keeps neither Remote Control nor this session's title: turn Remote Control back on with "
861
- + "`set_remote_control(\"self\", true)` and rename the session back with `set_session_title`. "
861
+ ? "\n\nOn the Claude desktop app a clear keeps no title and may leave Remote Control off: if `get_session(\"self\")` reports it off, turn it back on with "
862
+ + "`set_remote_control(\"self\", true)`, and rename the session back with `set_session_title`. "
862
863
  + "Declaring `shift-restore` under authorize: in keel/config.yaml lets a woken session do this without asking."
863
864
  : "";
864
865
  out(result, `${result.text.replace(/\s+$/, "")}\n\n(The note moved to ${result.note}.)${still}${remind ? `\n\n${patrolReminder(patrol)}` : ""}${remote}`);