@christang/keel 5.107.0 → 5.108.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 +1 -1
- package/assets/bootstrap/AGENTS.md +1 -1
- 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 +60 -2
- package/src/core/chat/cli.js +6 -6
- package/src/core/chat/store.js +30 -10
package/README.md
CHANGED
|
@@ -756,7 +756,7 @@ Without a known default branch, no issue range is inferred.
|
|
|
756
756
|
|
|
757
757
|
## Group chat between sessions
|
|
758
758
|
|
|
759
|
-
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. A record can supersede its author's earlier one (`--supersedes <id>`), and the earlier one then leaves everyone's unread; unread lists newest first. A record posted with `--ack` asks the roles it addresses to acknowledge it, by `keel chat ack <id>` or a reply, and `keel chat show <id>` and `keel chat acks` list who has acknowledged, who only read it, and who has not read it. `keel chat summary --since <time>` digests what changed in the groups you can read — per sender, the message count, todos opened with whether they are still open, todos closed, superseded records folded into their successors, and acknowledgements still waiting — without a model and without marking anything read. Each member has its own unread state, and history is kept. A session's chat role is its identity: address other sessions by role, never by the host's session title, which Keel cannot see; `keel context` and the session projection name the role bound to the worktree, and remind a worktree with none when others here have one (#245). 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. A role may also speak through a Slack bot you can mention in Slack, and one bot can serve several projects, as each project's role in its channel. See [the Slack setup guide](docs/chat-slack-setup.md). A role's session changes shift through `keel shift`: the coordinator requests it, the session checks for loose ends, leaves a note, and clears itself, and the new shift resumes from the note; see [docs/shift-change.md](docs/shift-change.md). The 5.83 `keel mail` commands keep working on direct groups.
|
|
759
|
+
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. A record can supersede its author's earlier one (`--supersedes <id>`), and the earlier one then leaves everyone's unread; unread lists newest first. A record posted with `--ack` asks the roles it addresses to acknowledge it, by `keel chat ack <id>` or a reply, and `keel chat show <id>` and `keel chat acks` list who has acknowledged, who only read it, and who has not read it. `keel chat summary --since <time>` digests what changed in the groups you can read — per sender, the message count, todos opened with whether they are still open, todos closed, superseded records folded into their successors, and acknowledgements still waiting — without a model and without marking anything read. Each member has its own unread state, and history is kept. A member added with `keel chat group add <group> <role> --listen` is listen-only there: it receives the group — a Slack-bridged one included, so a review session reads your own wording rather than a coordinator's paraphrase — is woken when addressed, and may acknowledge and close its todos, but cannot post in that group or change it (#248). A session's chat role is its identity: address other sessions by role, never by the host's session title, which Keel cannot see; `keel context` and the session projection name the role bound to the worktree, and remind a worktree with none when others here have one (#245). 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. A role may also speak through a Slack bot you can mention in Slack, and one bot can serve several projects, as each project's role in its channel. See [the Slack setup guide](docs/chat-slack-setup.md). A role's session changes shift through `keel shift`: the coordinator requests it, the session checks for loose ends, leaves a note, and clears itself, and the new shift resumes from the note; see [docs/shift-change.md](docs/shift-change.md). The 5.83 `keel mail` commands keep working on direct groups.
|
|
760
760
|
|
|
761
761
|
## Commands
|
|
762
762
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@christang/keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.108.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.108.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.108.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.108.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.108.0"
|
|
51
|
+
PROTOCOL_VERSION = "5.108.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
|
|
@@ -2521,6 +2521,63 @@ def validate_chat_supersedes_scenario() -> int:
|
|
|
2521
2521
|
return 0
|
|
2522
2522
|
|
|
2523
2523
|
|
|
2524
|
+
def validate_chat_listen_only_scenario() -> int:
|
|
2525
|
+
"""Issue #248: a listen-only member hears a group but does not post in it.
|
|
2526
|
+
|
|
2527
|
+
It has records unread and is woken like any member, may acknowledge and
|
|
2528
|
+
close its assigned todos, and is refused posting, opening a todo, and
|
|
2529
|
+
changing the group.
|
|
2530
|
+
"""
|
|
2531
|
+
label = "chat-listen-only:"
|
|
2532
|
+
with tempfile.TemporaryDirectory(prefix="keel-chat-listen-") as raw:
|
|
2533
|
+
base = Path(raw)
|
|
2534
|
+
rtl, verify, env = chat_scratch_group(base)
|
|
2535
|
+
review = chat_worktree(rtl, base / "review")
|
|
2536
|
+
|
|
2537
|
+
def chat(cwd: Path, *args: str) -> subprocess.CompletedProcess[str]:
|
|
2538
|
+
return run_keel(cwd, "chat", *args, env=env)
|
|
2539
|
+
|
|
2540
|
+
chat(review, "role", "--set", "review")
|
|
2541
|
+
added = chat(rtl, "group", "add", "soc", "review", "--listen")
|
|
2542
|
+
if added.returncode != 0:
|
|
2543
|
+
report(f"{label} group add --listen failed: {added.stderr}")
|
|
2544
|
+
return 1
|
|
2545
|
+
asked = chat_json(chat(rtl, "post", "soc", "@review is clause 4 waived?", "--ack", "--json")).get("id", "")
|
|
2546
|
+
unread = [r.get("id") for r in chat_json(chat(review, "unread", "--json")).get("unread", [])]
|
|
2547
|
+
if asked not in unread:
|
|
2548
|
+
report(f"{label} the listen-only member does not have the mention unread: {unread!r}")
|
|
2549
|
+
return 1
|
|
2550
|
+
if chat(review, "notice", "--check").returncode != 0:
|
|
2551
|
+
report(f"{label} the listen-only member is not woken by a mention.")
|
|
2552
|
+
return 1
|
|
2553
|
+
todo = chat_json(chat(rtl, "todo", "soc", "--assignee", "review", "check clause 4", "--json")).get("id", "")
|
|
2554
|
+
for what, result in (
|
|
2555
|
+
("ack", chat(review, "ack", asked)),
|
|
2556
|
+
("done", chat(review, "done", todo)),
|
|
2557
|
+
):
|
|
2558
|
+
if result.returncode != 0:
|
|
2559
|
+
report(f"{label} the listen-only member could not {what}: {result.stderr}")
|
|
2560
|
+
return 1
|
|
2561
|
+
for what, result in (
|
|
2562
|
+
("post", chat(review, "post", "soc", "waived")),
|
|
2563
|
+
("todo", chat(review, "todo", "soc", "--assignee", "rtl", "waive it")),
|
|
2564
|
+
("group add", chat(review, "group", "add", "soc", "spec")),
|
|
2565
|
+
("group archive", chat(review, "group", "archive", "soc")),
|
|
2566
|
+
):
|
|
2567
|
+
if result.returncode == 0:
|
|
2568
|
+
report(f"{label} the listen-only member's {what} was accepted.")
|
|
2569
|
+
return 1
|
|
2570
|
+
if "listen-only" not in result.stderr:
|
|
2571
|
+
report(f"{label} the listen-only member's {what} was refused without naming listen-only: {result.stderr}")
|
|
2572
|
+
return 1
|
|
2573
|
+
listed = chat(rtl, "group", "list").stdout
|
|
2574
|
+
if "review (listen)" not in listed:
|
|
2575
|
+
report(f"{label} group list does not mark the listen-only member: {listed!r}")
|
|
2576
|
+
return 1
|
|
2577
|
+
report("chat-listen-only scenario passed.")
|
|
2578
|
+
return 0
|
|
2579
|
+
|
|
2580
|
+
|
|
2524
2581
|
def validate_chat_ack_scenario() -> int:
|
|
2525
2582
|
"""Issue #253: a record asks for an acknowledgement and the sender sees who gave it.
|
|
2526
2583
|
|
|
@@ -38586,6 +38643,7 @@ SCENARIOS: tuple = (
|
|
|
38586
38643
|
("resource-lock", validate_resource_lock_scenario),
|
|
38587
38644
|
("chat-supersedes", validate_chat_supersedes_scenario),
|
|
38588
38645
|
("chat-ack", validate_chat_ack_scenario),
|
|
38646
|
+
("chat-listen-only", validate_chat_listen_only_scenario),
|
|
38589
38647
|
("chat-summary", validate_chat_summary_scenario),
|
|
38590
38648
|
("worktree-overview", validate_worktree_overview_scenario),
|
|
38591
38649
|
("init-never-downgrades-openspec", validate_init_never_downgrades_openspec_scenario),
|
package/src/core/chat/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ const { ChatError } = store;
|
|
|
17
17
|
const USAGE = [
|
|
18
18
|
"keel chat role [--set <name>] [--alias <alias>] [--json]",
|
|
19
19
|
"keel chat group create <group> [--member <role>]...",
|
|
20
|
-
"keel chat group add|remove <group> <role>",
|
|
20
|
+
"keel chat group add|remove <group> <role> [--listen] (--listen: receives the group, may ack and close its todos, does not post)",
|
|
21
21
|
"keel chat group archive <group>",
|
|
22
22
|
"keel chat group list [--all] [--json] (also: keel chat list)",
|
|
23
23
|
"keel chat post <group> <text...> [--reply-to <id>] [--supersedes <id>] [--ack] [--json] (also: keel chat <group> <text...>)",
|
|
@@ -69,10 +69,10 @@ const VALUED = {
|
|
|
69
69
|
"--compact-at": "compactAt",
|
|
70
70
|
};
|
|
71
71
|
const REPEATED = { "--member": "members" };
|
|
72
|
-
const SWITCHES = { "--json": "json", "--peek": "peek", "--all": "all", "--mine": "mine", "--follow": "follow", "--once": "once", "--mail": "mail", "--check": "check", "--ack": "ack" };
|
|
72
|
+
const SWITCHES = { "--json": "json", "--peek": "peek", "--all": "all", "--mine": "mine", "--follow": "follow", "--once": "once", "--mail": "mail", "--check": "check", "--ack": "ack", "--listen": "listen" };
|
|
73
73
|
|
|
74
74
|
function parseChatArgs(argv) {
|
|
75
|
-
const options = { positionals: [], members: [], json: false, peek: false, all: false, mine: false, follow: false, once: false, mail: false, check: false, ack: false };
|
|
75
|
+
const options = { positionals: [], members: [], json: false, peek: false, all: false, mine: false, follow: false, once: false, mail: false, check: false, ack: false, listen: false };
|
|
76
76
|
for (const key of Object.values(VALUED)) options[key] = null;
|
|
77
77
|
for (let index = 0; index < argv.length; index += 1) {
|
|
78
78
|
const arg = argv[index];
|
|
@@ -187,7 +187,7 @@ function runGroup(where, options) {
|
|
|
187
187
|
const groups = store.listGroups(where, { includeArchived: options.all });
|
|
188
188
|
if (options.json) out(JSON.stringify({ groups }));
|
|
189
189
|
else if (!groups.length) out("No groups. Create one with `keel chat group create <group>`.");
|
|
190
|
-
else out(groups.map((g) => `${g.name}${g.archived ? " (archived)" : ""}: ${g.members.join(", ")}`).join("\n"));
|
|
190
|
+
else out(groups.map((g) => `${g.name}${g.archived ? " (archived)" : ""}: ${g.members.map((m) => (g.listeners.includes(m) ? `${m} (listen)` : m)).join(", ")}`).join("\n"));
|
|
191
191
|
return 0;
|
|
192
192
|
}
|
|
193
193
|
const actor = store.requireRole(where);
|
|
@@ -201,8 +201,8 @@ function runGroup(where, options) {
|
|
|
201
201
|
case "add":
|
|
202
202
|
case "remove": {
|
|
203
203
|
if (!member) throw new ChatError(`keel chat group ${action} needs a role.`);
|
|
204
|
-
store.changeMember(where, actor, group, member, action === "add" ? "join" : "leave");
|
|
205
|
-
out(`${action === "add" ? "Added" : "Removed"} ${member} ${action === "add" ? "to" : "from"} ${group}.`);
|
|
204
|
+
store.changeMember(where, actor, group, member, action === "add" ? "join" : "leave", { listen: options.listen });
|
|
205
|
+
out(`${action === "add" ? "Added" : "Removed"} ${member} ${action === "add" ? "to" : "from"} ${group}${action === "add" && options.listen ? " as listen-only" : ""}.`);
|
|
206
206
|
return 0;
|
|
207
207
|
}
|
|
208
208
|
case "archive":
|
package/src/core/chat/store.js
CHANGED
|
@@ -41,7 +41,7 @@ const READABLE_KINDS = new Set(["message", "todo", "system"]);
|
|
|
41
41
|
const LIST_FIELDS = new Set(["mentions", "refs"]);
|
|
42
42
|
const FIELD_ORDER = [
|
|
43
43
|
"id", "group", "kind", "from", "created", "mentions", "reply_to", "supersedes", "ack",
|
|
44
|
-
"assignee", "issue", "target", "refs", "origin", "slack_channel", "slack_ts",
|
|
44
|
+
"assignee", "issue", "target", "access", "refs", "origin", "slack_channel", "slack_ts",
|
|
45
45
|
];
|
|
46
46
|
|
|
47
47
|
// A group may not take a name `keel chat <group>` would read as a subcommand.
|
|
@@ -409,13 +409,22 @@ function signalTargets(record) {
|
|
|
409
409
|
|
|
410
410
|
function groupState(records) {
|
|
411
411
|
const members = new Set();
|
|
412
|
+
// Listen-only members (#248): a member's latest join decides it.
|
|
413
|
+
const listeners = new Set();
|
|
412
414
|
let archived = false;
|
|
413
415
|
for (const record of records) {
|
|
414
|
-
if (record.kind === "join" && record.target)
|
|
415
|
-
|
|
416
|
+
if (record.kind === "join" && record.target) {
|
|
417
|
+
members.add(record.target);
|
|
418
|
+
if (record.access === "listen") listeners.add(record.target);
|
|
419
|
+
else listeners.delete(record.target);
|
|
420
|
+
}
|
|
421
|
+
if (record.kind === "leave" && record.target) {
|
|
422
|
+
members.delete(record.target);
|
|
423
|
+
listeners.delete(record.target);
|
|
424
|
+
}
|
|
416
425
|
if (record.kind === "archive") archived = true;
|
|
417
426
|
}
|
|
418
|
-
return { members, archived, exists: records.length > 0 };
|
|
427
|
+
return { members, listeners, archived, exists: records.length > 0 };
|
|
419
428
|
}
|
|
420
429
|
|
|
421
430
|
function isDirect(group) {
|
|
@@ -448,6 +457,17 @@ function requireOpenMembership(group, state, role) {
|
|
|
448
457
|
}
|
|
449
458
|
}
|
|
450
459
|
|
|
460
|
+
// Posting and changing the group are what a listen-only member may not do
|
|
461
|
+
// (#248 D3); reading, acknowledging, and closing its own todos stay open.
|
|
462
|
+
function requireSpeaker(group, state, role) {
|
|
463
|
+
requireOpenMembership(group, state, role);
|
|
464
|
+
if (state.listeners && state.listeners.has(role)) {
|
|
465
|
+
throw new ChatError(
|
|
466
|
+
`Role ${role} is a listen-only member of group ${group}: it receives the group but does not post or change it here.`
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
451
471
|
function createGroup(where, actor, group, members, { direct = false } = {}) {
|
|
452
472
|
checkName(group, "Group");
|
|
453
473
|
if (RESERVED_GROUPS.has(group)) {
|
|
@@ -467,25 +487,25 @@ function createGroup(where, actor, group, members, { direct = false } = {}) {
|
|
|
467
487
|
return everyone;
|
|
468
488
|
}
|
|
469
489
|
|
|
470
|
-
function changeMember(where, actor, group, member, kind) {
|
|
490
|
+
function changeMember(where, actor, group, member, kind, { listen = false } = {}) {
|
|
471
491
|
checkName(member, "Member");
|
|
472
492
|
if (isDirect(group)) {
|
|
473
493
|
throw new ChatError(`Direct group ${group} has fixed members.`);
|
|
474
494
|
}
|
|
475
495
|
const { state } = loadGroup(where, group);
|
|
476
|
-
|
|
496
|
+
requireSpeaker(group, state, actor);
|
|
477
497
|
if (kind === "join" && state.members.has(member)) {
|
|
478
498
|
throw new ChatError(`Role ${member} is already a member of group ${group}.`);
|
|
479
499
|
}
|
|
480
500
|
if (kind === "leave" && !state.members.has(member)) {
|
|
481
501
|
throw new ChatError(`Role ${member} is not a member of group ${group}.`);
|
|
482
502
|
}
|
|
483
|
-
return writeRecord(where, { group, kind, from: actor, target: member });
|
|
503
|
+
return writeRecord(where, { group, kind, from: actor, target: member, access: kind === "join" && listen ? "listen" : null });
|
|
484
504
|
}
|
|
485
505
|
|
|
486
506
|
function archiveGroup(where, actor, group) {
|
|
487
507
|
const { state } = loadGroup(where, group);
|
|
488
|
-
|
|
508
|
+
requireSpeaker(group, state, actor);
|
|
489
509
|
return writeRecord(where, { group, kind: "archive", from: actor });
|
|
490
510
|
}
|
|
491
511
|
|
|
@@ -495,7 +515,7 @@ function listGroups(where, { includeArchived = false } = {}) {
|
|
|
495
515
|
const state = groupState(readLog(where, name));
|
|
496
516
|
if (!state.exists) continue;
|
|
497
517
|
if (state.archived && !includeArchived) continue;
|
|
498
|
-
groups.push({ name, members: [...state.members].sort(), archived: state.archived, direct: isDirect(name) });
|
|
518
|
+
groups.push({ name, members: [...state.members].sort(), listeners: [...state.listeners].sort(), archived: state.archived, direct: isDirect(name) });
|
|
499
519
|
}
|
|
500
520
|
return groups;
|
|
501
521
|
}
|
|
@@ -545,7 +565,7 @@ function post(where, options) {
|
|
|
545
565
|
const text = String(options.text || "");
|
|
546
566
|
if (!text.trim()) throw new ChatError("A post needs text: give it after the group, or on stdin.");
|
|
547
567
|
const { records, state } = loadGroup(where, group);
|
|
548
|
-
|
|
568
|
+
requireSpeaker(group, state, from);
|
|
549
569
|
const mentions = resolveMentions(where, group, state, text);
|
|
550
570
|
// Loaded here rather than at the top: the guards read the store's own API.
|
|
551
571
|
require("./guards").checkPost(module.exports, where, from, group, records);
|