@christang/keel 5.231.12 → 5.232.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/.claude-plugin/plugin.json +1 -1
- package/README.md +5 -3
- package/README.zh-CN.md +5 -3
- package/assets/bootstrap/AGENTS.md +2 -2
- package/bin/keel.js +163 -24
- 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/hooks.json +23 -0
- package/plugins/keel/plugin.json +10 -0
- package/plugins/keel/scripts/pretooluse-guard.js +42 -1
- package/plugins/keel/scripts/session-start.js +47 -6
- package/scripts/bump_version.js +3 -0
- package/scripts/install_to_repo.py +4 -3
- package/scripts/test_codex_host.js +44 -0
- package/scripts/validation/agy.py +770 -0
- package/scripts/validation/baseline.py +19 -3
- package/scripts/validation/common.py +2 -2
- package/scripts/validation/hosts.py +7 -3
- package/scripts/validation/registry.py +7 -0
- package/src/core/capabilities.js +65 -13
- package/src/core/codex-host.js +18 -11
- package/src/core/gates.js +3 -3
- package/src/core/projection.js +1 -1
|
@@ -75,11 +75,15 @@ def validate_manifest(errors: list[str]) -> None:
|
|
|
75
75
|
"plugin release"
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
manifest_specs = (
|
|
79
|
+
("agy", ROOT / "plugins" / "keel" / "plugin.json"),
|
|
80
|
+
(".codex-plugin", ROOT / "plugins" / "keel" / ".codex-plugin" / "plugin.json"),
|
|
81
|
+
(".claude-plugin", ROOT / "plugins" / "keel" / ".claude-plugin" / "plugin.json"),
|
|
82
|
+
)
|
|
83
|
+
for runtime, manifest_path in manifest_specs:
|
|
80
84
|
if not manifest_path.is_file():
|
|
81
85
|
errors.append(
|
|
82
|
-
f"missing native plugin manifest:
|
|
86
|
+
f"missing native plugin manifest: {manifest_path.relative_to(ROOT).as_posix()}"
|
|
83
87
|
)
|
|
84
88
|
continue
|
|
85
89
|
try:
|
|
@@ -100,6 +104,18 @@ def validate_manifest(errors: list[str]) -> None:
|
|
|
100
104
|
f"package version {package_version!r}"
|
|
101
105
|
)
|
|
102
106
|
|
|
107
|
+
agy_hooks_path = ROOT / "plugins" / "keel" / "hooks.json"
|
|
108
|
+
if not agy_hooks_path.is_file():
|
|
109
|
+
errors.append("missing AGY root hook manifest: plugins/keel/hooks.json")
|
|
110
|
+
else:
|
|
111
|
+
try:
|
|
112
|
+
agy_hooks = json.loads(agy_hooks_path.read_text(encoding="utf-8"))
|
|
113
|
+
except json.JSONDecodeError as exc:
|
|
114
|
+
errors.append(f"plugins/keel/hooks.json is not valid JSON: {exc}")
|
|
115
|
+
else:
|
|
116
|
+
if not isinstance(agy_hooks, dict) or not isinstance(agy_hooks.get("keel"), dict):
|
|
117
|
+
errors.append("plugins/keel/hooks.json must declare a named hook 'keel'")
|
|
118
|
+
|
|
103
119
|
skills_root = ROOT / "plugins" / "keel" / "skills"
|
|
104
120
|
if not skills_root.is_dir():
|
|
105
121
|
errors.append("plugins/keel/skills must hold the canonical skill set")
|
|
@@ -35,10 +35,10 @@ os.environ["KEEL_UPDATE_CLAUDE"] = str(Path(tempfile.gettempdir()) / "keel-suite
|
|
|
35
35
|
os.environ["KEEL_UPDATE_CODEX"] = str(Path(tempfile.gettempdir()) / "keel-suite-has-no-codex")
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
PACKAGE_VERSION = "5.
|
|
38
|
+
PACKAGE_VERSION = "5.232.0"
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
PROTOCOL_VERSION = "5.
|
|
41
|
+
PROTOCOL_VERSION = "5.232.0"
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
|
|
@@ -110,12 +110,15 @@ def validate_version_alignment_scenario() -> int:
|
|
|
110
110
|
report(f"version-alignment scenario package.json expected {PACKAGE_VERSION}.")
|
|
111
111
|
return 1
|
|
112
112
|
|
|
113
|
-
for
|
|
114
|
-
|
|
113
|
+
for label, manifest_path in (
|
|
114
|
+
("agy", ROOT / "plugins" / "keel" / "plugin.json"),
|
|
115
|
+
(".codex-plugin", ROOT / "plugins" / "keel" / ".codex-plugin" / "plugin.json"),
|
|
116
|
+
(".claude-plugin", ROOT / "plugins" / "keel" / ".claude-plugin" / "plugin.json"),
|
|
117
|
+
):
|
|
115
118
|
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
|
116
119
|
if manifest.get("version") != PACKAGE_VERSION:
|
|
117
120
|
report(
|
|
118
|
-
f"version-alignment scenario native manifest {
|
|
121
|
+
f"version-alignment scenario native manifest {label} expected "
|
|
119
122
|
f"{PACKAGE_VERSION}."
|
|
120
123
|
)
|
|
121
124
|
return 1
|
|
@@ -161,6 +164,7 @@ def validate_version_alignment_scenario() -> int:
|
|
|
161
164
|
"npm-shrinkwrap.json",
|
|
162
165
|
".claude-plugin/marketplace.json",
|
|
163
166
|
".claude-plugin/plugin.json",
|
|
167
|
+
"plugins/keel/plugin.json",
|
|
164
168
|
"plugins/keel/.claude-plugin/plugin.json",
|
|
165
169
|
"plugins/keel/.codex-plugin/plugin.json",
|
|
166
170
|
"scripts/bump_version.js",
|
|
@@ -14,6 +14,7 @@ from validation import skipspecs
|
|
|
14
14
|
from validation import feedback
|
|
15
15
|
from validation import sync
|
|
16
16
|
from validation import codexhost
|
|
17
|
+
from validation import agy
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
@@ -585,6 +586,12 @@ SCENARIOS: tuple = (
|
|
|
585
586
|
("dsh-binary", dsh.validate_dsh_binary_scenario),
|
|
586
587
|
("dsh-uninstall-shared", dsh.validate_dsh_uninstall_shared_scenario),
|
|
587
588
|
("dsh-docs", dsh.validate_dsh_docs_scenario),
|
|
589
|
+
("agy-plugin-package", agy.validate_agy_plugin_package_scenario),
|
|
590
|
+
("agy-session-start", agy.validate_agy_session_start_scenario),
|
|
591
|
+
("agy-pretooluse-guard", agy.validate_agy_pretooluse_guard_scenario),
|
|
592
|
+
("agy-capabilities-project", agy.validate_agy_capabilities_project_scenario),
|
|
593
|
+
("agy-init-doctor-update", agy.validate_agy_init_doctor_update_scenario),
|
|
594
|
+
("agy-docs", agy.validate_agy_docs_scenario),
|
|
588
595
|
("change-close-skip-specs", skipspecs.validate_change_close_skip_specs_scenario),
|
|
589
596
|
("chat-wake-once", chatwake.validate_chat_wake_once_scenario),
|
|
590
597
|
("chat-wake-race", chatwake.validate_chat_wake_race_scenario),
|
package/src/core/capabilities.js
CHANGED
|
@@ -20,13 +20,18 @@ const CAPABILITY_COMMANDS = {
|
|
|
20
20
|
"keel project --target <target> --event worktree --expected-owner <owner> --json",
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
const SUPPORTED_TARGETS = new Set(["claude", "codex", "opencode", "dsh"]);
|
|
23
|
+
const SUPPORTED_TARGETS = new Set(["claude", "codex", "opencode", "dsh", "agy"]);
|
|
24
24
|
|
|
25
25
|
function codexHome() {
|
|
26
26
|
const configured = (process.env.CODEX_HOME || "").trim();
|
|
27
27
|
return path.resolve(configured || path.join(os.homedir(), ".codex"));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function agyConfigDir() {
|
|
31
|
+
const configured = (process.env.KEEL_AGY_CONFIG_DIR || "").trim();
|
|
32
|
+
return path.resolve(configured || path.join(os.homedir(), ".gemini", "config"));
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
// Keel's own repository ships the plugin source under plugins/keel/. A project
|
|
31
36
|
// that consumes Keel never has it, and `keel --init` never creates it, so any
|
|
32
37
|
// check reading that path is a development-only check. Require both signals so
|
|
@@ -57,12 +62,14 @@ function pluginObservation(repo, target) {
|
|
|
57
62
|
}
|
|
58
63
|
// The plugin source path is meaningful only in Keel's own repository.
|
|
59
64
|
if (!isKeelSourceRepo(repo)) return PLUGIN_RUNTIME_OBSERVATION;
|
|
60
|
-
const manifestRelative =
|
|
61
|
-
"plugins",
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
const manifestRelative = target === "agy"
|
|
66
|
+
? path.join("plugins", "keel", "plugin.json")
|
|
67
|
+
: path.join(
|
|
68
|
+
"plugins",
|
|
69
|
+
"keel",
|
|
70
|
+
target === "codex" ? ".codex-plugin" : ".claude-plugin",
|
|
71
|
+
"plugin.json"
|
|
72
|
+
);
|
|
66
73
|
const manifestPath = path.join(repo, manifestRelative);
|
|
67
74
|
let sourceState = `plugin source absent at ${manifestRelative}`;
|
|
68
75
|
if (fs.existsSync(manifestPath)) {
|
|
@@ -107,6 +114,20 @@ function targetObservation(repo, target) {
|
|
|
107
114
|
+ "0.2.2-rc.1, 2026-11-08), so the AGENTS.md bootstrap is the entry; "
|
|
108
115
|
+ "installation, trust and behavior are not verifiable from Keel"
|
|
109
116
|
);
|
|
117
|
+
} else if (target === "agy") {
|
|
118
|
+
const configDir = agyConfigDir();
|
|
119
|
+
const globalPluginsJson = path.join(configDir, "plugins.json");
|
|
120
|
+
const globalPluginsDir = path.join(configDir, "plugins", "keel", "plugin.json");
|
|
121
|
+
const wsPluginsDir = path.join(repo, ".agents", "plugins", "keel", "plugin.json");
|
|
122
|
+
const wsPluginsJson = path.join(repo, ".agents", "plugins.json");
|
|
123
|
+
const hasConfig = [globalPluginsJson, globalPluginsDir, wsPluginsDir, wsPluginsJson]
|
|
124
|
+
.some((candidate) => fs.existsSync(candidate));
|
|
125
|
+
observations.push(
|
|
126
|
+
hasConfig
|
|
127
|
+
? "AGY plugin configuration exists but enablement, trust, version, and "
|
|
128
|
+
+ "blocking behavior are unverified"
|
|
129
|
+
: "AGY activation evidence is unavailable"
|
|
130
|
+
);
|
|
110
131
|
} else if (target === "codex") {
|
|
111
132
|
const hooks = path.join(codexHome(), "hooks.json");
|
|
112
133
|
observations.push(
|
|
@@ -160,12 +181,12 @@ function probeCapabilities(repo, target) {
|
|
|
160
181
|
}
|
|
161
182
|
|
|
162
183
|
function guardDiagnostics(repo, target) {
|
|
163
|
-
// The write guard
|
|
164
|
-
// manifest-gated PreToolUse denial, but runtime
|
|
165
|
-
// reliable blocking cannot be verified from Keel Core,
|
|
166
|
-
// level stays advisory until behaviorally probed. Other
|
|
167
|
-
// verified guard hook surface and stay manual.
|
|
168
|
-
if (target !== "claude") {
|
|
184
|
+
// The write guard ships native PreToolUse hooks for Claude and AGY: the
|
|
185
|
+
// plugin ships deterministic manifest-gated PreToolUse denial, but runtime
|
|
186
|
+
// activation, trust, and reliable blocking cannot be verified from Keel Core,
|
|
187
|
+
// so the shipped level stays advisory until behaviorally probed. Other
|
|
188
|
+
// targets have no verified guard hook surface and stay manual.
|
|
189
|
+
if (target !== "claude" && target !== "agy") {
|
|
169
190
|
return {
|
|
170
191
|
enforcement: {
|
|
171
192
|
level: "manual",
|
|
@@ -176,6 +197,37 @@ function guardDiagnostics(repo, target) {
|
|
|
176
197
|
};
|
|
177
198
|
}
|
|
178
199
|
const manifestState = guardStatus(repo).status;
|
|
200
|
+
if (target === "agy") {
|
|
201
|
+
return {
|
|
202
|
+
hookDelivery: {
|
|
203
|
+
level: "advisory",
|
|
204
|
+
evidence:
|
|
205
|
+
"The keel plugin ships an AGY root hooks.json PreToolUse hook; "
|
|
206
|
+
+ "runtime activation, trust, and enablement need native runtime evidence.",
|
|
207
|
+
},
|
|
208
|
+
manifest: {
|
|
209
|
+
level: "advisory",
|
|
210
|
+
evidence: `keel/guard.json state observed as ${manifestState}.`,
|
|
211
|
+
},
|
|
212
|
+
enforcement: {
|
|
213
|
+
level: "advisory",
|
|
214
|
+
evidence:
|
|
215
|
+
"Out-of-Touch denial is deterministic in the shipped hook; promotion "
|
|
216
|
+
+ "above advisory requires behavioral runtime probe evidence of an "
|
|
217
|
+
+ "actual blocked call.",
|
|
218
|
+
},
|
|
219
|
+
boundary: {
|
|
220
|
+
level: "advisory",
|
|
221
|
+
evidence:
|
|
222
|
+
"The guard covers AGY file-edit tools (edit_file, write_file), and on "
|
|
223
|
+
+ "run_command only `git push` while keel/config.yaml declares "
|
|
224
|
+
+ "`push:<branch glob>`, `push-protected:<branch glob>`, or "
|
|
225
|
+
+ "`push-tag:<tag glob>`; pass-through emits empty stdout so AGY's "
|
|
226
|
+
+ "own permission policy stays authoritative, and paths outside the "
|
|
227
|
+
+ "repository are not product writes.",
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
}
|
|
179
231
|
return {
|
|
180
232
|
hookDelivery: {
|
|
181
233
|
level: "advisory",
|
package/src/core/codex-host.js
CHANGED
|
@@ -123,11 +123,17 @@ function deliveryKey(record) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
function deliveryReceipt(role, record) {
|
|
126
|
-
const
|
|
126
|
+
const {deliveries = {}} = role;
|
|
127
|
+
if (!deliveries || typeof deliveries !== "object" || Array.isArray(deliveries)) {
|
|
128
|
+
throw Error("managed delivery claim map invalid; outcome unknown");
|
|
129
|
+
}
|
|
130
|
+
const key = deliveryKey(record);
|
|
131
|
+
const present = Object.hasOwn(deliveries, key);
|
|
132
|
+
const claim = deliveries[key];
|
|
127
133
|
if (claim && claim.record !== record) throw Error("managed delivery claim identity mismatch");
|
|
128
134
|
const turn = claim?.state === "delivered" && typeof claim.turn === "string" && claim.turn ? claim.turn : null;
|
|
129
135
|
const thread = typeof claim?.thread === "string" && claim.thread ? claim.thread : null;
|
|
130
|
-
const state =
|
|
136
|
+
const state = turn ? "delivered" : present ? "unknown" : "unrecorded";
|
|
131
137
|
return { role: role.role, record, state, thread, turn };
|
|
132
138
|
}
|
|
133
139
|
|
|
@@ -357,6 +363,7 @@ async function run(args) {
|
|
|
357
363
|
: `Codex delivery ${receipt.record}: ${receipt.state}${receipt.thread ? ` (thread ${receipt.thread})` : ""}${suffix}`) + "\n");
|
|
358
364
|
return 0;
|
|
359
365
|
}
|
|
366
|
+
let priorReceipt;
|
|
360
367
|
if (action === "start" && !options.role) throw Error("start needs --role");
|
|
361
368
|
if (["deliver", "handover", "recover"].includes(action)) {
|
|
362
369
|
if (!recorded) throw Error("operation needs a managed --role");
|
|
@@ -367,7 +374,11 @@ async function run(args) {
|
|
|
367
374
|
// The durable decision must be read under the lock this call now owns.
|
|
368
375
|
recorded = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
369
376
|
if (recorded.state !== "managed" || recorded.role !== options.role || recorded.worktree !== where.worktree || recorded.socket !== options.socket) throw Error("managed role identity changed before operation lock");
|
|
370
|
-
if (action === "deliver"
|
|
377
|
+
if (action === "deliver") {
|
|
378
|
+
if (!options.record || !options.text) throw Error("deliver needs --record and --text");
|
|
379
|
+
priorReceipt = deliveryReceipt(recorded, options.record);
|
|
380
|
+
if (priorReceipt.state === "unknown") throw Error("delivery outcome unknown; claim retained, no retry started");
|
|
381
|
+
}
|
|
371
382
|
if (action === "handover" && !options.note) throw Error("handover needs --note");
|
|
372
383
|
}
|
|
373
384
|
if (action === "start") {
|
|
@@ -438,14 +449,8 @@ async function run(args) {
|
|
|
438
449
|
let thread = (await client.call("thread/read", {threadId: recorded.thread, includeTurns: false})).thread;
|
|
439
450
|
const owned = value => value && value.id === recorded.thread && value.cwd === recorded.worktree;
|
|
440
451
|
if (!owned(thread)) throw Error("managed role identity mismatch");
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
if (action === "deliver" && claims[key]) {
|
|
444
|
-
// Deduplication is a recorded outcome, not a reason to load a thread.
|
|
445
|
-
if (claims[key].state !== "delivered" || typeof claims[key].turn !== "string" || !claims[key].turn) {
|
|
446
|
-
throw Error("delivery outcome unknown; claim retained, no retry started");
|
|
447
|
-
}
|
|
448
|
-
Object.assign(result, {state: "already-delivered", turn: claims[key].turn});
|
|
452
|
+
if (priorReceipt?.state === "delivered") {
|
|
453
|
+
Object.assign(result, {state: "already-delivered", turn: priorReceipt.turn});
|
|
449
454
|
} else {
|
|
450
455
|
if (action === "deliver" && thread.status && (thread.status.type === "notLoaded" || ((recorded.approvalsReviewer || savedPolicy) && thread.status.type === "idle"))) {
|
|
451
456
|
// Only this recorded owned identity may be loaded. Keep this same
|
|
@@ -466,6 +471,8 @@ async function run(args) {
|
|
|
466
471
|
if (thread.status.type === "active") {
|
|
467
472
|
Object.assign(result, {state: "waiting", thread: recorded.thread});
|
|
468
473
|
} else if (action === "deliver") {
|
|
474
|
+
const claims = recorded.deliveries ?? {};
|
|
475
|
+
const key = deliveryKey(options.record);
|
|
469
476
|
claims[key] = {record: options.record, state: "pending", thread: recorded.thread};
|
|
470
477
|
let prompt = options.text;
|
|
471
478
|
if (require("./managed-task-result").currentTodo(where, recorded, options.record)) {
|
package/src/core/gates.js
CHANGED
|
@@ -662,11 +662,11 @@ function taskStartChecked(repo, options) {
|
|
|
662
662
|
);
|
|
663
663
|
// The disposable guard manifest and the explicit --record anchor
|
|
664
664
|
// replacement are the only permitted gate writes: each happens only on a
|
|
665
|
-
// passing task-start (guard: Claude target without --no-guard,
|
|
666
|
-
// any previous task's manifest in the one-shot single-task model).
|
|
665
|
+
// passing task-start (guard: Claude or AGY target without --no-guard,
|
|
666
|
+
// replacing any previous task's manifest in the one-shot single-task model).
|
|
667
667
|
if (
|
|
668
668
|
result.status === "pass"
|
|
669
|
-
&& (options.target || "claude")
|
|
669
|
+
&& ["claude", "agy"].includes(options.target || "claude")
|
|
670
670
|
&& !options.noGuard
|
|
671
671
|
) {
|
|
672
672
|
const guard = startGuard(repo, {
|
package/src/core/projection.js
CHANGED
|
@@ -81,7 +81,7 @@ function projectRuntime(repo, options) {
|
|
|
81
81
|
if (!EVENTS.has(event)) {
|
|
82
82
|
throw new Error(`unsupported projection event: ${event || "<missing>"}`);
|
|
83
83
|
}
|
|
84
|
-
if (!["claude", "codex", "opencode", "dsh"].includes(options.target)) {
|
|
84
|
+
if (!["claude", "codex", "opencode", "dsh", "agy"].includes(options.target)) {
|
|
85
85
|
throw new Error(`unsupported target: ${options.target}`);
|
|
86
86
|
}
|
|
87
87
|
|