@christang/keel 5.191.0 → 5.192.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keel",
3
- "version": "5.191.0",
3
+ "version": "5.192.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",
package/README.md CHANGED
@@ -906,11 +906,16 @@ Keel's own messages never count as waiting.
906
906
 
907
907
  With `--issues`, patrol also routes issue updates (#242): `issue_roles:` in `keel/config.yaml`
908
908
  maps a label to a role, and each role gets one direct message per update of an issue carrying its
909
- label — so a handoff labelled `role:verify` reaches `verify` without a second message.
909
+ label — so a handoff labelled `role:verify` reaches `verify` without a second message. A key may
910
+ name a set of labels joined by ` + ` (#433), which matches an issue carrying all of them, so teams of
911
+ the same shape can share capability labels. When one matching route's labels are a subset of
912
+ another's, only the larger set's role is sent the update; a quoted key stays one label.
910
913
 
911
914
  ```yaml
912
915
  issue_roles:
913
916
  role:verify: verify
917
+ design: design-iecc
918
+ design + dmc_rmw: design-rmw
914
919
  ```
915
920
 
916
921
  A host schedule made inside a session ends with that session, so a shift change or restart drops
package/README.zh-CN.md CHANGED
@@ -752,11 +752,15 @@ keel patrol --issues /tmp/issues.json # 以协调者的角色运行
752
752
 
753
753
  带上 `--issues` 时,巡查还会分派 issue 更新(#242):`keel/config.yaml` 里的 `issue_roles:` 把一个标签映射到
754
754
  一个角色,每个角色会为带着它标签的 issue 的每次更新收到一条私信——这样一个标为 `role:verify` 的交接无需第二条
755
- 消息就能到达 `verify`。
755
+ 消息就能到达 `verify`。一个键也可以是用 ` + ` 连起来的一组标签(#433),只匹配同时带着这些标签的 issue,这样
756
+ 结构相同的几个团队就能共用能力标签。当一条匹配路由的标签是另一条的子集时,只有标签更多的那条的角色收到更新;
757
+ 加了引号的键仍是单个标签。
756
758
 
757
759
  ```yaml
758
760
  issue_roles:
759
761
  role:verify: verify
762
+ design: design-iecc
763
+ design + dmc_rmw: design-rmw
760
764
  ```
761
765
 
762
766
  在会话内创建的宿主计划任务会随该会话结束,所以换班或重启就会丢掉它。声明由哪个角色巡查、多久一次,那个角色的
@@ -1,4 +1,4 @@
1
- <!-- keel:start version=5.191.0 -->
1
+ <!-- keel:start version=5.192.0 -->
2
2
  ## Keel Bootstrap
3
3
 
4
4
  - Start every session with `keel context`; OpenSpec artifacts and Git are the durable authority, and memory or transcripts may only inform.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@christang/keel",
3
- "version": "5.191.0",
3
+ "version": "5.192.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@christang/keel",
9
- "version": "5.191.0",
9
+ "version": "5.192.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@fission-ai/openspec": "^1.4.1"
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@christang/keel",
3
3
  "displayName": "Keel",
4
4
  "description": "Keel OpenSpec execution discipline CLI for Claude Code, Codex, and OpenCode.",
5
- "version": "5.191.0",
5
+ "version": "5.192.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keel",
3
- "version": "5.191.0",
3
+ "version": "5.192.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.191.0",
3
+ "version": "5.192.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",
@@ -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.191.0"
38
+ PACKAGE_VERSION = "5.192.0"
39
39
 
40
40
 
41
- PROTOCOL_VERSION = "5.191.0"
41
+ PROTOCOL_VERSION = "5.192.0"
42
42
 
43
43
 
44
44
  LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
@@ -464,6 +464,8 @@ SCENARIOS: tuple = (
464
464
  ("patrol-host-task", shift.validate_patrol_host_task_scenario),
465
465
  ("patrol-rearm", shift.validate_patrol_rearm_scenario),
466
466
  ("patrol-issue-routing", shift.validate_patrol_issue_routing_scenario),
467
+ ("patrol-issue-label-sets", shift.validate_patrol_issue_label_sets_scenario),
468
+ ("patrol-issue-label-set-unreadable", shift.validate_patrol_issue_label_set_unreadable_scenario),
467
469
  ("chat-listen-only", chat.validate_chat_listen_only_scenario),
468
470
  ("chat-summary", chat.validate_chat_summary_scenario),
469
471
  ("worktree-overview", shift.validate_worktree_overview_scenario),
@@ -1070,6 +1070,78 @@ def validate_patrol_issue_routing_scenario() -> int:
1070
1070
  return 0
1071
1071
 
1072
1072
 
1073
+ def issue_label_scratch(base: Path, config: str) -> tuple[Path, dict, dict[str, Path]]:
1074
+ """`rtl` patrols; `design-iecc`, `design-rmw`, and `flow` each have a worktree."""
1075
+ rtl, _verify, env = chat_scratch_group(base)
1076
+ worktrees = {}
1077
+ for role in ("design-iecc", "design-rmw", "flow"):
1078
+ worktrees[role] = chat_worktree(rtl, base / role)
1079
+ run_keel(worktrees[role], "chat", "role", "--set", role, env=env)
1080
+ write_authorize_config(rtl, config)
1081
+ return rtl, env, worktrees
1082
+
1083
+
1084
+ def issue_notices(worktree: Path, env: dict, number: int) -> int:
1085
+ unread = chat_json(run_keel(worktree, "chat", "unread", "--json", env=env)).get("unread", [])
1086
+ return sum(1 for record in unread if f"#{number} " in record.get("text", "") or f"#{number}:" in record.get("text", ""))
1087
+
1088
+
1089
+ def validate_patrol_issue_label_sets_scenario() -> int:
1090
+ """Issue #433: a route keyed on a set of labels refines a single-label one.
1091
+
1092
+ An issue carrying `design` and `dmc_rmw` reaches the `design + dmc_rmw`
1093
+ role and not the `design` role; a route that is not nested still sends.
1094
+ """
1095
+ label = "patrol-issue-label-sets:"
1096
+ with tempfile.TemporaryDirectory(prefix="keel-patrol-label-sets-") as raw:
1097
+ base = Path(raw)
1098
+ rtl, env, worktrees = issue_label_scratch(
1099
+ base, "issue_roles:\n design: design-iecc\n design + dmc_rmw: design-rmw\n flow: flow\n")
1100
+ issues = base / "issues.json"
1101
+ issues.write_text(json.dumps([
1102
+ {"number": 160, "title": "rmw ecc path", "state": "OPEN",
1103
+ "labels": [{"name": "design"}, {"name": "dmc_rmw"}, {"name": "flow"}], "updatedAt": "2026-10-21T01:00:00Z"},
1104
+ {"number": 161, "title": "iecc ecc path", "state": "OPEN",
1105
+ "labels": [{"name": "design"}], "updatedAt": "2026-10-21T01:00:00Z"},
1106
+ ]), encoding="utf-8")
1107
+ run = run_keel(rtl, "patrol", "--issues", str(issues), env=env)
1108
+ if run.returncode != 3:
1109
+ report(f"{label} patrol exited {run.returncode}, not 3: {run.stdout} {run.stderr}")
1110
+ return 1
1111
+ expected = (("design-rmw", 160, 1), ("flow", 160, 1), ("design-iecc", 160, 0),
1112
+ ("design-iecc", 161, 1), ("design-rmw", 161, 0))
1113
+ for role, number, want in expected:
1114
+ got = issue_notices(worktrees[role], env, number)
1115
+ if got != want:
1116
+ report(f"{label} {role} has {got} notices about #{number}, not {want}.")
1117
+ return 1
1118
+ report("patrol-issue-label-sets scenario passed.")
1119
+ return 0
1120
+
1121
+
1122
+ def validate_patrol_issue_label_set_unreadable_scenario() -> int:
1123
+ """Issue #433: a set with an empty or repeated label is reported and routes nothing."""
1124
+ label = "patrol-issue-label-set-unreadable:"
1125
+ with tempfile.TemporaryDirectory(prefix="keel-patrol-label-set-bad-") as raw:
1126
+ base = Path(raw)
1127
+ rtl, env, worktrees = issue_label_scratch(
1128
+ base, "issue_roles:\n design + : design-rmw\n design + design: design-rmw\n")
1129
+ issues = base / "issues.json"
1130
+ issues.write_text(json.dumps([{"number": 162, "title": "ecc", "state": "OPEN",
1131
+ "labels": [{"name": "design"}], "updatedAt": "2026-10-21T01:00:00Z"}]), encoding="utf-8")
1132
+ run = run_keel(rtl, "patrol", "--issues", str(issues), env=env)
1133
+ for line in ("design + : design-rmw", "design + design: design-rmw"):
1134
+ if f"`{line}`" not in run.stdout:
1135
+ report(f"{label} the unreadable line `{line}` is not reported: {run.stdout!r}")
1136
+ return 1
1137
+ got = issue_notices(worktrees["design-rmw"], env, 162)
1138
+ if got:
1139
+ report(f"{label} design-rmw has {got} notices about #162 from unreadable lines.")
1140
+ return 1
1141
+ report("patrol-issue-label-set-unreadable scenario passed.")
1142
+ return 0
1143
+
1144
+
1073
1145
  def validate_worktree_overview_scenario() -> int:
1074
1146
  """Read every worktree through the CLI without fetching or changing chat."""
1075
1147
  label = "worktree-overview:"
@@ -918,11 +918,15 @@ function readReadOnlyRoles(repo) {
918
918
 
919
919
  // `issue_roles:` — which chat role an issue label routes to (#242), one
920
920
  // `<label>: <role>` per line, read by `keel patrol`. A label may itself hold a
921
- // colon (`role:verify`), so the role is what follows the last `: `. A line
922
- // that is not that shape is reported and routes nothing.
921
+ // colon (`role:verify`), so the role is what follows the last `: `. A key may
922
+ // name a set of labels joined by ` + ` (#433), which matches an issue carrying
923
+ // all of them; a quoted key is one label and is not split. A line that is not
924
+ // that shape, or a set with an empty or repeated label, is reported and routes
925
+ // nothing. Routes come back in declaration order, a repeated set replacing the
926
+ // earlier line.
923
927
  function readIssueRoles(repo) {
924
928
  const block = configBlockLines(repo, "issue_roles");
925
- const routes = new Map();
929
+ const routes = [];
926
930
  const unreadable = [];
927
931
  if (block === null) return { routes, unreadable };
928
932
  if (block.inline !== null) unreadable.push(block.inline);
@@ -934,7 +938,16 @@ function readIssueRoles(repo) {
934
938
  unreadable.push(text);
935
939
  continue;
936
940
  }
937
- routes.set(match[1].replace(/^["']|["']$/g, ""), match[2]);
941
+ const quoted = /^(["']).*\1$/.test(match[1]);
942
+ const labels = quoted ? [match[1].slice(1, -1)] : match[1].split(/\s+\+(?:\s+|$)/).map((label) => label.trim());
943
+ if (labels.some((label) => !label) || new Set(labels).size !== labels.length) {
944
+ unreadable.push(text);
945
+ continue;
946
+ }
947
+ const key = [...labels].sort().join("\n");
948
+ const earlier = routes.findIndex((route) => [...route.labels].sort().join("\n") === key);
949
+ if (earlier !== -1) routes.splice(earlier, 1);
950
+ routes.push({ labels, role: match[2] });
938
951
  }
939
952
  return { routes, unreadable };
940
953
  }
@@ -103,18 +103,24 @@ function patrol(where, role, options) {
103
103
  return result;
104
104
  }
105
105
 
106
- // D5 (#242): each role a label of an issue maps to gets one direct message
107
- // per `updatedAt`, deduped by its ref against the direct group's records.
106
+ // D5 (#242): each role a matching route names gets one direct message per
107
+ // `updatedAt`, deduped by its ref against the direct group's records. A route
108
+ // whose labels are a strict subset of another matching route's is refined by
109
+ // it and sends nothing (#433).
108
110
  function routeIssues(where, role, options) {
109
111
  const { routes, unreadable } = require("./config").readIssueRoles(where.worktree);
110
112
  const warnings = unreadable.map(
111
- (line) => `keel/config.yaml issue_roles line \`${line}\` is not \`<label>: <role>\`; it routes nothing.`
113
+ (line) => `keel/config.yaml issue_roles line \`${line}\` is not \`<label>: <role>\` or \`<label> + <label>: <role>\`; it routes nothing.`
112
114
  );
113
115
  const notices = [];
114
- if (!options.issues || !routes.size) return { notices, warnings };
116
+ if (!options.issues || !routes.length) return { notices, warnings };
115
117
  for (const issue of options.issues) {
116
- const labels = (issue.labels || []).map((entry) => (typeof entry === "string" ? entry : entry && entry.name)).filter(Boolean);
117
- const targets = [...new Set(labels.map((name) => routes.get(name)).filter(Boolean))];
118
+ const labels = new Set((issue.labels || []).map((entry) => (typeof entry === "string" ? entry : entry && entry.name)).filter(Boolean));
119
+ const matching = routes.filter((route) => route.labels.every((name) => labels.has(name)));
120
+ const refined = (route) => matching.some(
121
+ (other) => other.labels.length > route.labels.length && route.labels.every((name) => other.labels.includes(name))
122
+ );
123
+ const targets = [...new Set(matching.filter((route) => !refined(route)).map((route) => route.role))];
118
124
  for (const target of targets) {
119
125
  if (target === role) continue;
120
126
  const ref = `issue:#${issue.number}@${issue.updatedAt || "unknown"}`;