@christang/keel 5.82.0 → 5.84.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/assets/bootstrap/AGENTS.md +1 -1
- package/bin/keel.js +6 -0
- 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/scripts/mail-hook.js +75 -0
- package/plugins/keel/skills/keel-review-checklist/SKILL.md +1 -2
- package/scripts/validate_plugin.py +537 -14
- package/src/core/gates.js +150 -2
- package/src/core/mail.js +541 -0
- package/src/core/task-contract.js +4 -1
package/bin/keel.js
CHANGED
|
@@ -102,6 +102,7 @@ Usage:
|
|
|
102
102
|
keel gate change-close [repo] [--change name] --action sync|archive [--base git-ref] [--json]
|
|
103
103
|
keel guard start|status|clear [repo] [--change name] [--task id] [--force] [--json]
|
|
104
104
|
keel lenses list|add [name] [repo] [--force]
|
|
105
|
+
keel mail role|send|list|read|hook [repo] ... (cross-host mailbox; see keel mail help)
|
|
105
106
|
keel triage [repo] [--labels <l1,l2>] [--issue <n>] [--json]
|
|
106
107
|
keel openspec [args...]
|
|
107
108
|
keel --init [repo] [--target claude|codex|opencode] [--dry-run] [--force-template-update]
|
|
@@ -2590,6 +2591,11 @@ function runAction(options) {
|
|
|
2590
2591
|
}
|
|
2591
2592
|
|
|
2592
2593
|
function main() {
|
|
2594
|
+
// `keel mail` parses its own arguments: it is host-neutral messaging between
|
|
2595
|
+
// sessions (#180), sharing no option with the gate and projection commands.
|
|
2596
|
+
if (process.argv[2] === "mail") {
|
|
2597
|
+
return require("../src/core/mail").runMail(process.argv.slice(3));
|
|
2598
|
+
}
|
|
2593
2599
|
const options = parseArgs(process.argv.slice(2));
|
|
2594
2600
|
if (options.help || (!options.action && !options.version)) {
|
|
2595
2601
|
printHelp();
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@christang/keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.84.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.84.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.84.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.84.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",
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// Keel plugin mailbox hook (issue #180), Claude Code only: SessionStart and
|
|
5
|
+
// UserPromptSubmit announce unread cross-host mail, and FileChanged — declared
|
|
6
|
+
// with `asyncRewake` and watching the role's signal file — wakes an idle
|
|
7
|
+
// session when mail arrives. The work is `keel mail hook <event>`; this script
|
|
8
|
+
// only finds the CLI the way session-start.js does and relays its stdin,
|
|
9
|
+
// output, and exit code, because exit 2 from FileChanged is the wake signal.
|
|
10
|
+
//
|
|
11
|
+
// Nothing here reads or moves a message, and a worktree with no mail role gets
|
|
12
|
+
// no output. A failure to run the CLI exits 0 silently: a missing notice costs
|
|
13
|
+
// a late read, while a spurious exit 2 would wake the session for nothing.
|
|
14
|
+
|
|
15
|
+
const fs = require("fs");
|
|
16
|
+
const path = require("path");
|
|
17
|
+
const { spawnSync } = require("child_process");
|
|
18
|
+
|
|
19
|
+
const EVENTS = new Set(["session-start", "user-prompt-submit", "file-changed"]);
|
|
20
|
+
const TIMEOUT_MS = Number(process.env.KEEL_HOOK_TIMEOUT_MS || 8000) || 8000;
|
|
21
|
+
|
|
22
|
+
function readStdin() {
|
|
23
|
+
try {
|
|
24
|
+
return fs.readFileSync(0, "utf8");
|
|
25
|
+
} catch {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Same order as session-start.js: an explicit KEEL_CLI, the CLI this plugin
|
|
31
|
+
// shipped with, then whatever `keel` is on PATH.
|
|
32
|
+
function keelCommand() {
|
|
33
|
+
const explicit = (process.env.KEEL_CLI || "").trim();
|
|
34
|
+
if (explicit) return explicit;
|
|
35
|
+
const root = path.join(__dirname, "..", "..", "..");
|
|
36
|
+
try {
|
|
37
|
+
const pkg = JSON.parse(
|
|
38
|
+
fs.readFileSync(path.join(root, "package.json"), "utf8")
|
|
39
|
+
);
|
|
40
|
+
const cli = path.join(root, "bin", "keel.js");
|
|
41
|
+
if (pkg.name === "@christang/keel" && fs.existsSync(cli)) {
|
|
42
|
+
return `"${process.execPath}" "${cli}"`;
|
|
43
|
+
}
|
|
44
|
+
} catch {
|
|
45
|
+
// No package around this script: the plugin was copied on its own.
|
|
46
|
+
}
|
|
47
|
+
return "keel";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function main() {
|
|
51
|
+
const event = process.argv[2];
|
|
52
|
+
if (!EVENTS.has(event)) return 0;
|
|
53
|
+
const input = readStdin();
|
|
54
|
+
let cwd = process.cwd();
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(input || "{}");
|
|
57
|
+
if (parsed && typeof parsed.cwd === "string" && parsed.cwd) cwd = parsed.cwd;
|
|
58
|
+
} catch {
|
|
59
|
+
// Keep the process cwd.
|
|
60
|
+
}
|
|
61
|
+
const result = spawnSync(`${keelCommand()} mail hook ${event}`, {
|
|
62
|
+
cwd,
|
|
63
|
+
shell: true,
|
|
64
|
+
input,
|
|
65
|
+
encoding: "utf8",
|
|
66
|
+
timeout: TIMEOUT_MS,
|
|
67
|
+
});
|
|
68
|
+
if (result.error || (result.status !== 0 && result.status !== 2)) return 0;
|
|
69
|
+
if (result.status === 2 && event !== "file-changed") return 0;
|
|
70
|
+
if (result.stdout) process.stdout.write(result.stdout);
|
|
71
|
+
if (result.stderr && result.status === 2) process.stderr.write(result.stderr);
|
|
72
|
+
return result.status;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
process.exitCode = main();
|
|
@@ -18,9 +18,8 @@ Read the selected OpenSpec proposal, design, specs, tasks, diff, and command evi
|
|
|
18
18
|
## Deterministic gate check
|
|
19
19
|
|
|
20
20
|
- Confirm the appropriate shared Core gate was run and its versioned result is `pass`.
|
|
21
|
-
- Confirm the task's Evidence `Contract` line records the task-start capsule fingerprint and that completion recompiled the same fingerprint; a drift result returns the task to authoring for explicit reauthorization instead of review.
|
|
22
21
|
- A behavioral task's checks must prove observable Acceptance through the public interface, not build-only or shape-only evidence.
|
|
23
|
-
-
|
|
22
|
+
- `task-complete` itself refuses a missing or drifted Contract anchor and missing `.red`/`.green` Evidence; a drift result returns the task to authoring for explicit reauthorization instead of review. What it cannot see is whether the evidence proves anything: evidence-first tasks name their observable proof.
|
|
24
23
|
- A failure message must **name the actual cause** of what it reports. Watch for one condition guarding **two distinct failures** — `if result is None or result["status"] != expected` reports the first failure's message when the second one happened, sending the reader to a place with no problem in it. Split the condition. No gate can judge this: deciding whether a sentence misleads needs a model, so it stays here.
|
|
25
24
|
- When two tasks in the change declared the same Touch set under a red-green strategy — `keel gate task-start` warns about this — ask whether they turned out to be **one behavior** split in half. The tell is that the first task's minimal implementation was wrong in the field, or that the second had no honest red left because the first already made its checks pass. The gate can only see the shape; by completion you can see the outcome, which is the only point at which this is answerable.
|
|
26
25
|
- Scope attribution is now the gate's job by default: `keel gate task-complete` compares the worktree against the dirty set `task-start` recorded and refuses a path outside Touch, so a `pass` is evidence about scope rather than silence about it. Two cases still need you. When the gate reports paths as *unattributed* — no recorded set, because the manifest predates the field or the guard was cleared — nothing was checked and the review is the only scope evidence. And a path already dirty when the task started stays unattributed only while its content matches what was recorded then; if the task changed it again, the gate attributes it — so read the gate's silence about such a path as evidence its content was never touched again, not as an unconditional exemption.
|