@christang/keel 5.173.0 → 5.175.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.173.0",
3
+ "version": "5.175.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,10 +1,10 @@
1
- <!-- keel:start version=5.173.0 -->
1
+ <!-- keel:start version=5.175.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.
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
- - Work through an approved `tasks.md` in order, each task through its own gates. A subagent is the model's choice and is treated as the main agent is. No commit, sync, or archive without explicit authorization.
6
+ - Work through an approved `tasks.md` in order, each task through its own gates. A subagent is the model's choice and is treated as the main agent is. No commit, push, sync, or archive unless the task, the owner, or `keel/config.yaml` authorizes it.
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
- - Native plugin projections (SessionStart context) are disposable views, never authority; without the plugin or hook, run the commands manually.
8
+ - SessionStart projections are disposable views, never authority; without the plugin, run the commands by hand.
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.
10
10
  <!-- keel:end -->
@@ -79,8 +79,7 @@ artifacts:
79
79
  the compiled fingerprint into that Contract line, and task-complete
80
80
  refuses a task that recorded none: without an anchor there is nothing for
81
81
  completion to compare against, so the task has no drift detection. Omitted fields inherit
82
- versioned keel-task-capsule/v1 defaults: Owner is the current Keel
83
- agent, Mode is implementation, Read is the change artifacts plus
82
+ versioned keel-task-capsule/v1 defaults: Mode is implementation, Read is the change artifacts plus
84
83
  discovered repository context, Acceptance derives from the resolved
85
84
  Covers authority, the Autonomy boundary is hard-stop, and Coupling is
86
85
  none. Exceptional boundaries are declared only when they differ from
@@ -95,7 +94,8 @@ artifacts:
95
94
  compact form.
96
95
  Verify selects the least-cost strategy that still proves the resolved
97
96
  Acceptance: vertical-tdd, regression-first, characterization,
98
- snapshot-characterization, rendered-behavior, or evidence-first.
97
+ snapshot-characterization, rendered-behavior, evidence-first, or
98
+ equivalence (which also declares `Base:` and `Fields:`).
99
99
  Red-green strategies record per-label `.red` and `.green` Evidence in
100
100
  addition to the bare `M<n>` Evidence, which is always required; all three
101
101
  must be concrete before completion. An `M<n>` may carry a comma-separated
@@ -134,25 +134,26 @@ artifacts:
134
134
 
135
135
  Use `Coupling: none` by default. When `Coupling: required`, define one
136
136
  complete candidate, its allowed provisional failures, completion gate,
137
- final assertions, retry counting, immediate task-stop conditions, and
137
+ final assertions, immediate task-stop conditions, and
138
138
  evidence. The task must agree with design.md's Coupled Iteration Contract.
139
139
 
140
- `/opsx:apply` selects unchecked tasks from this file. The current agent may
141
- read any repository file needed for the selected task; Read lists required
140
+ `/opsx:apply` works through the unchecked tasks of this file in order. Any
141
+ repository file may be read needed for the selected task; Read lists required
142
142
  starting context, not a read allowlist. The Slice Start Gate requires each
143
143
  selected current slice or contiguous slice group to name source
144
144
  expectations and compile to a capsule whose Read, Touch, Acceptance,
145
145
  verification checks, and Stop/Autonomy boundaries are sufficient to
146
146
  execute without guessing. Rough
147
147
  future slices may remain drafts, but cannot be selected for
148
- implementation or marked complete. The current agent may only modify files
149
- listed under Touch for the selected task. If implementation requires files
148
+ implementation or marked complete. Only files listed under Touch for the
149
+ selected task may be modified. If implementation requires files
150
150
  outside Touch, broader design work, or an interface/security boundary
151
151
  change not covered by design.md, stop and report an Out-of-scope Need.
152
- Before task completion, Evidence records the current agent's semantic
152
+ Before task completion, Evidence records the semantic
153
153
  Review with Status, Acceptance check, Scope check, and Findings. Status is
154
154
  one of pass, passed, complete, completed, ok, or done. Findings
155
- are `none` or carry a durable owner — a `Discard reason:`/`Discard
155
+ are `none` or carry a disposition — `Resolved here:` naming a check this
156
+ task declares or a path that exists, or a durable owner: a `Discard reason:`/`Discard
156
157
  rationale:` prefix, an absolute `https://…` reference, or any
157
158
  repo-relative path that exists, named after `Durable owner:` so it reads
158
159
  as the owner rather than a file the finding mentions;
@@ -186,18 +187,18 @@ apply:
186
187
 
187
188
  Apply workflow:
188
189
  1. Read the current change's proposal.md, specs, design.md when present, and tasks.md.
189
- 2. Select one unchecked task or a small contiguous group of unchecked tasks from tasks.md.
190
+ 2. Take the first unchecked task of tasks.md; later ones follow in order (step 8).
190
191
  3. Run the Task Authoring Gate: every relevant critical expectation must be covered by a selected slice, deferred to a durable owner, or explicitly discarded with rationale.
191
192
  4. Run the Slice Start Gate: every selected current slice must name source expectations and compile to a complete keel-task-capsule/v1 contract from its compact Covers, Touch, Verify, and Evidence fields plus any declared exceptional Mode, Read, Acceptance delta, Autonomy boundary, Coupling/Candidate Boundary, or Stop if clauses.
192
- 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.
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 starting implementation.
193
194
  6. Rough future slices may remain non-executable drafts, but they cannot be selected for implementation or marked complete.
194
195
  7. Treat any Execution recommendation as an advisory implementation note, not as a completion gate.
195
196
  8. Work through the unchecked tasks of an approved `tasks.md` in order, each through its own `keel gate task-start` and `keel gate task-complete`; every stop trigger still halts. A subagent is the model's choice and is treated as the main agent is.
196
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.
197
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.
198
- 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.
199
+ 11. Any repository file needed for the selected task may be read; reading does not expand write authority.
199
200
  12. Modify only files listed under Touch. If modifying any other file is required, stop and report an Out-of-scope Need with file or area, why needed, consequence if unchanged, minimal proposed change, and evidence.
200
- 13. Do not commit or push unless the selected task or human instruction explicitly allows it.
201
+ 13. Do not commit or push unless the selected task, a human instruction, or a standing authorization in `keel/config.yaml` allows it.
201
202
  14. After each iteration, compare Changed Files and command evidence with the selected task contract before checking tasks complete.
202
- 15. Run `keel-review-checklist` only at completion gates: after a complete task group, before `/opsx:sync openspec/changes/<change>/tasks.md` or `/opsx:archive openspec/changes/<change>/tasks.md`, before meaningful handoff, or when implementation reports risks, follow-ups, or out-of-scope need. The Claude target's Keel Hook completion gate checks M-command evidence for these direct command paths.
203
+ 15. Run `keel-review-checklist` only at completion gates: after a complete task group, before `/opsx:sync openspec/changes/<change>/tasks.md` or `/opsx:archive openspec/changes/<change>/tasks.md`, before meaningful handoff, or when implementation reports risks, follow-ups, or out-of-scope need. No hook gates completion; running the gates is the agent's own step.
203
204
  16. Before archive or handoff, unresolved follow-ups must be owned by current OpenSpec tasks, a new OpenSpec change, archive evidence, or an explicit discard reason.
@@ -1,6 +1,6 @@
1
1
  <!-- Compact v4 task source (keel-task-capsule/v1, defaults version 1).
2
2
  Record only task-specific authority. Omitted fields inherit versioned
3
- defaults: Owner is the current Keel agent, Mode is implementation, Read
3
+ defaults: 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, and a
6
6
  subagent is the model's choice, treated as the main agent is. The next
@@ -23,7 +23,8 @@
23
23
  - Verify:
24
24
  <!-- verification discipline: Strategy is REQUIRED and is one of
25
25
  vertical-tdd, regression-first, characterization,
26
- snapshot-characterization, rendered-behavior, or evidence-first.
26
+ snapshot-characterization, rendered-behavior, evidence-first, or
27
+ equivalence (which also declares Base: and Fields:).
27
28
  Nothing is supplied by default, because the value an omission
28
29
  would select is the one with no red-green requirement.
29
30
  evidence-first additionally carries a `Reason:` entry beside
@@ -50,7 +51,7 @@
50
51
  - M1: pending
51
52
  - Review:
52
53
  <!-- Status: one of pass, passed, complete, completed, ok, done -->
53
- <!-- Findings: none, or carry a durable owner — a "Discard reason:"/"Discard rationale:" prefix, an absolute https://… reference, or any repo-relative path that exists (keel/archive/…, an openspec/changes/… artifact, or the repository's own ledger) named after "Durable owner:"; not keel/HANDOFF.md, which is a pointer override -->
54
+ <!-- Findings: none, or "Resolved here:" naming a check this task declares or a path that exists, or a durable owner — a "Discard reason:"/"Discard rationale:" prefix, an absolute https://… reference, or any repo-relative path that exists (keel/archive/…, an openspec/changes/… artifact, or the repository's own ledger) named after "Durable owner:"; not keel/HANDOFF.md, which is a pointer override -->
54
55
  - Status: pending
55
56
  - Acceptance check: pending
56
57
  - Scope check: pending
@@ -66,13 +67,13 @@
66
67
  sync, archive, or mark tasks complete
67
68
  - Read: additional required starting context beyond the base set
68
69
  - Acceptance: a task-specific observable delta the Covers authority does not express
69
- - Execution recommendation / Rationale: advisory notes for the current agent
70
+ - Execution recommendation / Rationale: advisory notes for whoever executes the task
70
71
  - Autonomy boundary: a pre-authorized fallback with its exact reversible bound and required evidence
71
72
  - Coupling: required, with the design.md Coupled Iteration Contract, one
72
73
  complete candidate, Candidate Boundary, completion-gate final assertions,
73
74
  and candidate-level Stop Rules
74
75
  - Stop if: extra hard limits beyond the standard prohibitions
75
- Requires modifying files outside Touch. always remains a stop condition. -->
76
+ `Requires modifying files outside Touch.` always remains a stop condition. -->
76
77
 
77
78
  ## 2. <!-- Task Group Name -->
78
79
 
package/bin/keel.js CHANGED
@@ -99,6 +99,8 @@ Usage:
99
99
  keel shift request|check|ready|start|resume|status ... (a role's shift change; see keel shift --help)
100
100
  keel lock acquire|release|list ... (shared resource leases; see keel lock --help)
101
101
  keel worktrees [--repo <path>] [--issues <file>] [--json] (read-only worktree overview)
102
+ keel patrol [--issues <file>] [--idle <dur>] [--since-last [--notify]] [--nudge] [--json] [--repo <path>] (the coordinator's patrol; keel patrol task prints its schedule)
103
+ keel tick [--repo <path>] [--json] (one model-free step for a host scheduler; keel tick task prints the job)
102
104
  keel openspec [args...]
103
105
  keel --init [repo] [--target claude|codex|opencode] [--dry-run] [--force-template-update]
104
106
  keel --install [repo] [--target claude|codex|opencode] [--dry-run] [--force-template-update] [--with-git-hooks]
@@ -1085,15 +1087,88 @@ function updateClaudePlugin(options) {
1085
1087
  updateLine(
1086
1088
  component,
1087
1089
  versionChange(installed.version, after && after.version),
1088
- "running sessions use it at their next hook call; their skills and agents after /reload-plugins"
1090
+ "running sessions use it at their next hook call; their skills after /reload-plugins"
1089
1091
  );
1090
1092
  return true;
1091
1093
  }
1092
1094
 
1095
+ function compareVersions(a, b) {
1096
+ const parts = (value) => value.split(/[.-]/).map((part) => (/^\d+$/.test(part) ? Number(part) : part));
1097
+ const left = parts(a);
1098
+ const right = parts(b);
1099
+ for (let index = 0; index < Math.max(left.length, right.length); index += 1) {
1100
+ const x = left[index] === undefined ? 0 : left[index];
1101
+ const y = right[index] === undefined ? 0 : right[index];
1102
+ if (x === y) continue;
1103
+ if (typeof x === "number" && typeof y === "number") return x - y;
1104
+ return String(x) < String(y) ? -1 : 1;
1105
+ }
1106
+ return 0;
1107
+ }
1108
+
1109
+ function codexCacheVersion(cacheDir) {
1110
+ let entries = [];
1111
+ try {
1112
+ entries = fs.readdirSync(cacheDir, { withFileTypes: true })
1113
+ .filter((entry) => entry.isDirectory() && /^\d/.test(entry.name))
1114
+ .map((entry) => entry.name);
1115
+ } catch {
1116
+ return null;
1117
+ }
1118
+ return entries.sort(compareVersions).pop() || null;
1119
+ }
1120
+
1121
+ // What Codex's own files say when `plugin list --json` cannot (#412): the
1122
+ // marketplace's source type in config.toml and the installed version in the
1123
+ // plugin cache. Both, or nothing — a query failure is never read as an absent
1124
+ // host (#354), so with no install on disk the failure stands.
1125
+ function codexKeelFromDisk(codexHome, market) {
1126
+ let config = "";
1127
+ try {
1128
+ config = fs.readFileSync(path.join(codexHome, "config.toml"), "utf8");
1129
+ } catch {
1130
+ return null;
1131
+ }
1132
+ const header = `[marketplaces.${market}]`;
1133
+ const lines = config.split(/\r?\n/);
1134
+ const start = lines.findIndex((line) => line.trim() === header);
1135
+ if (start < 0) return null;
1136
+ const section = {};
1137
+ for (const line of lines.slice(start + 1)) {
1138
+ if (/^\s*\[/.test(line)) break;
1139
+ const entry = line.match(/^\s*([A-Za-z_]+)\s*=\s*"([^"]*)"/);
1140
+ if (entry) section[entry[1]] = entry[2];
1141
+ }
1142
+ const cacheDir = path.join(codexHome, "plugins", "cache", market, "keel");
1143
+ const version = codexCacheVersion(cacheDir);
1144
+ if (!section.source_type || !version) return null;
1145
+ return {
1146
+ id: `keel@${market}`,
1147
+ market,
1148
+ version,
1149
+ sourceType: section.source_type,
1150
+ source: section.source || "",
1151
+ path: null,
1152
+ cacheDir,
1153
+ };
1154
+ }
1155
+
1093
1156
  function updateCodexPlugin(options) {
1094
1157
  const component = "codex plugin";
1095
1158
  const executable = process.env.KEEL_UPDATE_CODEX || "codex";
1096
- const queried = codexKeel(executable);
1159
+ const codexHome = process.env.CODEX_HOME || path.join(os.homedir(), ".codex");
1160
+ let queried = codexKeel(executable);
1161
+ // A query that failed and Codex's own state that can carry the update: the
1162
+ // update runs from that state, and every later read comes from the cache,
1163
+ // because a query that just hung would most likely hang again.
1164
+ let listFailure = null;
1165
+ if (queried && queried.failed && !options.dryRun) {
1166
+ const fromDisk = codexKeelFromDisk(codexHome, "keel-marketplace");
1167
+ if (fromDisk) {
1168
+ listFailure = queried.failed;
1169
+ queried = fromDisk;
1170
+ }
1171
+ }
1097
1172
  const installed = queried && !queried.failed ? queried : null;
1098
1173
  const id = installed ? installed.id : "keel@keel-marketplace";
1099
1174
  const market = installed ? installed.market : "keel-marketplace";
@@ -1138,28 +1213,40 @@ function updateCodexPlugin(options) {
1138
1213
  // Codex re-reads hook definitions at every call and trusts them by hash, so
1139
1214
  // a changed definition stops running until the owner reviews it. Compared
1140
1215
  // before `plugin add`, which deletes the old install's directory.
1141
- const codexHome = process.env.CODEX_HOME || path.join(os.homedir(), ".codex");
1142
1216
  const oldHooks = installed.version
1143
1217
  ? readOrNull(path.join(codexHome, "plugins", "cache", market, "keel", installed.version, "hooks", "codex.json"))
1144
1218
  : null;
1145
- const upgraded = codexKeel(executable);
1146
- if (upgraded && upgraded.failed) {
1147
- updateLine(component, "failed", `${upgraded.failed} after the marketplace refresh`);
1148
- return false;
1219
+ let newHooks = null;
1220
+ if (!listFailure) {
1221
+ const upgraded = codexKeel(executable);
1222
+ if (upgraded && upgraded.failed) {
1223
+ updateLine(component, "failed", `${upgraded.failed} after the marketplace refresh`);
1224
+ return false;
1225
+ }
1226
+ newHooks = upgraded && upgraded.path ? readOrNull(path.join(upgraded.path, "hooks", "codex.json")) : null;
1149
1227
  }
1150
- const newHooks = upgraded && upgraded.path ? readOrNull(path.join(upgraded.path, "hooks", "codex.json")) : null;
1151
- const hooksChanged = oldHooks && newHooks && !oldHooks.equals(newHooks);
1152
1228
  if (!runHostSteps(component, "codex", executable, [steps[1]])) return false;
1153
- const after = codexKeel(executable);
1154
- if (after && after.failed) {
1155
- updateLine(component, "failed", `${after.failed} after the update, so its result is unverified`);
1156
- return false;
1229
+ let after;
1230
+ if (listFailure) {
1231
+ const version = codexCacheVersion(installed.cacheDir);
1232
+ after = version ? { version } : null;
1233
+ if (version) newHooks = readOrNull(path.join(installed.cacheDir, version, "hooks", "codex.json"));
1234
+ } else {
1235
+ after = codexKeel(executable);
1236
+ if (after && after.failed) {
1237
+ updateLine(component, "failed", `${after.failed} after the update, so its result is unverified`);
1238
+ return false;
1239
+ }
1157
1240
  }
1241
+ const hooksChanged = oldHooks && newHooks && !oldHooks.equals(newHooks);
1158
1242
  updateLine(
1159
1243
  component,
1160
1244
  versionChange(installed.version, after && after.version),
1161
1245
  "running sessions use it at their next hook call"
1162
1246
  + (hooksChanged ? "; its hook definitions changed, so Codex will ask you to review them in /hooks before they run" : "")
1247
+ + (listFailure
1248
+ ? `; \`codex plugin list --json\` did not answer (${listFailure.replace(/^`codex plugin list --json` /, "")}), so versions were read from ${installed.cacheDir}`
1249
+ : "")
1163
1250
  );
1164
1251
  return true;
1165
1252
  }
@@ -1633,7 +1720,6 @@ function keelOpenSpecOverlay(action) {
1633
1720
  "- Sync completion is gated by `keel gate change-close --action sync` plus `keel-review-checklist`; there is no runtime hook for it, so running the gate is the agent's own step.",
1634
1721
  "- Before syncing, each related critical expectation must have behavior evidence, a durable follow-up owner, or an explicit discard reason.",
1635
1722
  SUBAGENT_SENTENCE,
1636
- "- Invoke OpenSpec through `keel openspec` (for example `keel openspec validate`); a bare `openspec` command may not be on PATH.",
1637
1723
  "- Syncing promotes the change's spec delta into `openspec/specs/`. A later archive of the same change must use `--skip-specs`, because archive is not idempotent over an already-promoted delta.",
1638
1724
  ];
1639
1725
  if (action === "sync") {
@@ -1655,19 +1741,17 @@ function keelOpenSpecOverlay(action) {
1655
1741
  ? [
1656
1742
  "- Work through the unchecked tasks of an approved `tasks.md` in order, each started by `keel gate task-start` and completed by `keel gate task-complete`; every stop trigger still halts.",
1657
1743
  "- Run the Task Authoring Gate: each relevant critical expectation must be covered by a slice, deferred to a durable owner, or explicitly discarded.",
1658
- "- Run the Slice Start Gate: selected current slices must name source expectations and include Read, Touch, Acceptance, Commands, and Stop/Autonomy boundaries before implementation.",
1744
+ "- Run the Slice Start Gate: selected current slices must name source expectations and compile to a capsule whose Read, Touch, Acceptance, Verify checks, and Stop/Autonomy boundaries are complete before implementation.",
1659
1745
  "- Rough future slices may remain drafts, but cannot be selected for implementation or marked complete.",
1660
- "- 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.",
1746
+ "- Obey the selected task contract: Read is required starting context, Touch is the write boundary, Verify checks prove Acceptance, and the Autonomy boundary controls fallback decisions.",
1661
1747
  "- 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.",
1662
1748
  "- 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.",
1663
- "- Invoke OpenSpec through `keel openspec` (for example `keel openspec validate`); a bare `openspec` command may not be on PATH.",
1664
1749
  "- Consult the repository's standing authorization in `keel/config.yaml` before asking the user to confirm a repository action: a standing-authorized action proceeds without a per-occurrence confirmation, and an undeclared action still requires the confirmation it requires today.",
1665
1750
  "- A standing authorization covers the action and never substitutes for a gate, evidence, or Review; it removes the confirmation, not the record, and it is not a trigger to perform the action.",
1666
1751
  ]
1667
1752
  : [
1668
1753
  "- Archive completion is gated by `keel gate change-close --action archive` plus `keel-review-checklist`; verify task evidence, follow-up ownership, and completion gates before proceeding.",
1669
1754
  "- Before final sync/archive, each related critical expectation must have behavior evidence, a durable follow-up owner, or an explicit discard reason.",
1670
- "- Invoke OpenSpec through `keel openspec` (for example `keel openspec validate`); a bare `openspec` command may not be on PATH.",
1671
1755
  "- When `/opsx:sync` has already promoted the change's spec delta, run the archive with `--skip-specs` so the promoted delta is not re-applied; archive is not idempotent over an already-synced delta.",
1672
1756
  "- After archiving, run `keel guard clear` to drop the change's guard manifest; the read-only gate never clears it for you.",
1673
1757
  "- A repository that standing-authorizes `archive` in `keel/config.yaml` does not need the per-occurrence archive confirmation; a repository that declares nothing still needs it.",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@christang/keel",
3
- "version": "5.173.0",
3
+ "version": "5.175.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@christang/keel",
9
- "version": "5.173.0",
9
+ "version": "5.175.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.173.0",
5
+ "version": "5.175.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.173.0",
3
+ "version": "5.175.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.173.0",
3
+ "version": "5.175.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",
@@ -21,8 +21,8 @@ When the change's artifacts or the failing surface signal a domain, consult the
21
21
  There is no fixed attempt count: keep going while each attempt adds evidence, and stop when one does not. When you stop, report the original key error plus what changed during each attempt.
22
22
 
23
23
  For `Coupling: required`, an allowed provisional failure inside a candidate is
24
- not a failed attempt; what counts is the same final assertion failing at the
25
- candidate completion gate. Follow the task's immediate task-stop
24
+ expected rather than a stop; the evidence that matters is the final assertion
25
+ at the candidate completion gate. Follow the task's immediate task-stop
26
26
  rules for scope breach, missing design authority, non-reproducible evidence,
27
27
  or a baseline or acceptance change during a candidate.
28
28
 
@@ -51,8 +51,8 @@ REQUIRED_SCRIPTS = [
51
51
  "scripts/validate_plugin.py",
52
52
  ]
53
53
 
54
- PACKAGE_VERSION = "5.173.0"
55
- PROTOCOL_VERSION = "5.173.0"
54
+ PACKAGE_VERSION = "5.175.0"
55
+ PROTOCOL_VERSION = "5.175.0"
56
56
  LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
57
57
  OPENSPEC_SCHEMA_NAME = "keel-spec-driven"
58
58
  # Mirrors KEEL_PACKAGE_NAME in scripts/install_to_repo.py, one of the two
@@ -755,7 +755,6 @@ def validate_openspec_schema(errors: list[str]) -> None:
755
755
  "apply:",
756
756
  "/opsx:apply",
757
757
  "keel-review-checklist",
758
- "Owner",
759
758
  "Mode",
760
759
  "Covers",
761
760
  "Read",
@@ -773,7 +772,7 @@ def validate_openspec_schema(errors: list[str]) -> None:
773
772
  "A subagent is the model's choice and is treated as the main agent is",
774
773
  "approved `tasks.md` in order",
775
774
  "Modify only files listed under Touch",
776
- "repository-wide read authority is read-only",
775
+ "reading does not expand write authority",
777
776
  "Out-of-scope Need",
778
777
  "unresolved follow-ups must be owned",
779
778
  "Task Authoring Gate",
@@ -787,7 +786,8 @@ def validate_openspec_schema(errors: list[str]) -> None:
787
786
  "real-task evidence",
788
787
  "one of pass, passed, complete, completed, ok, or done.",
789
788
  "## Expectation Coverage",
790
- "carry a durable owner",
789
+ "carry a disposition",
790
+ "`Resolved here:`",
791
791
  ):
792
792
  if required not in schema:
793
793
  errors.append(f"OpenSpec schema.yaml missing required language: {required}")
@@ -15890,7 +15890,9 @@ def validate_task_contract_core_scenario() -> int:
15890
15890
 
15891
15891
 
15892
15892
  def task_capsule_expanded_fixture() -> str:
15893
- return task_contract_fixture().replace(
15893
+ # No `Owner:`: since #413 the capsule carries an owner only when a task
15894
+ # authors one, so writing the old default is no longer the same as omitting it.
15895
+ return task_contract_fixture().replace(" - Owner: keel-agent\n", "", 1).replace(
15894
15896
  "E1: public behavior",
15895
15897
  "E1: Public behavior passes.",
15896
15898
  ).replace(
@@ -18917,9 +18919,15 @@ def validate_task_body_ends_at_heading_scenario() -> int:
18917
18919
  # one, and a vertical-tdd task compiles to the identical block and the
18918
18920
  # identical fingerprint before and after, measured both ways. So no
18919
18921
  # existing anchor drifted; this fixture is simply a different task now.
18922
+ #
18923
+ # Moved again, deliberately and for every anchor, in 5.175.0 (#413): the
18924
+ # capsule dropped three prohibitions and its default owner. The drift
18925
+ # diagnosis names that move a compiler change, measured with an anchor
18926
+ # recorded by 5.174.0, and the changelog tells each repository to
18927
+ # re-record once.
18920
18928
  pinned = {
18921
- "1.1": "11110c1cdde55df1008c6a2bd9f6bde2bffa286a34ae93addb9cf66fc1e5b90f",
18922
- "2.1": "62f7dfaec87e0614dae7e4935ce1749554f141a23518b094632eb8423e96d54c",
18929
+ "1.1": "7149e77c287d08abd33aae1835e24ff4892771efdfb5d6755b791e2d78436319",
18930
+ "2.1": "bc2d69bcf8718e5825af8f2fb5f318518f74051ea021a61d549691b449ad5929",
18923
18931
  }
18924
18932
  plain = (
18925
18933
  "# Tasks\n\n"
@@ -21625,11 +21633,8 @@ def validate_task_capsule_scenario() -> int:
21625
21633
  != [
21626
21634
  "must not change Acceptance",
21627
21635
  "must not commit",
21628
- "must not continue to another task",
21629
- "must not mark tasks complete",
21630
21636
  "must not push",
21631
21637
  "must not sync or archive",
21632
- "must not transfer Keel ownership",
21633
21638
  ]
21634
21639
  ):
21635
21640
  report("task-capsule omitted default or prohibition authority.")
@@ -25283,6 +25288,16 @@ if (joined === "plugin list --json") {
25283
25288
  if (joined === "plugin update keel@keel-marketplace" || joined === "plugin add keel@keel-marketplace") {
25284
25289
  state[host] = "5.1.0";
25285
25290
  save();
25291
+ // FAKE_CODEX_CACHE: `plugin add` installs into the plugin cache and deletes
25292
+ // the previous version's directory, as Codex does (#412).
25293
+ const cache = process.env.FAKE_CODEX_CACHE;
25294
+ if (host === "codex" && cache) {
25295
+ for (const entry of fs.existsSync(cache) ? fs.readdirSync(cache) : []) {
25296
+ fs.rmSync(path.join(cache, entry), { recursive: true, force: true });
25297
+ }
25298
+ fs.mkdirSync(path.join(cache, "5.1.0", "hooks"), { recursive: true });
25299
+ fs.writeFileSync(path.join(cache, "5.1.0", "hooks", "codex.json"), "{}\n");
25300
+ }
25286
25301
  }
25287
25302
  process.exit(0);
25288
25303
  """
@@ -25532,6 +25547,95 @@ def validate_update_host_query_timeout_scenario() -> int:
25532
25547
  return 0
25533
25548
 
25534
25549
 
25550
+ def validate_update_codex_from_disk_scenario() -> int:
25551
+ """Issue #412: a hung `codex plugin list --json` stopped an update that worked.
25552
+
25553
+ On 2026-10-20 the query hung past 90 s while `codex plugin marketplace
25554
+ upgrade` succeeded by hand in 35 s. Codex's own config and plugin cache say
25555
+ what the query would have, so the update runs from them; with neither, the
25556
+ failure stays a failure (#354), and a local source stays manual.
25557
+ """
25558
+ label = "update-codex-from-disk:"
25559
+ upgrade = ["codex", "plugin", "marketplace", "upgrade", "keel-marketplace"]
25560
+ add = ["codex", "plugin", "add", "keel@keel-marketplace"]
25561
+ with tempfile.TemporaryDirectory(prefix="keel-update-412-", ignore_cleanup_errors=True) as raw:
25562
+ tmp = Path(raw)
25563
+ fake = tmp / "fake.js"
25564
+ write_text(fake, UPDATE_FAKE)
25565
+ launchers = {}
25566
+ for host in ("npm", "claude", "codex"):
25567
+ launcher = tmp / f"fake-{host}"
25568
+ write_text(launcher, f'#!/bin/sh\nFAKE_HOST={host} exec node "{fake}" "$@"\n')
25569
+ launcher.chmod(0o755)
25570
+ launchers[host] = launcher
25571
+
25572
+ def update(source_type: str | None):
25573
+ codex_home = tmp / f"codex-home-{source_type}"
25574
+ if codex_home.exists():
25575
+ shutil.rmtree(codex_home)
25576
+ cache = codex_home / "plugins/cache/keel-marketplace/keel"
25577
+ write_text(cache / "5.0.0/hooks/codex.json", "{}\n")
25578
+ if source_type:
25579
+ write_text(codex_home / "config.toml",
25580
+ "[features]\nx = true\n\n[marketplaces.keel-marketplace]\n"
25581
+ f'source_type = "{source_type}"\n'
25582
+ 'source = "https://github.com/TanglmChris/keel.git"\n\n[other]\ny = 1\n')
25583
+ log, state = tmp / "log.jsonl", tmp / "state.json"
25584
+ for stale in (log, state):
25585
+ if stale.exists():
25586
+ stale.unlink()
25587
+ log.write_text("")
25588
+ env = dict(os.environ)
25589
+ env.update({
25590
+ "KEEL_UPDATE_NPM": str(launchers["npm"]), "KEEL_UPDATE_CLAUDE": str(launchers["claude"]),
25591
+ "KEEL_UPDATE_CODEX": str(launchers["codex"]), "CODEX_HOME": str(codex_home),
25592
+ "KEEL_UPDATE_QUERY_TIMEOUT_MS": "2000", "FAKE_LIST_SLEEP_CODEX": "15",
25593
+ "FAKE_LOG": str(log), "FAKE_STATE": str(state), "FAKE_CODEX_SOURCE": str(tmp / "codex-source"),
25594
+ "FAKE_CODEX_CACHE": str(cache),
25595
+ })
25596
+ env.pop("KEEL_UPDATE_SOURCE", None)
25597
+ result = subprocess.run(["node", str(ROOT / "bin/keel.js"), "--update"], cwd=tmp, env=env,
25598
+ text=True, capture_output=True, check=False, timeout=120)
25599
+ calls = [json.loads(line) for line in log.read_text().splitlines() if line.strip()]
25600
+ line = next((l for l in result.stdout.splitlines() if l.startswith("keel update: codex plugin:")), "")
25601
+ return result, calls, line, cache
25602
+
25603
+ result, calls, line, cache = update("git")
25604
+ for args in (upgrade, add):
25605
+ runs = sum(1 for c in calls if c[:len(args)] == args)
25606
+ if runs != 1:
25607
+ report(f"{label} with a git marketplace on disk, {' '.join(args)} ran {runs} time(s), not 1: {line!r}")
25608
+ return 1
25609
+ for needle in ("5.0.0 -> 5.1.0", "did not answer", str(cache)):
25610
+ if needle not in line:
25611
+ report(f"{label} the Codex line does not name {needle!r}: {line!r}")
25612
+ return 1
25613
+ if result.returncode != 0:
25614
+ report(f"{label} an update carried from disk exited {result.returncode}: {result.stdout!r}")
25615
+ return 1
25616
+
25617
+ _, calls, line, _ = update("local")
25618
+ if "manual" not in line:
25619
+ report(f"{label} a local marketplace on disk does not read manual: {line!r}")
25620
+ return 1
25621
+ if any(c[:len(upgrade)] == upgrade for c in calls):
25622
+ report(f"{label} a local marketplace on disk was upgraded: {calls!r}")
25623
+ return 1
25624
+
25625
+ result, calls, line, _ = update(None)
25626
+ if "failed" not in line or "absent" in line:
25627
+ report(f"{label} with no config on disk the Codex line does not read failed: {line!r}")
25628
+ return 1
25629
+ if any(c[:2] == ["codex", "plugin"] and c[2:3] != ["list"] for c in calls):
25630
+ report(f"{label} with no config on disk a Codex update command ran: {calls!r}")
25631
+ return 1
25632
+ if label.rstrip(":") not in {name for name, _ in SCENARIOS}:
25633
+ report(f"{label} the scenario registry does not include it.")
25634
+ return 1
25635
+ report("update-codex-from-disk scenario passed.")
25636
+ return 0
25637
+
25638
+
25535
25639
  def validate_update_claude_refresh_retry_scenario() -> int:
25536
25640
  """Issue #359: the Claude marketplace refresh failed once and passed on a direct retry.
25537
25641
 
@@ -39197,6 +39301,144 @@ def validate_native_capabilities_unrestricted_scenario() -> int:
39197
39301
  return 0
39198
39302
 
39199
39303
 
39304
+ # Sentences the surfaces said after the code stopped saying them (#413).
39305
+ STALE_SURFACE_SENTENCES = (
39306
+ "Owner is the current Keel agent",
39307
+ "retry counting",
39308
+ "Keel Hook completion gate",
39309
+ "unless Touch authorizes diagnostics",
39310
+ "explicitly allows it",
39311
+ "without explicit authorization",
39312
+ "Commands prove Acceptance",
39313
+ "Acceptance, Commands, and Stop/Autonomy",
39314
+ "not a failed attempt",
39315
+ "skills and agents after",
39316
+ "Invoke OpenSpec through",
39317
+ "Remote Control off, the wake task",
39318
+ )
39319
+
39320
+
39321
+ def validate_surfaces_agree_with_code_scenario() -> int:
39322
+ """Issue #413: what the model reads states what the code does.
39323
+
39324
+ #414 removed the protocol's old stance and the capsule kept it: every
39325
+ task-start still printed "must not continue to another task". The other
39326
+ sentences here contradicted the code they describe — a diagnose-only task
39327
+ the parser refuses unless its Touch is `none`, a completion hook no plugin
39328
+ declares, an authorization list ten names long beside a code list of
39329
+ thirteen. The names are read from `src/core/config.js`, so a name added
39330
+ later without its spec line fails here.
39331
+ """
39332
+ label = "surfaces-agree-with-code:"
39333
+ with tempfile.TemporaryDirectory(prefix="keel-surfaces-413-") as raw:
39334
+ repo = Path(raw)
39335
+ write_text(repo / "openspec/changes/demo/tasks.md", task_capsule_compact_fixture())
39336
+ started = run_keel(repo, "gate", "task-start", "--change", "demo", "--task", "1.1", "--no-guard", "--json")
39337
+ if started.returncode != 0:
39338
+ report(f"{label} task-start refused the compact fixture.")
39339
+ report((started.stderr or started.stdout).strip())
39340
+ return 1
39341
+ capsule = json.loads(started.stdout).get("contract", {}).get("capsule", {})
39342
+ if "owner" in capsule:
39343
+ report(f"{label} a task that authors no Owner compiled to owner {capsule['owner']!r}.")
39344
+ return 1
39345
+ kept = ["must not change Acceptance", "must not commit", "must not push", "must not sync or archive"]
39346
+ if capsule.get("prohibitions") != kept:
39347
+ report(f"{label} the capsule prohibits {capsule.get('prohibitions')!r}, not {kept!r}.")
39348
+ return 1
39349
+
39350
+ overlays = []
39351
+ for action in ("apply", "archive", "sync"):
39352
+ overlays.append(ROOT / f".claude/commands/opsx/{action}.md")
39353
+ for name in ("apply-change", "archive-change", "sync-specs"):
39354
+ overlays.append(ROOT / f".claude/skills/openspec-{name}/SKILL.md")
39355
+ overlays.append(ROOT / f".codex/skills/openspec-{name}/SKILL.md")
39356
+ schemas = [
39357
+ ROOT / "assets/openspec/schemas/keel-spec-driven",
39358
+ ROOT / "openspec/schemas/keel-spec-driven",
39359
+ ]
39360
+ required = {
39361
+ ROOT / "AGENTS.md": [
39362
+ "with `Touch: none` and no worktree writes",
39363
+ "a standing authorization in `keel/config.yaml` allows it",
39364
+ "`Verify` checks MUST verify",
39365
+ ],
39366
+ ROOT / "assets/bootstrap/AGENTS.md": [
39367
+ "No commit, push, sync, or archive unless the task, the owner, or `keel/config.yaml` authorizes it.",
39368
+ ],
39369
+ ROOT / "src/skills/keel-debug-failure/SKILL.md": ["expected rather than a stop"],
39370
+ ROOT / PLUGIN_ROOT / "skills/keel-debug-failure/SKILL.md": ["expected rather than a stop"],
39371
+ ROOT / "bin/keel.js": [],
39372
+ ROOT / "src/core/config.js": [],
39373
+ }
39374
+ for schema in schemas:
39375
+ required[schema / "schema.yaml"] = [
39376
+ "equivalence (which also declares `Base:` and `Fields:`)",
39377
+ "`Resolved here:`",
39378
+ "No hook gates completion",
39379
+ ]
39380
+ required[schema / "templates/tasks.md"] = ["equivalence", '"Resolved here:"']
39381
+ for overlay in overlays:
39382
+ required[overlay] = ["Invoke the OpenSpec CLI as `keel openspec"]
39383
+ if "apply" in overlay.as_posix():
39384
+ required[overlay].append("Verify checks prove Acceptance")
39385
+ for surface, sentences in required.items():
39386
+ if not surface.is_file():
39387
+ report(f"{label} {surface.relative_to(ROOT)} is missing, so it cannot be checked.")
39388
+ return 1
39389
+ text = surface.read_text(encoding="utf-8")
39390
+ for phrase in STALE_SURFACE_SENTENCES:
39391
+ if phrase in text:
39392
+ report(f"{label} {surface.relative_to(ROOT)} still says {phrase!r}.")
39393
+ return 1
39394
+ for sentence in sentences:
39395
+ if sentence not in text:
39396
+ report(f"{label} {surface.relative_to(ROOT)} does not say {sentence!r}.")
39397
+ return 1
39398
+ if surface in overlays and text.count("keel openspec …") != 1:
39399
+ report(f"{label} {surface.relative_to(ROOT)} tells the agent to use `keel openspec` {text.count('keel openspec …')} times, not once.")
39400
+ return 1
39401
+
39402
+ help_text = run_keel(ROOT, "--help").stdout
39403
+ for command in ("keel patrol", "keel tick"):
39404
+ if command not in help_text:
39405
+ report(f"{label} keel --help does not name {command!r}.")
39406
+ return 1
39407
+ chat_help = run_keel(ROOT, "chat", "help").stdout
39408
+ if "post-tool-use" not in chat_help:
39409
+ report(f"{label} keel chat help does not name the post-tool-use hook.")
39410
+ return 1
39411
+
39412
+ config = (ROOT / "src/core/config.js").read_text(encoding="utf-8")
39413
+ declared = re.search(r"const STANDING_AUTHORIZATION_ACTIONS = \[(.*?)\];", config, re.S)
39414
+ names = re.findall(r'^\s*"([a-z-]+)",', declared.group(1), re.M) if declared else []
39415
+ if len(names) < 13:
39416
+ report(f"{label} read {len(names)} standing-authorization names from config.js; expected at least 13.")
39417
+ return 1
39418
+ standing = (ROOT / "openspec/specs/keel-standing-authorization/spec.md").read_text(encoding="utf-8")
39419
+ vocabulary = re.search(r"(?s)### Requirement: A repository declares standing authorization in a closed vocabulary\n(.*?)\n#### ", standing)
39420
+ if not vocabulary:
39421
+ report(f"{label} keel-standing-authorization has no closed-vocabulary requirement to read.")
39422
+ return 1
39423
+ for name in names:
39424
+ if f"`{name}`" not in vocabulary.group(1):
39425
+ report(f"{label} keel-standing-authorization does not list `{name}` in its closed vocabulary.")
39426
+ return 1
39427
+ for spec, phrase in (
39428
+ ("keel-domain-lenses", "reads only the lens"),
39429
+ ("keel-domain-lenses", "no other lens is loaded"),
39430
+ ("keel-task-capsule", "current-agent ownership"),
39431
+ ):
39432
+ if phrase in (ROOT / f"openspec/specs/{spec}/spec.md").read_text(encoding="utf-8"):
39433
+ report(f"{label} {spec} still says {phrase!r}.")
39434
+ return 1
39435
+ if label.rstrip(":") not in {name for name, _ in SCENARIOS}:
39436
+ report(f"{label} the scenario registry does not include it.")
39437
+ return 1
39438
+ report(f"{label.rstrip(':')} scenario passed.")
39439
+ return 0
39440
+
39441
+
39200
39442
  def validate_tdd_strategy_guide_scenario() -> int:
39201
39443
  """Issue #389: the skill an executor loads to plan its checks says how to choose.
39202
39444
 
@@ -41101,6 +41343,7 @@ SCENARIOS: tuple = (
41101
41343
  ("update-host-query-retry", validate_update_host_query_retry_scenario),
41102
41344
  ("update-claude-refresh-retry", validate_update_claude_refresh_retry_scenario),
41103
41345
  ("update-host-query-timeout", validate_update_host_query_timeout_scenario),
41346
+ ("update-codex-from-disk", validate_update_codex_from_disk_scenario),
41104
41347
  ("refresh-covers-every-target", validate_refresh_covers_every_target_scenario),
41105
41348
  ("directory-branch-advances", validate_directory_branch_advances_scenario),
41106
41349
  ("release-notes-name-the-directory-branch", validate_release_notes_name_the_directory_branch_scenario),
@@ -41314,6 +41557,7 @@ SCENARIOS: tuple = (
41314
41557
  ("tdd-strategy-guide", validate_tdd_strategy_guide_scenario),
41315
41558
  ("native-capabilities-unrestricted", validate_native_capabilities_unrestricted_scenario),
41316
41559
  ("native-projections-removed", validate_native_projections_removed_scenario),
41560
+ ("surfaces-agree-with-code", validate_surfaces_agree_with_code_scenario),
41317
41561
  (
41318
41562
  "a-tier-declares-what-is-skipped",
41319
41563
  validate_a_tier_declares_what_is_skipped_scenario,
@@ -41401,9 +41645,10 @@ def validate_openspec_invocable(errors: list[str]) -> None:
41401
41645
  cli = (ROOT / "bin/keel.js").read_text(encoding="utf-8")
41402
41646
  if 'options.action === "openspec"' not in cli:
41403
41647
  errors.append("bin/keel.js must implement the `keel openspec` passthrough.")
41404
- if cli.count("Invoke OpenSpec through") < 2:
41648
+ # Once per overlay, in the header every action shares (#413).
41649
+ if cli.count("Invoke the OpenSpec CLI as `keel openspec") < 2:
41405
41650
  errors.append(
41406
- "the apply and archive overlays must direct agents to `keel openspec` "
41651
+ "the apply, archive, and sync overlays must direct agents to `keel openspec` "
41407
41652
  "in place of a bare openspec command."
41408
41653
  )
41409
41654
 
@@ -48,7 +48,7 @@ const USAGE = [
48
48
  "keel chat bot add|remove <name> | list (the Slack bots this machine holds Keychain tokens for, as bot:<name> and app:<name>)",
49
49
  "keel chat notice (what is unread and addressed to you, for any host; always exits 0)",
50
50
  "keel chat notice --check (for schedulers: no output; exit 0 only when something addressed to you is unread, else 1)",
51
- "keel chat hook session-start|user-prompt-submit|file-changed|session-end (Claude Code hook; JSON on stdin)",
51
+ "keel chat hook session-start|user-prompt-submit|post-tool-use|file-changed|session-end (Claude Code hook; JSON on stdin)",
52
52
  "keel chat wake add [--host codex] [--thread <id>] [--max-per-hour <n>] [--compact-at <tokens>] (this machine starts a Codex turn when something addressed to this worktree's role arrives)",
53
53
  "keel chat wake remove (stop waking this worktree's role on this machine)",
54
54
  "keel chat wake status [--json]",
@@ -36,8 +36,9 @@ const STANDING_AUTHORIZATION_ACTIONS = [
36
36
  // (#319). It reaches that one session, so it takes no scope.
37
37
  "shift-restore",
38
38
  // A session's own four outgoing steps on the desktop app, after `keel shift
39
- // ready --wake` stored its note: Remote Control off, the wake task, the
40
- // rename, and the clear (#319). Never the decision to change shift.
39
+ // ready --wake` stored its note: the wake task, starting it, the rename,
40
+ // and the clear (#319; Remote Control stays on since #324). Never the
41
+ // decision to change shift.
41
42
  "self-shift",
42
43
  ];
43
44
 
@@ -1481,7 +1481,7 @@ function compileTaskContract(repo, change, task, options = {}) {
1481
1481
  id: task.id,
1482
1482
  title: normalizeText(task.title),
1483
1483
  },
1484
- owner: normalizeText(field(task, "Owner")) || "keel-agent",
1484
+ ...(normalizeText(field(task, "Owner")) ? { owner: normalizeText(field(task, "Owner")) } : {}),
1485
1485
  mode,
1486
1486
  authority,
1487
1487
  read,
@@ -1543,11 +1543,8 @@ function compileTaskContract(repo, change, task, options = {}) {
1543
1543
  // Whether the action it performed was the authorized one is a Review
1544
1544
  // judgment; what the capsule fixes is the write posture.
1545
1545
  ...(mode === "repo-action" ? [] : ["must not commit"]),
1546
- "must not continue to another task",
1547
- "must not mark tasks complete",
1548
1546
  "must not push",
1549
1547
  "must not sync or archive",
1550
- "must not transfer Keel ownership",
1551
1548
  ...(NO_WRITE_MODES.has(mode) ? ["must not write product files"] : []),
1552
1549
  ],
1553
1550
  };