@christang/keel 5.85.0 → 5.87.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 +31 -7
- package/README.zh-CN.md +13 -0
- package/assets/bootstrap/AGENTS.md +2 -2
- package/assets/openspec/schemas/keel-spec-driven/schema.yaml +3 -3
- package/assets/openspec/schemas/keel-spec-driven/templates/tasks.md +3 -3
- package/bin/keel.js +55 -7
- 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/plugins/keel/agents/keel-single-task-goal-claude.md +1 -1
- package/plugins/keel/agents/keel-single-task-goal-codex.md +1 -1
- package/plugins/keel/skills/keel-run-single-task-goal/SKILL.md +2 -2
- package/plugins/keel/skills/keel-run-single-task-goal/guidance.md +1 -1
- package/scripts/validate_plugin.py +785 -19
- package/src/core/capabilities.js +2 -2
- package/src/core/chat/cli.js +77 -7
- package/src/core/chat/notice.js +37 -0
- package/src/core/chat/slack.js +4 -1
- package/src/core/chat/store.js +6 -1
- package/src/core/chat/view.js +5 -1
- package/src/core/chat/wake.js +386 -0
- package/src/core/config.js +36 -10
- package/src/core/projection.js +43 -24
- package/src/core/task-contract.js +3 -3
package/README.md
CHANGED
|
@@ -81,7 +81,9 @@ hook definitions with `/hooks` in the CLI. Installation does not grant hook trus
|
|
|
81
81
|
Bind a mailbox role with `keel mail role --set codex-maint`; trusted hooks announce
|
|
82
82
|
unread mail at session start and the next user input without marking it read.
|
|
83
83
|
If receiving hooks are unavailable, use `keel mail list` and `keel mail read`
|
|
84
|
-
explicitly. Codex
|
|
84
|
+
explicitly. Codex does not wake itself while idle; `keel chat wake add` in its worktree
|
|
85
|
+
starts a turn when something addressed to it arrives (#203). Native write-guard
|
|
86
|
+
enforcement remains unverified.
|
|
85
87
|
See the [Codex acceptance record](docs/codex-validation.md) for versions, runtime
|
|
86
88
|
evidence, limitations and the clean-consumer Full-mode check.
|
|
87
89
|
|
|
@@ -132,6 +134,20 @@ keel context # what to do now, recomputed from OpenSpec + Git
|
|
|
132
134
|
keel --doctor # check everything is wired up
|
|
133
135
|
```
|
|
134
136
|
|
|
137
|
+
To refresh OpenSpec's generated templates, run `keel openspec update`. After a
|
|
138
|
+
successful update, Keel restores its overlays for every target installed in the
|
|
139
|
+
repository. `keel --doctor` also reports overlay health for the other installed
|
|
140
|
+
targets, so healthy Claude coverage cannot hide missing Codex overlays.
|
|
141
|
+
|
|
142
|
+
Subagent use is the model's execution choice, subject to the host's policy.
|
|
143
|
+
`keel project --event subagent-start --change <change> --task <id>` produces a
|
|
144
|
+
read-only helper brief without extra activation. Add `--subagent-mode implementation`
|
|
145
|
+
for a delegate inside the task's Touch boundary; it requires an implementation
|
|
146
|
+
task and a matching active guard, while `delegation.tier` is optional metadata.
|
|
147
|
+
The current agent reviews returns, re-runs verification, and owns completion.
|
|
148
|
+
This CLI projects a brief; it does not spawn an agent or prove hook enforcement.
|
|
149
|
+
Native goal activation still requires explicit authorization.
|
|
150
|
+
|
|
135
151
|
Do the spec work through OpenSpec's commands (`/opsx:propose`, `/opsx:apply`, `/opsx:sync`,
|
|
136
152
|
`/opsx:archive`). Keel's gates run at the task boundaries. The whole loop:
|
|
137
153
|
|
|
@@ -159,7 +175,7 @@ because a permission granted in conversation does not survive a context reset. D
|
|
|
159
175
|
`keel/config.yaml` instead:
|
|
160
176
|
|
|
161
177
|
```yaml
|
|
162
|
-
authorize: # accepted names: commit, push, release, archive, continuation, issue:<owner>/<repo>, protocol-refresh
|
|
178
|
+
authorize: # accepted names: commit, push, release, archive, continuation, issue:<owner>/<repo>, protocol-refresh, chat-reply:<group>
|
|
163
179
|
- commit
|
|
164
180
|
- push
|
|
165
181
|
```
|
|
@@ -178,9 +194,9 @@ question — still stops. It authorizes no repository action and schedules nothi
|
|
|
178
194
|
whose vocabulary predates the word, the entry is unrecognized and the whole declaration authorizes
|
|
179
195
|
nothing until corrected — fail-closed, never a silent grant.
|
|
180
196
|
|
|
181
|
-
`issue:<owner>/<repo>`, the sixth name,
|
|
182
|
-
|
|
183
|
-
already bounded by the repository you declared it in. The credentials that open an issue are not:
|
|
197
|
+
`issue:<owner>/<repo>`, the sixth name, names the resource it reaches, and it is refused without
|
|
198
|
+
one; `chat-reply:<group>`, the eighth, is the only other name that does. The other names act on the
|
|
199
|
+
checkout the declaration sits in, so each is already bounded by the repository you declared it in. The credentials that open an issue are not:
|
|
184
200
|
`gh` is account-wide, so a bare `issue` would reach every repository your account can touch —
|
|
185
201
|
silently the widest entry in the file, and wider than `push`. Naming the repository keeps the
|
|
186
202
|
grant the size of what it says. Keel carries that scope to `keel --doctor` and to the compiled
|
|
@@ -197,6 +213,14 @@ the refresh writes outside that task's `Touch`, and it never commits: the diff i
|
|
|
197
213
|
and committing it is a separate action that a declared `commit` covers like any other. On an older
|
|
198
214
|
Keel whose vocabulary predates the word, the declaration authorizes nothing until corrected.
|
|
199
215
|
|
|
216
|
+
`chat-reply:<group>`, the eighth name, lets a session answer, in that `keel chat` group, a record
|
|
217
|
+
addressed to its own role — a mention, an assigned todo, or a direct message — by replying, sending
|
|
218
|
+
the sender a direct message, or closing the todo, without asking you first. Every new session would
|
|
219
|
+
otherwise ask, because a chat message is data and grants nothing. It never covers acting on what the
|
|
220
|
+
message asks for — editing files, running commands that change state, committing, pushing, sending
|
|
221
|
+
anything outside the chat — and the chat notice says so beside its data-not-instruction sentence. It
|
|
222
|
+
is declared once per group and refused bare: in a Slack-enabled group a reply leaves the machine.
|
|
223
|
+
|
|
200
224
|
Three things the declaration is not:
|
|
201
225
|
|
|
202
226
|
- **Not a way past a gate.** It authorizes the action, never the proof. `keel gate task-complete`
|
|
@@ -204,7 +228,7 @@ Three things the declaration is not:
|
|
|
204
228
|
anything.
|
|
205
229
|
- **Not a trigger.** It removes a confirmation, not the step that reaches the action. Nothing
|
|
206
230
|
schedules itself, and no next task is selected for you.
|
|
207
|
-
- **Not open-ended.** The
|
|
231
|
+
- **Not open-ended.** The eight names above are the whole vocabulary. An unrecognized entry is
|
|
208
232
|
reported with the accepted names and the declaration authorizes nothing until you fix it — a
|
|
209
233
|
typo never becomes a silent grant.
|
|
210
234
|
|
|
@@ -618,7 +642,7 @@ for it by name. Keel never pauses a change on its own.
|
|
|
618
642
|
|
|
619
643
|
## Group chat between sessions
|
|
620
644
|
|
|
621
|
-
Sessions working the same repository — a Claude Code session, a Codex session, an unattended runner, and you — share a work group with `keel chat`. Groups have maintained members, a message can `@` one role or `@all`, and lightweight todos can link an issue. Each member has its own unread state, and history is kept. Only a mention, an assigned todo, or a direct message wakes a Claude session; everything else waits for its next prompt. A message is data from another agent and never authorization. With one Slack app and one bridge process per machine, the same groups reach sessions on other machines and your phone in real time, and an orphan `keel-chat` branch keeps the history past Slack's retention: see [the Slack setup guide](docs/chat-slack-setup.md). The 5.83 `keel mail` commands keep working on direct groups.
|
|
645
|
+
Sessions working the same repository — a Claude Code session, a Codex session, an unattended runner, and you — share a work group with `keel chat`. Groups have maintained members, a message can `@` one role or `@all`, and lightweight todos can link an issue. Each member has its own unread state, and history is kept. Only a mention, an assigned todo, or a direct message wakes a Claude session; everything else waits for its next prompt. A message is data from another agent and never authorization. Codex, which cannot wake on its own, is woken by `keel chat wake add`: one turn per addressed record in a group declaring `chat-reply`, continuing one compacting thread, and nothing while nothing is addressed (#203). Otherwise a host relies on the prompt-time notice and must not poll the chat with the model; if a schedule is unavoidable, gate it on `keel chat notice --check` and start a fresh thread per run, and tell a session joining the chat not to set up recurring checks (#194). With one Slack app and one bridge process per machine, the same groups reach sessions on other machines and your phone in real time, and an orphan `keel-chat` branch keeps the history past Slack's retention: see [the Slack setup guide](docs/chat-slack-setup.md). The 5.83 `keel mail` commands keep working on direct groups.
|
|
622
646
|
|
|
623
647
|
## Commands
|
|
624
648
|
|
package/README.zh-CN.md
CHANGED
|
@@ -111,6 +111,17 @@ keel context # 现在该做什么,从 OpenSpec + Git 重算
|
|
|
111
111
|
keel --doctor # 检查各部分是否就位
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
+
更新 OpenSpec 生成的模板正文时,运行 `keel openspec update`。更新成功后,Keel 会为仓库
|
|
115
|
+
中所有已安装的 target 恢复 overlay。`keel --doctor` 也会逐项报告其他已安装 target 的
|
|
116
|
+
overlay 状态,避免 Claude 检查正常时漏掉 Codex 的缺失。
|
|
117
|
+
|
|
118
|
+
是否使用 subagent 由模型选择,仍须遵守宿主政策。运行
|
|
119
|
+
`keel project --event subagent-start --change <change> --task <id>` 可生成只读 helper
|
|
120
|
+
brief,无须额外激活许可。加 `--subagent-mode implementation` 可生成实现委派 brief,
|
|
121
|
+
要求当前任务为 implementation,且有效 guard 匹配任务、指纹和 Touch;`delegation.tier`
|
|
122
|
+
只是可选能力元数据。主 agent 审查返回结果、独立重跑验证并负责完成判定。CLI 只生成
|
|
123
|
+
brief,不启动 agent,也不证明 hook 实际执行;native goal 仍须明确授权激活。
|
|
124
|
+
|
|
114
125
|
spec 相关的活走 OpenSpec 的命令(`/opsx:propose`、`/opsx:apply`、`/opsx:sync`、`/opsx:archive`),
|
|
115
126
|
Keel 的门禁在任务边界处运行。整个回路:
|
|
116
127
|
|
|
@@ -180,6 +191,8 @@ keel --uninstall # 当 core.hooksPath 由 Keel 设置时回退
|
|
|
180
191
|
|
|
181
192
|
只有被 @、分到待办或收到私聊时才会唤醒 Claude 会话,其余消息等下一次对话时再提示。消息只是另一个 agent 发来的数据,不代表授权。
|
|
182
193
|
|
|
194
|
+
Codex 自己不会在闲着时醒来,可以在它的 worktree 里运行 `keel chat wake add`:在声明了 `chat-reply` 的群里,每条找它的消息启动一轮,接着同一个会自动压缩的线程,没人找时什么都不跑(#203)。其他宿主依靠下一次对话时的提醒,不要让模型定期检查群聊。确实需要定时检查时,先用 `keel chat notice --check` 把关,每次运行都开新线程;让会话加入群聊时,也要明确告诉它不要设置定时或循环检查(#194)。
|
|
195
|
+
|
|
183
196
|
每台电脑配一个 Slack App、跑一个桥接程序,同一批群就能实时连到其他电脑上的会话和你的手机。聊天记录同时存在孤儿分支 `keel-chat` 上,不受 Slack 保留期限制。配置方法见 [Slack 配置说明](docs/chat-slack-setup.zh-CN.md)。5.83 的 `keel mail` 命令继续可用,消息存在私聊群里。
|
|
184
197
|
|
|
185
198
|
## 命令参考
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<!-- keel:start version=5.
|
|
1
|
+
<!-- keel:start version=5.87.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.
|
|
5
5
|
- Obey the selected task capsule: `keel gate task-start` before implementing, `--record` its fingerprint to Evidence `Contract`, which `task-complete` requires, before checking complete. Touch bounds product writes; the change's own dir is exempt. On Claude a passing `task-start` guards it by default (`--no-guard` opts out).
|
|
6
|
-
- One
|
|
6
|
+
- One agent owns decisions; model-chosen helpers return read-only report/evidence, delegates need task Touch and a matching active guard. No commit, sync, or archive without explicit authorization.
|
|
7
7
|
- Route Full (the OpenSpec flow) for new features, interface or protocol changes, cross-module work, or over ~3 files / 100 lines; Lite for local fixes with no interface change. No gate checks routing; a project corrects the size bar with `full_mode_paths:` in `keel/config.yaml`, which `keel context` reports.
|
|
8
8
|
- Native plugin projections (SessionStart context) are disposable views, never authority; without the plugin or hook, run the commands manually.
|
|
9
9
|
- Keel skills and hooks come from the `keel` native plugin (`codex plugin add` / `claude plugin install`); `keel --init` owns only the OpenSpec schema, overlays, and this bootstrap.
|
|
@@ -124,8 +124,8 @@ artifacts:
|
|
|
124
124
|
|
|
125
125
|
Execution recommendation and Rationale are advisory notes for the current
|
|
126
126
|
Keel agent. Keel-managed work executes in the current agent conversation;
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
retain task decisions in the current agent; bounded helpers and guarded
|
|
128
|
+
implementation delegates are model choices, subject to host policy.
|
|
129
129
|
Autonomy boundary defaults to hard-stop for every action the repository
|
|
130
130
|
has not standing-authorized in `keel/config.yaml`; a declared action is
|
|
131
131
|
inherited only by a task that authored no boundary of its own, and the
|
|
@@ -193,7 +193,7 @@ apply:
|
|
|
193
193
|
5. If a selected task lacks an execution contract, source expectations, or accepted hidden-knowledge assumptions raised by risk-triggered deep alignment or a domain lens, update OpenSpec first instead of dispatching implementation.
|
|
194
194
|
6. Rough future slices may remain non-executable drafts, but they cannot be selected for implementation or marked complete.
|
|
195
195
|
7. The current Keel agent remains task owner and executor. Treat any Execution recommendation as an advisory implementation note, not as a completion gate.
|
|
196
|
-
8.
|
|
196
|
+
8. Keep task decisions in the current agent; model-chosen helpers are read-only and implementation delegates require task write authority and a matching active guard. Host policy remains authoritative. Keep task selection, implementation, verification, and failure recovery in the current agent conversation.
|
|
197
197
|
9. Use the current checkout and selected task contract. Verification failure or context pressure preserves the checkout; continue from evidence, record a blocker, or explicitly roll back to last-green only when authorized.
|
|
198
198
|
10. When `Coupling: required`, verify design.md contains a Coupled Iteration Contract and that the task defines a complete candidate, completion gate, and evidence. If not, update OpenSpec instead of execution.
|
|
199
199
|
11. The current agent may read any repository file needed for the selected task, but repository-wide read authority is read-only and does not expand write authority.
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
defaults: Owner is the current Keel agent, Mode is implementation, Read
|
|
4
4
|
is the change proposal/design/specs/tasks plus discovered repository
|
|
5
5
|
context, Acceptance derives from Covers, Coupling defaults to none,
|
|
6
|
-
helpers stay read-only/evidence-only
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
helpers stay read-only/evidence-only; model-chosen implementation delegates
|
|
7
|
+
need task write authority and a matching active guard. `Delegation: <tier>`
|
|
8
|
+
optionally overrides capability metadata from `keel/config.yaml`. Autonomy defaults to hard-stop, and
|
|
9
9
|
commit, push, sync, archive, and cross-task continuation stay unauthorized,
|
|
10
10
|
EXCEPT where `keel/config.yaml` standing-authorizes an action: a task that
|
|
11
11
|
authors no `Autonomy boundary:` inherits that declaration, and the capsule
|
package/bin/keel.js
CHANGED
|
@@ -96,7 +96,7 @@ const HELP = `keel ${PACKAGE_JSON.version}
|
|
|
96
96
|
Usage:
|
|
97
97
|
keel context [repo] [--change name] [--task id] [--json] [--clear-handoff]
|
|
98
98
|
keel capabilities [repo] [--target claude|codex|opencode] [--json]
|
|
99
|
-
keel project [repo] --target claude|codex|opencode --event startup|resume|compaction|goal|task-view|worktree|subagent-start|subagent-stop [--authorize goal|task-view|subagent] [--expected-owner owner] [--native-complete] [--change name] [--task id] [--json]
|
|
99
|
+
keel project [repo] --target claude|codex|opencode --event startup|resume|compaction|goal|task-view|worktree|subagent-start|subagent-stop [--authorize goal|task-view|subagent] [--subagent-mode helper|implementation] [--expected-owner owner] [--native-complete] [--change name] [--task id] [--json]
|
|
100
100
|
keel project tasks [repo] --target claude [--change name] [--json]
|
|
101
101
|
keel gate task-start|task-complete [repo] [--change name] [--task id] [--base git-ref] [--no-guard] [--record] [--keep-evidence M1,M3] [--json]
|
|
102
102
|
keel gate change-close [repo] [--change name] --action sync|archive [--base git-ref] [--json]
|
|
@@ -202,6 +202,7 @@ function parseArgs(argv) {
|
|
|
202
202
|
openspecArgs: [],
|
|
203
203
|
force: false,
|
|
204
204
|
projectionEvent: null,
|
|
205
|
+
subagentMode: null,
|
|
205
206
|
authorizations: [],
|
|
206
207
|
expectedOwner: null,
|
|
207
208
|
nativeComplete: false,
|
|
@@ -342,7 +343,7 @@ function parseArgs(argv) {
|
|
|
342
343
|
parsed[key] = argv[index];
|
|
343
344
|
continue;
|
|
344
345
|
}
|
|
345
|
-
if (arg === "--event" || arg === "--authorize" || arg === "--expected-owner") {
|
|
346
|
+
if (arg === "--event" || arg === "--authorize" || arg === "--expected-owner" || arg === "--subagent-mode") {
|
|
346
347
|
index += 1;
|
|
347
348
|
if (index >= argv.length) {
|
|
348
349
|
fail(`${arg} requires a value`);
|
|
@@ -352,7 +353,8 @@ function parseArgs(argv) {
|
|
|
352
353
|
parsed.authorizations.push(argv[index]);
|
|
353
354
|
}
|
|
354
355
|
} else {
|
|
355
|
-
const key = arg === "--event" ? "projectionEvent"
|
|
356
|
+
const key = arg === "--event" ? "projectionEvent"
|
|
357
|
+
: arg === "--subagent-mode" ? "subagentMode" : "expectedOwner";
|
|
356
358
|
if (parsed[key] !== null) fail(`${arg} was provided more than once`);
|
|
357
359
|
parsed[key] = argv[index];
|
|
358
360
|
}
|
|
@@ -540,6 +542,13 @@ function parseArgs(argv) {
|
|
|
540
542
|
if (parsed.action !== "context" && parsed.clearHandoff) {
|
|
541
543
|
fail("--clear-handoff applies only to keel context");
|
|
542
544
|
}
|
|
545
|
+
if (parsed.subagentMode !== null && (
|
|
546
|
+
parsed.action !== "project" || parsed.projectSubcommand !== null
|
|
547
|
+
|| !["subagent-start", "subagent-stop"].includes(parsed.projectionEvent)
|
|
548
|
+
|| !["helper", "implementation"].includes(parsed.subagentMode)
|
|
549
|
+
)) {
|
|
550
|
+
fail("--subagent-mode helper|implementation applies only to subagent lifecycle projection");
|
|
551
|
+
}
|
|
543
552
|
if (
|
|
544
553
|
parsed.action === "capabilities"
|
|
545
554
|
&& (
|
|
@@ -1468,7 +1477,7 @@ function keelOpenSpecOverlay(action) {
|
|
|
1468
1477
|
"- Run the Slice Start Gate: selected current slices must name source expectations and include Read, Touch, Acceptance, Commands, and Stop/Autonomy boundaries before implementation.",
|
|
1469
1478
|
"- Rough future slices may remain drafts, but cannot be selected for implementation or marked complete.",
|
|
1470
1479
|
"- Obey the selected task contract: Read is required starting context, Touch is the write boundary, Commands prove Acceptance, and the Autonomy boundary controls fallback decisions.",
|
|
1471
|
-
"- A target-native helper returns report/evidence only, and a
|
|
1480
|
+
"- A target-native helper returns report/evidence only, and a model-chosen guarded delegate may write inside `Touch`; both cannot mark tasks complete, update OpenSpec state, commit, sync, archive, or change Acceptance.",
|
|
1472
1481
|
"- The current agent reviews all subagent output, command evidence, and diffs before marking any task complete.",
|
|
1473
1482
|
"- When implementation exposes a material expectation, acceptance boundary, or user-owned decision absent from durable authority, stop before implementing that choice, rerun `keel-align-expectations`, and reauthor the affected proposal/design/spec/task authority first.",
|
|
1474
1483
|
"- A discovered repository fact that does not change accepted behavior or scope may be recorded and execution continues inside the existing task boundary without a product interview.",
|
|
@@ -1500,11 +1509,11 @@ function keelOpenSpecOverlay(action) {
|
|
|
1500
1509
|
"### Target-native subagent gate",
|
|
1501
1510
|
"",
|
|
1502
1511
|
"- The current agent remains responsible for Keel ownership, task/archive decisions, scope control, and final reporting.",
|
|
1503
|
-
"- Use a target-native subagent when the current agent decides it is useful for a bounded helper step, or as a delegate implementing the selected task
|
|
1512
|
+
"- Use a target-native subagent when the current agent decides it is useful for a bounded helper step, or as a delegate implementing the selected task using existing task write authority when a guard manifest is active and matches the task, fingerprint and Touch; optional `delegation:` tiers are metadata.",
|
|
1504
1513
|
"- Target-native subagents acting as helpers return report/evidence only. A delegate may write, and only inside `Touch`; its reported command results are a claim, and the current agent re-runs each `M<n>` check itself before recording Evidence.",
|
|
1505
1514
|
"- Delegation is refused with no active guard manifest, because an absent manifest passes every write through silently and looks identical to a checked one.",
|
|
1506
1515
|
"- Neither may mark tasks complete, update OpenSpec state, commit, sync, archive, or change Acceptance; the current agent reviews all output before acting.",
|
|
1507
|
-
"- The subagent brief must name the selected change/task, required read context, allowed write boundary or read-only diagnostic scope, expected commands/evidence, and prohibited actions. Compile it with `keel project --event subagent-start
|
|
1516
|
+
"- The subagent brief must name the selected change/task, required read context, allowed write boundary or read-only diagnostic scope, expected commands/evidence, and prohibited actions. Compile it with `keel project --event subagent-start` for a read-only helper or add `--subagent-mode implementation` for a guarded delegate; no extra user activation is required. Host policy remains authoritative; Keel adds no separate carrier because the host already has one.",
|
|
1508
1517
|
"- Prohibited actions include scope expansion, Acceptance changes, completion marking, sync/archive decisions, commits, handoff changes, and cross-runtime delegation unless the selected task or user explicitly authorizes them.",
|
|
1509
1518
|
...actionBody,
|
|
1510
1519
|
OPENSPEC_SURFACE_OVERLAY_END,
|
|
@@ -1648,6 +1657,36 @@ function overlayRemediation(target) {
|
|
|
1648
1657
|
return `run keel --init --target ${target} or keel --install --target ${target}`;
|
|
1649
1658
|
}
|
|
1650
1659
|
|
|
1660
|
+
// Only repository-owned surfaces enroll a target. Global Codex prompts can
|
|
1661
|
+
// belong to a different project and must not cause this one to be rewritten.
|
|
1662
|
+
function installedOpenSpecTargets(repo) {
|
|
1663
|
+
return ["claude", "codex", "opencode"].filter((target) => {
|
|
1664
|
+
const roots = target === "codex"
|
|
1665
|
+
? [".agents/skills", ".codex/skills"]
|
|
1666
|
+
: [openspecSkillRootForTarget(target, repo)];
|
|
1667
|
+
return roots.some((root) => OPENSPEC_SKILLS.some((skill) =>
|
|
1668
|
+
fs.existsSync(path.join(repo, root, skill, "SKILL.md"))
|
|
1669
|
+
)) || (target !== "codex" && commandSurfaceForTarget(target, repo).paths
|
|
1670
|
+
.some((file) => fs.existsSync(file)));
|
|
1671
|
+
});
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
function printAdditionalOverlayHealth(repo, selectedTarget) {
|
|
1675
|
+
for (const target of installedOpenSpecTargets(repo)) {
|
|
1676
|
+
if (target === selectedTarget) continue;
|
|
1677
|
+
const counts = countOpenSpecOverlays(
|
|
1678
|
+
openspecOverlaySurfacesForTarget(target, repo).map((surface) => surface.path)
|
|
1679
|
+
);
|
|
1680
|
+
const name = { claude: "Claude", codex: "Codex", opencode: "OpenCode" }[target];
|
|
1681
|
+
printDoctorLine(
|
|
1682
|
+
`${name} Keel ${overlayActionLabel()} overlay`,
|
|
1683
|
+
surfaceStatus(counts),
|
|
1684
|
+
`${formatCount(counts, "skills and commands")}`
|
|
1685
|
+
+ (surfaceStatus(counts) === "ok" ? "" : `; ${overlayRemediation(target)}`)
|
|
1686
|
+
);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1651
1690
|
function printTargetSurface(repo, target) {
|
|
1652
1691
|
process.stdout.write("\nTarget surface:\n");
|
|
1653
1692
|
|
|
@@ -1924,6 +1963,7 @@ function runDoctor(options) {
|
|
|
1924
1963
|
}
|
|
1925
1964
|
|
|
1926
1965
|
printTargetSurface(repo, options.target);
|
|
1966
|
+
printAdditionalOverlayHealth(repo, options.target);
|
|
1927
1967
|
printLensSurface(repo, options.target);
|
|
1928
1968
|
const authorizationOk = printStandingAuthorizationSurface(repo);
|
|
1929
1969
|
printPrecedentSurface(repo);
|
|
@@ -2320,7 +2360,15 @@ function runAction(options) {
|
|
|
2320
2360
|
);
|
|
2321
2361
|
return 1;
|
|
2322
2362
|
}
|
|
2323
|
-
|
|
2363
|
+
const status = runCommand(openspec, options.openspecArgs, { stdio: "inherit" });
|
|
2364
|
+
if (status !== 0 || options.openspecArgs[0] !== "update") return status;
|
|
2365
|
+
const repo = process.cwd();
|
|
2366
|
+
for (const target of installedOpenSpecTargets(repo)) {
|
|
2367
|
+
process.stdout.write(`keel: restoring ${target} OpenSpec overlays after update\n`);
|
|
2368
|
+
const result = refreshOpenSpecSurfaceOverlay(repo, target);
|
|
2369
|
+
if (result.status !== 0) return result.status;
|
|
2370
|
+
}
|
|
2371
|
+
return status;
|
|
2324
2372
|
}
|
|
2325
2373
|
|
|
2326
2374
|
if (options.action === "context") {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@christang/keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.87.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.87.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.87.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.87.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",
|
|
@@ -12,6 +12,6 @@ Thin Claude adapter for the `keel-run-single-task-goal` skill. It activates one
|
|
|
12
12
|
- Activation: compile the view with `keel project goal --target claude --change C --task T --json`; the goal condition stays within the 4,000-character budget, and Keel refuses activation rather than omit Acceptance, fingerprint, or stop authority.
|
|
13
13
|
- Evidence: Claude's evaluator is transcript-only, so surface every command result and gate outcome before any success claim; only `keel gate task-complete` plus the current agent's durable checkbox complete the task.
|
|
14
14
|
- Helpers: Claude subagents used as helpers are bounded read-only evidence producers via `keel project helper`; they carry no write, delegation, acceptance, or completion authority, and their returns are accepted only after repository byte identity.
|
|
15
|
-
- Delegates:
|
|
15
|
+
- Delegates: the model may choose implementation inside task `Touch` with a matching active guard; optional `delegation:` tiers are metadata, not extra permission. The current agent keeps sole write authority, re-runs each `M<n>` check itself before recording Evidence, and owns Review, gates, the checkbox, and completion. Host policy remains authoritative.
|
|
16
16
|
- Stop: terminate after one task on completion, drift, blocker, or premature native success; continuing requires a new explicit authorization and start fingerprint.
|
|
17
17
|
- Fallback: with disabled hooks, managed policy, or missing trust, report and run the identical manual Keel loop.
|
|
@@ -10,7 +10,7 @@ role: single-task-goal-activation
|
|
|
10
10
|
Thin Codex adapter for the `keel-run-single-task-goal` skill. It activates one bounded goal for exactly one authorized OpenSpec task and never introduces a scheduler, global stop hook, agent team, or cross-task authority.
|
|
11
11
|
|
|
12
12
|
- Activation: compile the view with `keel project goal --target codex --change C --task T --json`, then follow the single-task goal lifecycle. Where no callable goal surface exists, surface the exact command and treat the capability as advisory.
|
|
13
|
-
- Ownership: the current agent stays the sole holder of write authority and owns Review, gates, the checkbox, and completion; a native evaluator success never completes the task. A
|
|
13
|
+
- Ownership: the current agent stays the sole holder of write authority and owns Review, gates, the checkbox, and completion; a native evaluator success never completes the task. A model-chosen delegate writes only inside task `Touch` with a matching active guard, and the current agent re-runs each `M<n>` check before recording Evidence. Optional tiers are metadata; host policy remains authoritative.
|
|
14
14
|
- Helpers: Codex subagents are used only as bounded read-only evidence producers via `keel project helper`; they carry no write, delegation, acceptance, or completion authority, and their returns are accepted only after repository byte identity.
|
|
15
15
|
- Stop: terminate after one task on completion, drift, blocker, or premature native success; continuing requires a new explicit authorization and start fingerprint.
|
|
16
16
|
- Fallback: without a callable Codex surface, run the identical manual Keel loop.
|
|
@@ -11,7 +11,7 @@ metadata:
|
|
|
11
11
|
|
|
12
12
|
## Purpose
|
|
13
13
|
|
|
14
|
-
Activate a native goal
|
|
14
|
+
Activate a native goal runtime to execute exactly one authorized OpenSpec task end to end, while OpenSpec, Git, the task-capsule fingerprint, and deterministic Keel gates stay the only durable authority. The current agent remains the sole holder of write authority and owns Review, gate invocation, the task checkbox, and completion. A model-chosen implementation delegate with a matching active guard may write inside the `Touch` boundary that authority already defined and acquires none of those decisions; the current agent re-runs each `M<n>` check itself before recording Evidence, because a delegate's reported result is a claim and the byte-identity check that validates a read-only helper cannot apply to a writer. A native evaluator declaring success never marks or reports the task complete.
|
|
15
15
|
|
|
16
16
|
## Guidance
|
|
17
17
|
|
|
@@ -34,7 +34,7 @@ Activate only on an explicit, unambiguous request to automatically execute or re
|
|
|
34
34
|
- Proposal, design, or spec authoring before tasks are final.
|
|
35
35
|
- Ambiguous selection, multiple tasks, or a whole task group or change backlog.
|
|
36
36
|
- An unrelated native `/goal` use that is not a Keel OpenSpec task.
|
|
37
|
-
-
|
|
37
|
+
- Ordinary helper use, which does not activate a native goal. Model-chosen implementation delegates still require task write authority and a matching active guard.
|
|
38
38
|
- OpenCode, which stays manual compatibility only with no v4 native activation.
|
|
39
39
|
|
|
40
40
|
If any of these hold, stop and use the normal manual Keel loop.
|
|
@@ -23,7 +23,7 @@ in the transcript, `keel gate task-complete`, check the box. What changes is who
|
|
|
23
23
|
## Per-target activation notes
|
|
24
24
|
|
|
25
25
|
- **Codex**: where a callable goal or subagent surface exists, activate one bounded goal for the
|
|
26
|
-
selected task
|
|
26
|
+
selected task; choose helpers or guarded implementation delegates under the task contract and host policy. Without a callable surface, paste
|
|
27
27
|
the exact `keel project goal` command and treat the capability as advisory.
|
|
28
28
|
- **Claude**: activate one `/goal` whose condition fits the 4,000-character budget. The evaluator sees
|
|
29
29
|
the transcript only, so command and gate evidence has to appear there explicitly. If hooks are
|