@christang/keel 5.130.0 → 5.131.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
@@ -238,10 +238,11 @@ session reads that restore as another session's request and stops to ask you. It
238
238
  session, so it takes no scope, and it covers no other session, no clear or archive, and no repository
239
239
  action.
240
240
 
241
- `self-shift` (#319) is its outgoing counterpart: the four steps `keel shift ready --wake` prints on
242
- the desktop app once the note is stored — turn the session's own Remote Control off and wait, create
243
- the one-shot wake task, rename the session, clear it. It does not decide that a shift happens; that
244
- stays with the task-boundary rule and the coordinator. It takes no scope.
241
+ `self-shift` (#319) is its outgoing counterpart: the five steps `keel shift ready --wake` prints on
242
+ the desktop app once the note is stored — turn the session's own Remote Control off and wait, dismiss
243
+ the PRs bound to it (#326), create the one-shot wake task, rename the session, clear it. It does not
244
+ decide that a shift happens; that stays with the task-boundary rule and the coordinator. It takes no
245
+ scope.
245
246
 
246
247
  `cleanup:scratch` covers removing temporary worktrees and run output under the session's own
247
248
  scratchpad, after checking that they are merged and that no process is using them. It never covers
@@ -1,4 +1,4 @@
1
- <!-- keel:start version=5.130.0 -->
1
+ <!-- keel:start version=5.131.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.130.0",
3
+ "version": "5.131.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@christang/keel",
9
- "version": "5.130.0",
9
+ "version": "5.131.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.130.0",
5
+ "version": "5.131.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.130.0",
3
+ "version": "5.131.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.130.0",
3
+ "version": "5.131.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.130.0"
51
- PROTOCOL_VERSION = "5.130.0"
50
+ PACKAGE_VERSION = "5.131.0"
51
+ PROTOCOL_VERSION = "5.131.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 five 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,6 +6816,10 @@ 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
+ # The PR-dismiss step makes five (#326).
6820
+ if "take these five steps now" not in granted.stdout:
6821
+ report(f"{label} a desktop ready --wake with self-shift declared does not cover five steps: {granted.stdout.strip()}")
6822
+ return 1
6819
6823
  run_keel(verify, "shift", "resume", env=desktop)
6820
6824
 
6821
6825
  declare("commit")
@@ -6939,6 +6943,20 @@ def validate_shift_desktop_wake_scenario() -> int:
6939
6943
  if off == -1 or off > armed.stdout.find("create_scheduled_task"):
6940
6944
  report(f"{label} the desktop clear hint does not turn Remote Control off before create_scheduled_task: {armed.stdout.strip()}")
6941
6945
  return 1
6946
+ # Dismiss the bound PRs after Remote Control is off and before the
6947
+ # task, or the app's auto-archive takes the idle cleared session (#326).
6948
+ for needle in ("unbind_pr", "get_status", "unarchive_session", "mcp__ccd_pr__unbind_pr",
6949
+ "mcp__ccd_session_mgmt__unarchive_session"):
6950
+ if needle not in armed.stdout:
6951
+ report(f"{label} the desktop clear hint does not name {needle}: {armed.stdout.strip()}")
6952
+ return 1
6953
+ unbind = armed.stdout.find("unbind_pr")
6954
+ if not off < unbind < armed.stdout.find("create_scheduled_task"):
6955
+ report(f"{label} the desktop clear hint does not dismiss bound PRs between Remote Control off and create_scheduled_task: {armed.stdout.strip()}")
6956
+ return 1
6957
+ if "archived copy" in armed.stdout:
6958
+ report(f"{label} the desktop clear hint still says the rename tells an archived copy apart: {armed.stdout.strip()}")
6959
+ return 1
6942
6960
  if "mcp__ccd_session_mgmt__clear_session" in armed.stdout:
6943
6961
  report(f"{label} the desktop clear hint still blames approval of clear_session: {armed.stdout.strip()}")
6944
6962
  return 1
@@ -6963,7 +6981,8 @@ def validate_shift_desktop_wake_scenario() -> int:
6963
6981
  if "The wake is armed" not in plain.stdout:
6964
6982
  report(f"{label} outside the desktop app the clear hint no longer says the wake is armed: {plain.stdout.strip()}")
6965
6983
  return 1
6966
- for needle in ("send_message", "create_scheduled_task", "set_session_title", "shift-restore"):
6984
+ for needle in ("send_message", "create_scheduled_task", "set_session_title", "shift-restore",
6985
+ "unbind_pr", "unarchive_session"):
6967
6986
  if needle in plain.stdout:
6968
6987
  report(f"{label} outside the desktop app the clear hint names {needle}: {plain.stdout.strip()}")
6969
6988
  return 1
@@ -6977,7 +6996,8 @@ def validate_shift_desktop_wake_scenario() -> int:
6977
6996
 
6978
6997
  for relative in ("docs/shift-change.md", "docs/shift-change.zh-CN.md"):
6979
6998
  text = (ROOT / relative).read_text(encoding="utf-8")
6980
- for needle in ("send_message", "set_remote_control", "set_session_title", "shift-restore"):
6999
+ for needle in ("send_message", "set_remote_control", "set_session_title", "shift-restore",
7000
+ "unbind_pr", "unarchive_session"):
6981
7001
  if needle not in text:
6982
7002
  report(f"{label} {relative} does not name {needle} for the desktop app.")
6983
7003
  return 1
package/src/core/shift.js CHANGED
@@ -750,18 +750,26 @@ function clearHint(result) {
750
750
  last = [
751
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
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.',
753
- "2. Only then create a one-shot scheduled task with the host's `create_scheduled_task`, firing about three minutes later, "
753
+ // The app's auto-archive takes an idle session whose bound PRs are all
754
+ // merged, and releases its worktree; a cleared session waiting for its
755
+ // wake is exactly that (#326 D1 of shift-desktop-unbind-merged-prs).
756
+ "2. Dismiss every PR bound to this session: call `get_status`, and while it reports a bound PR, dismiss it with `unbind_pr` and call `get_status` again. "
757
+ + "Otherwise the app's auto-archive archives the cleared, idle session before the wake and releases its worktree (#326). "
758
+ + "The new shift can bind an open one again with `bind_pr`.",
759
+ "3. Only then create a one-shot scheduled task with the host's `create_scheduled_task`, firing about three minutes later, "
754
760
  + `whose prompt calls \`send_message\` to session \`${result.desktop}\` with: "${result.role}: your new shift starts now. `
755
761
  + "Run `keel context` and `keel shift resume`, then restore Remote Control and this session's title as `keel shift resume` says.\" "
762
+ + "and, if the send is refused because the session is archived, calls `unarchive_session` on it, sends again, and says which path it took. "
756
763
  + "A task created earlier can fire first, and the app then refuses the clear to keep its message.",
757
- `3. Rename this session with \`set_session_title\` (for example "${result.role} · shifted ${store.isoLocal(new Date()).slice(0, 16)}"), so its archived copy can be told apart.`,
758
- '4. Call clear_session("self").',
759
- "Keel creates no task. Restoring unattended needs `mcp__ccd_session_mgmt__set_remote_control` in `permissions.allow`, "
764
+ `4. 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.`,
765
+ '5. Call clear_session("self").',
766
+ "Keel creates no task. Running unattended needs `mcp__ccd_session_mgmt__set_remote_control`, `mcp__ccd_pr__unbind_pr` "
767
+ + "and `mcp__ccd_session_mgmt__unarchive_session` in `permissions.allow`, "
760
768
  + "and `shift-restore` under `authorize:` in keel/config.yaml so the woken session does not stop to ask.",
761
769
  // The outgoing side's confirmation is the repository's to waive (#319).
762
770
  require("./config").readStandingAuthorization(result.worktree).scopes.has("self-shift")
763
- ? "Standing-authorized by `self-shift` in keel/config.yaml: take these four steps now, without asking."
764
- : "Declaring `self-shift` under authorize: in keel/config.yaml lets a session take these four steps without asking.",
771
+ ? "Standing-authorized by `self-shift` in keel/config.yaml: take these five steps now, without asking."
772
+ : "Declaring `self-shift` under authorize: in keel/config.yaml lets a session take these five steps without asking.",
765
773
  ].join("\n");
766
774
  } else if (result.waiter) {
767
775
  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.`;