@christang/keel 5.130.0 → 5.132.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 +10 -5
- package/README.zh-CN.md +4 -1
- package/assets/bootstrap/AGENTS.md +1 -1
- package/bin/keel.js +24 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/plugins/keel/.claude-plugin/plugin.json +1 -1
- package/plugins/keel/.codex-plugin/plugin.json +1 -1
- package/scripts/validate_plugin.py +129 -8
- package/src/core/shift.js +14 -6
package/README.md
CHANGED
|
@@ -79,9 +79,13 @@ OpenSpec CLI):
|
|
|
79
79
|
```bash
|
|
80
80
|
npm install -g @christang/keel
|
|
81
81
|
keel --version
|
|
82
|
-
codex plugin add keel
|
|
82
|
+
codex plugin marketplace add TanglmChris/keel --ref main --sparse .agents/plugins --sparse plugins/keel
|
|
83
|
+
codex plugin add keel@keel-marketplace # Codex
|
|
83
84
|
```
|
|
84
85
|
|
|
86
|
+
The `--sparse` paths make Codex fetch only the plugin rather than the whole repository, which a
|
|
87
|
+
slow link may not clone within Codex's 30-second limit.
|
|
88
|
+
|
|
85
89
|
For Codex, review the current hook definitions with `/hooks` in the CLI; installation does not
|
|
86
90
|
grant hook trust. A running Codex session uses an updated plugin at its next hook call, and a
|
|
87
91
|
release that changes the hook definitions needs that review again.
|
|
@@ -238,10 +242,11 @@ session reads that restore as another session's request and stops to ask you. It
|
|
|
238
242
|
session, so it takes no scope, and it covers no other session, no clear or archive, and no repository
|
|
239
243
|
action.
|
|
240
244
|
|
|
241
|
-
`self-shift` (#319) is its outgoing counterpart: the
|
|
242
|
-
the desktop app once the note is stored — turn the session's own Remote Control off and wait,
|
|
243
|
-
the one-shot wake task, rename the session, clear it. It does not
|
|
244
|
-
stays with the task-boundary rule and the coordinator. It takes no
|
|
245
|
+
`self-shift` (#319) is its outgoing counterpart: the five 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, dismiss
|
|
247
|
+
the PRs bound to it (#326), create the one-shot wake task, rename the session, clear it. It does not
|
|
248
|
+
decide that a shift happens; that stays with the task-boundary rule and the coordinator. It takes no
|
|
249
|
+
scope.
|
|
245
250
|
|
|
246
251
|
`cleanup:scratch` covers removing temporary worktrees and run output under the session's own
|
|
247
252
|
scratchpad, after checking that they are merged and that no process is using them. It never covers
|
package/README.zh-CN.md
CHANGED
|
@@ -64,9 +64,12 @@ Anthropic 的插件目录里,Keel 以 `keel-openspec` 列出。每次发版都
|
|
|
64
64
|
```bash
|
|
65
65
|
npm install -g @christang/keel
|
|
66
66
|
keel --version
|
|
67
|
-
codex plugin add keel
|
|
67
|
+
codex plugin marketplace add TanglmChris/keel --ref main --sparse .agents/plugins --sparse plugins/keel
|
|
68
|
+
codex plugin add keel@keel-marketplace # Codex
|
|
68
69
|
```
|
|
69
70
|
|
|
71
|
+
`--sparse` 让 Codex 只拉插件本身,而不是整个仓库;网络慢时,整仓克隆可能超过 Codex 的 30 秒上限。
|
|
72
|
+
|
|
70
73
|
全局装的 `keel` 在 PATH 里排在插件那份前面,所以在 Claude Code 里 agent 会用它。要么让它和插件同版本,
|
|
71
74
|
要么卸掉(`npm rm -g @christang/keel`);两者版本不一致时,会话启动那一行会指出来。
|
|
72
75
|
|
package/bin/keel.js
CHANGED
|
@@ -1035,6 +1035,12 @@ function claudeKeel(executable) {
|
|
|
1035
1035
|
return { id: entry.id, market: entry.id.slice("keel@".length), version: entry.version || null };
|
|
1036
1036
|
}
|
|
1037
1037
|
|
|
1038
|
+
// The Codex marketplace needs only its catalog and the plugin it names; a
|
|
1039
|
+
// sparse clone fetches those instead of the whole repository, which a slow
|
|
1040
|
+
// link cannot clone within Codex's 30 s limit (#329).
|
|
1041
|
+
const CODEX_SPARSE_PATHS = [".agents/plugins", "plugins/keel"];
|
|
1042
|
+
const CODEX_SPARSE_FLAGS = CODEX_SPARSE_PATHS.map((entry) => `--sparse ${entry}`).join(" ");
|
|
1043
|
+
|
|
1038
1044
|
function codexKeel(executable) {
|
|
1039
1045
|
const listed = hostJson(executable, ["plugin", "list", "--json"]);
|
|
1040
1046
|
const items = listed && Array.isArray(listed.installed) ? listed.installed : [];
|
|
@@ -1059,6 +1065,11 @@ function readOrNull(file) {
|
|
|
1059
1065
|
}
|
|
1060
1066
|
}
|
|
1061
1067
|
|
|
1068
|
+
function hostFails(executable, args) {
|
|
1069
|
+
const result = hostRun(executable, args);
|
|
1070
|
+
return Boolean(result.error) || result.status !== 0;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1062
1073
|
function runHostSteps(component, name, executable, steps) {
|
|
1063
1074
|
for (const args of steps) {
|
|
1064
1075
|
const result = hostRun(executable, args);
|
|
@@ -1124,11 +1135,22 @@ function updateCodexPlugin(options) {
|
|
|
1124
1135
|
"manual",
|
|
1125
1136
|
`its marketplace is a ${installed.sourceType} source (${installed.source}), which \`codex plugin `
|
|
1126
1137
|
+ "marketplace upgrade` cannot refresh; to make it upgradable, run `codex plugin marketplace "
|
|
1127
|
-
+ `remove ${market}\` and then codex plugin marketplace add TanglmChris/keel --ref main`
|
|
1138
|
+
+ `remove ${market}\` and then codex plugin marketplace add TanglmChris/keel --ref main ${CODEX_SPARSE_FLAGS}`
|
|
1128
1139
|
);
|
|
1129
1140
|
return true;
|
|
1130
1141
|
}
|
|
1131
|
-
|
|
1142
|
+
// The refresh clones over the network; one retry absorbs a dropped link (#329).
|
|
1143
|
+
if (hostFails(executable, steps[0]) && hostFails(executable, steps[0])) {
|
|
1144
|
+
const codexConfig = path.join(process.env.CODEX_HOME || path.join(os.homedir(), ".codex"), "config.toml");
|
|
1145
|
+
updateLine(
|
|
1146
|
+
component,
|
|
1147
|
+
"failed",
|
|
1148
|
+
`\`codex ${steps[0].join(" ")}\` failed twice; a slow link can exceed Codex's 30 s clone limit, and a sparse `
|
|
1149
|
+
+ `marketplace fetches only the plugin: add sparse_paths = ${JSON.stringify(CODEX_SPARSE_PATHS)} `
|
|
1150
|
+
+ `under [marketplaces.${market}] in ${codexConfig}`
|
|
1151
|
+
);
|
|
1152
|
+
return false;
|
|
1153
|
+
}
|
|
1132
1154
|
// Codex re-reads hook definitions at every call and trusts them by hash, so
|
|
1133
1155
|
// a changed definition stops running until the owner reviews it. Compared
|
|
1134
1156
|
// before `plugin add`, which deletes the old install's directory.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@christang/keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.132.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@christang/keel",
|
|
9
|
-
"version": "5.
|
|
9
|
+
"version": "5.132.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@fission-ai/openspec": "^1.4.1"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.132.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.
|
|
3
|
+
"version": "5.132.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.
|
|
51
|
-
PROTOCOL_VERSION = "5.
|
|
50
|
+
PACKAGE_VERSION = "5.132.0"
|
|
51
|
+
PROTOCOL_VERSION = "5.132.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
|
|
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
|
|
@@ -23120,7 +23140,16 @@ const state = fs.existsSync(stateFile) ? JSON.parse(fs.readFileSync(stateFile, "
|
|
|
23120
23140
|
const save = () => fs.writeFileSync(stateFile, JSON.stringify(state));
|
|
23121
23141
|
const version = state[host] || "5.0.0";
|
|
23122
23142
|
const failOn = process.env[`FAKE_FAIL_${host.toUpperCase()}`] || "";
|
|
23123
|
-
|
|
23143
|
+
// FAKE_FAIL_TIMES_<HOST> limits the failures to the first N matching calls.
|
|
23144
|
+
const failTimes = Number(process.env[`FAKE_FAIL_TIMES_${host.toUpperCase()}`] || "Infinity");
|
|
23145
|
+
if (failOn && args.join(" ").includes(failOn)) {
|
|
23146
|
+
const failed = (state.failed && state.failed[host]) || 0;
|
|
23147
|
+
if (failed < failTimes) {
|
|
23148
|
+
state.failed = { ...(state.failed || {}), [host]: failed + 1 };
|
|
23149
|
+
save();
|
|
23150
|
+
process.exit(1);
|
|
23151
|
+
}
|
|
23152
|
+
}
|
|
23124
23153
|
if (host === "npm") {
|
|
23125
23154
|
if (args[0] === "pack") {
|
|
23126
23155
|
const dest = args[args.indexOf("--pack-destination") + 1];
|
|
@@ -23249,8 +23278,8 @@ def validate_update_covers_installed_hosts_scenario() -> int:
|
|
|
23249
23278
|
if "manual" not in codex_line:
|
|
23250
23279
|
report(f"{label} a local Codex marketplace was not reported manual: {codex_line!r}")
|
|
23251
23280
|
return 1
|
|
23252
|
-
if "codex plugin marketplace add TanglmChris/keel --ref main" not in codex_line:
|
|
23253
|
-
report(f"{label} the manual Codex line does not name the Git marketplace command: {codex_line!r}")
|
|
23281
|
+
if "codex plugin marketplace add TanglmChris/keel --ref main --sparse .agents/plugins --sparse plugins/keel" not in codex_line:
|
|
23282
|
+
report(f"{label} the manual Codex line does not name the sparse Git marketplace command (--sparse): {codex_line!r}")
|
|
23254
23283
|
return 1
|
|
23255
23284
|
if any(c[0] == "codex" for c in calls):
|
|
23256
23285
|
report(f"{label} a local Codex marketplace still received commands: {calls!r}")
|
|
@@ -23302,6 +23331,97 @@ OVERLAY_BLOCK_RE = re.compile(
|
|
|
23302
23331
|
)
|
|
23303
23332
|
|
|
23304
23333
|
|
|
23334
|
+
def validate_update_codex_refresh_retry_scenario() -> int:
|
|
23335
|
+
"""Issue #329: a slow link can cut Codex's whole-repository marketplace clone.
|
|
23336
|
+
|
|
23337
|
+
`keel --update` retries the refresh once, and when it still fails, names the
|
|
23338
|
+
sparse marketplace paths that make it fetch only the plugin. Those paths
|
|
23339
|
+
hold the Codex catalog and the plugin it names, and the docs use them.
|
|
23340
|
+
"""
|
|
23341
|
+
label = "update-codex-refresh-retry:"
|
|
23342
|
+
upgrade = ["codex", "plugin", "marketplace", "upgrade", "keel-marketplace"]
|
|
23343
|
+
add = ["codex", "plugin", "add", "keel@keel-marketplace"]
|
|
23344
|
+
with tempfile.TemporaryDirectory(prefix="keel-update-retry-", ignore_cleanup_errors=True) as raw:
|
|
23345
|
+
tmp = Path(raw)
|
|
23346
|
+
fake = tmp / "fake.js"
|
|
23347
|
+
write_text(fake, UPDATE_FAKE)
|
|
23348
|
+
launchers = {}
|
|
23349
|
+
for host in ("npm", "claude", "codex"):
|
|
23350
|
+
launcher = tmp / f"fake-{host}"
|
|
23351
|
+
write_text(launcher, f'#!/bin/sh\nFAKE_HOST={host} exec node "{fake}" "$@"\n')
|
|
23352
|
+
launcher.chmod(0o755)
|
|
23353
|
+
launchers[host] = launcher
|
|
23354
|
+
|
|
23355
|
+
def update(times: str):
|
|
23356
|
+
log, state = tmp / "log.jsonl", tmp / "state.json"
|
|
23357
|
+
for stale in (log, state):
|
|
23358
|
+
if stale.exists():
|
|
23359
|
+
stale.unlink()
|
|
23360
|
+
log.write_text("")
|
|
23361
|
+
env = dict(os.environ)
|
|
23362
|
+
env.update({
|
|
23363
|
+
"KEEL_UPDATE_NPM": str(launchers["npm"]), "KEEL_UPDATE_CLAUDE": str(launchers["claude"]),
|
|
23364
|
+
"KEEL_UPDATE_CODEX": str(launchers["codex"]), "CODEX_HOME": str(tmp / "codex-home"),
|
|
23365
|
+
"FAKE_LOG": str(log), "FAKE_STATE": str(state), "FAKE_CODEX_SOURCE": str(tmp / "codex-source"),
|
|
23366
|
+
"FAKE_FAIL_CODEX": "marketplace upgrade", "FAKE_FAIL_TIMES_CODEX": times,
|
|
23367
|
+
})
|
|
23368
|
+
env.pop("KEEL_UPDATE_SOURCE", None)
|
|
23369
|
+
result = subprocess.run(["node", str(ROOT / "bin/keel.js"), "--update"], cwd=tmp, env=env,
|
|
23370
|
+
text=True, capture_output=True, check=False, timeout=60)
|
|
23371
|
+
calls = [json.loads(line) for line in log.read_text().splitlines() if line.strip()]
|
|
23372
|
+
line = [l for l in result.stdout.splitlines() if l.startswith("keel update: codex plugin:")]
|
|
23373
|
+
return result, calls, (line[0] if len(line) == 1 else "")
|
|
23374
|
+
|
|
23375
|
+
result, calls, line = update("1")
|
|
23376
|
+
runs = sum(1 for c in calls if c[:5] == upgrade)
|
|
23377
|
+
if runs != 2:
|
|
23378
|
+
report(f"{label} the Codex marketplace upgrade ran {runs} time(s) after one failure, not 2: {calls!r}")
|
|
23379
|
+
return 1
|
|
23380
|
+
if sum(1 for c in calls if c[:4] == add) != 1:
|
|
23381
|
+
report(f"{label} a refresh that succeeded on retry did not run plugin add once: {calls!r}")
|
|
23382
|
+
return 1
|
|
23383
|
+
if "5.0.0 -> 5.1.0" not in line:
|
|
23384
|
+
report(f"{label} a refresh that succeeded on retry did not report the new version: {line!r}")
|
|
23385
|
+
return 1
|
|
23386
|
+
if result.returncode != 0:
|
|
23387
|
+
report(f"{label} a refresh that succeeded on retry exited {result.returncode}: {result.stdout!r}")
|
|
23388
|
+
return 1
|
|
23389
|
+
|
|
23390
|
+
result, calls, line = update("9")
|
|
23391
|
+
runs = sum(1 for c in calls if c[:5] == upgrade)
|
|
23392
|
+
if runs != 2:
|
|
23393
|
+
report(f"{label} a lasting failure ran the upgrade {runs} time(s), not 2: {calls!r}")
|
|
23394
|
+
return 1
|
|
23395
|
+
if any(c[:4] == add for c in calls):
|
|
23396
|
+
report(f"{label} a lasting refresh failure still ran plugin add: {calls!r}")
|
|
23397
|
+
return 1
|
|
23398
|
+
if result.returncode == 0:
|
|
23399
|
+
report(f"{label} a lasting refresh failure left the exit status 0: {result.stdout!r}")
|
|
23400
|
+
return 1
|
|
23401
|
+
if "failed" not in line:
|
|
23402
|
+
report(f"{label} a lasting refresh failure was not reported failed: {line!r}")
|
|
23403
|
+
return 1
|
|
23404
|
+
for needle in ("sparse_paths", ".agents/plugins", "plugins/keel"):
|
|
23405
|
+
if needle not in line:
|
|
23406
|
+
report(f"{label} the failed Codex line does not name {needle}: {line!r}")
|
|
23407
|
+
return 1
|
|
23408
|
+
|
|
23409
|
+
catalog = json.loads((ROOT / ".agents/plugins/marketplace.json").read_text(encoding="utf-8"))
|
|
23410
|
+
paths = [entry["source"]["path"] for entry in catalog["plugins"] if entry["name"] == "keel"]
|
|
23411
|
+
if paths != ["./plugins/keel"]:
|
|
23412
|
+
report(f"{label} the Codex catalog's keel source is not under the sparse path plugins/keel: {paths!r}")
|
|
23413
|
+
return 1
|
|
23414
|
+
for relative in ("README.md", "README.zh-CN.md", "docs/updating.md"):
|
|
23415
|
+
if "--sparse .agents/plugins --sparse plugins/keel" not in (ROOT / relative).read_text(encoding="utf-8"):
|
|
23416
|
+
report(f"{label} {relative} does not add the Codex marketplace sparse.")
|
|
23417
|
+
return 1
|
|
23418
|
+
if "update-codex-refresh-retry" not in {name for name, _ in SCENARIOS}:
|
|
23419
|
+
report(f"{label} scenario is not registered.")
|
|
23420
|
+
return 1
|
|
23421
|
+
report("update-codex-refresh-retry scenario passed.")
|
|
23422
|
+
return 0
|
|
23423
|
+
|
|
23424
|
+
|
|
23305
23425
|
def validate_refresh_covers_every_target_scenario() -> int:
|
|
23306
23426
|
"""Issue #204: a protocol refresh brings every installed target forward.
|
|
23307
23427
|
|
|
@@ -40396,6 +40516,7 @@ SCENARIOS: tuple = (
|
|
|
40396
40516
|
("guard-keeps-loaded-logic-under-manifest", validate_guard_keeps_loaded_logic_under_manifest_scenario),
|
|
40397
40517
|
("adopted-update-is-silent-unless-reload", validate_adopted_update_is_silent_unless_reload_scenario),
|
|
40398
40518
|
("update-covers-installed-hosts", validate_update_covers_installed_hosts_scenario),
|
|
40519
|
+
("update-codex-refresh-retry", validate_update_codex_refresh_retry_scenario),
|
|
40399
40520
|
("refresh-covers-every-target", validate_refresh_covers_every_target_scenario),
|
|
40400
40521
|
("directory-branch-advances", validate_directory_branch_advances_scenario),
|
|
40401
40522
|
("release-notes-name-the-directory-branch", validate_release_notes_name_the_directory_branch_scenario),
|
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
|
-
|
|
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
|
-
`
|
|
758
|
-
'
|
|
759
|
-
"Keel creates no task.
|
|
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
|
|
764
|
-
: "Declaring `self-shift` under authorize: in keel/config.yaml lets a session take these
|
|
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.`;
|