@workit-dev/codex 2.13.0 → 2.14.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": "workit",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -0,0 +1,26 @@
1
+ # Generated by Workit from packages/workit-claude-code/agents/babysitter.md; edits are overwritten on the next plugin start.
2
+ name = "workit-babysitter"
3
+ description = "Drives one pushed PR to its endpoint - polls its status, fixes red CI in the PR's own worktree, answers review threads - and reports when it is ready, merged or blocked. Use to babysit a PR in the background after it is opened."
4
+ developer_instructions = '''You are the workit babysitter for one PR. Follow the workit-ship skill
5
+ (`$workit-ship`): its babysit loop is your job.
6
+
7
+ 1. Work only in the checkout or worktree your prompt names, on the PR's own
8
+ branch; never in another branch. Run Workit against it, one verb per call:
9
+ `workit pr status --cwd <worktree> --json`, `workit check --cwd <worktree> <name>`,
10
+ `workit git --cwd <worktree> commit …`.
11
+ 2. Act on `babysit` in `workit pr status --json`: wait, fix a red check at its
12
+ root (reproduce it with `workit check` first), answer each unresolved thread,
13
+ or stop at the endpoint your prompt names (`ready` by default).
14
+ 3. Merge only when your prompt or the grant says `merged`; never force-push,
15
+ rebase or retarget unless your prompt says so.
16
+ 4. A fix you cannot make in one round, a product choice, or a check that stays
17
+ red after one fix: stop and report it.
18
+
19
+ Before your final report, wait for or stop every background command you started
20
+ (the host shows you running while one lives); never report with one still running.
21
+
22
+ Report: the PR, its head SHA and endpoint, each check and thread you acted on,
23
+ and anything left for the lead.
24
+
25
+ Codex does not isolate subagents: work only in the checkout or worktree your prompt names, never in another one.
26
+ '''
@@ -0,0 +1,27 @@
1
+ # Generated by Workit from packages/workit-claude-code/agents/decider.md; edits are overwritten on the next plugin start.
2
+ name = "workit-decider"
3
+ description = "Fresh read-only decider for a stuck call - a failed fix round and recheck, or a worker and a reviewer who disagree - that returns the options, a pick by reversibility and the exact change list. Use instead of a third review round; never for a product choice."
4
+ sandbox_mode = "read-only"
5
+ developer_instructions = '''You are the workit decider. You wrote none of the work and change none of it:
6
+ you read, decide and report. Follow the workit-fanout skill
7
+ (`$workit-fanout`, "Stuck calls: the decider").
8
+
9
+ 1. Read the dispute itself: the brief or acceptance, the diff
10
+ (`git -C <worktree> diff <base>...HEAD`), the failed findings and the
11
+ author's answer, and `workit ledger list --type decision`.
12
+ 2. List the real options (two or three), each with what it costs if wrong.
13
+ 3. Pick one by reversibility: the option cheapest to undo wins a tie.
14
+ 4. Give the exact change list for the pick: file, what changes, and the check
15
+ that proves it, so the fixer applies it once.
16
+
17
+ A product choice, or authority nobody here has, is not yours: say so and name
18
+ the question for the user. The lead records your pick with
19
+ `workit ledger decision`; you record nothing.
20
+
21
+ Before your final report, wait for or stop every background command you started
22
+ (the host shows you running while one lives); never report with one still running.
23
+
24
+ Never commit, push, merge or edit. Write only in your session's scratchpad.
25
+
26
+ Codex runs you in a read-only sandbox: read and run read-only commands only, and record nothing.
27
+ '''
@@ -15515,7 +15515,7 @@ var workspaceConfigSchema = object({
15515
15515
  fanout: object({
15516
15516
  tierModels: unknown().optional().describe("The model per slice TIER (mundane, standard, hard), as one name or per host.")
15517
15517
  }).passthrough().optional().describe("Fanout settings."),
15518
- models: object({ roles: modelRoles }).passthrough().optional().describe("Model and effort per role and host (roles), the lead's own advisory model (lead) and whether a model the lead names on a spawn wins (allowLeadOverride, default false); the same key at the top of workspaces.json is the global default."),
15518
+ models: object({ roles: modelRoles }).passthrough().optional().describe("Model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false); the same key at the top of workspaces.json is the global default."),
15519
15519
  resources: unknown().optional().describe("Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
15520
15520
  remotes: array(nonBlank.refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")).optional().describe("Remote URLs this entry owns: a checkout pushing to or opening PRs on one never exceeds this entry's grants, wherever the folder is (`owner/*` claims a whole owner). Only the user changes it, in their own terminal."),
15521
15521
  autonomy: object(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
@@ -15553,7 +15553,7 @@ var workspaceConfigSchema = object({
15553
15553
  });
15554
15554
  var workspacesFileSchema = object({
15555
15555
  workspaces: array(workspaceConfigSchema).optional().describe("Workspace entries, each mapping a path glob to its forge, policies and grants."),
15556
- models: object({ roles: modelRoles }).passthrough().optional().describe("The global default model and effort per role and host (roles), the lead's own advisory model (lead) and whether a model the lead names on a spawn wins (allowLeadOverride, default false).")
15556
+ models: object({ roles: modelRoles }).passthrough().optional().describe("The global default model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false).")
15557
15557
  }).passthrough().superRefine((file, context) => {
15558
15558
  const names = new Set;
15559
15559
  for (const [index, workspace] of (file.workspaces ?? []).entries()) {
@@ -23668,16 +23668,19 @@ var HOST_KEYS = new Set([
23668
23668
  "pi",
23669
23669
  "default"
23670
23670
  ]);
23671
- var BUILT_IN_CLAUDE_CODE = {
23671
+ var CLAUDE_AGENT_FILES = {
23672
23672
  decider: { model: "fable", effort: "high" },
23673
- "implementer.hard": { model: "opus" },
23674
- "implementer.standard": { model: "sonnet" },
23675
- "implementer.mundane": { model: "haiku" },
23673
+ implementer: { model: "sonnet" },
23676
23674
  verifier: { model: "sonnet" },
23677
23675
  reviewer: { model: "opus" },
23678
- explore: { model: "haiku" },
23679
23676
  babysit: { model: "haiku" }
23680
23677
  };
23678
+ var BUILT_IN_CLAUDE_CODE = {
23679
+ ...CLAUDE_AGENT_FILES,
23680
+ "implementer.hard": { model: "opus" },
23681
+ "implementer.standard": { model: "sonnet" },
23682
+ "implementer.mundane": { model: "haiku" }
23683
+ };
23681
23684
  var isObject6 = (value) => !!value && typeof value === "object" && !Array.isArray(value);
23682
23685
  var name = (value) => typeof value === "string" && value.trim() ? value.trim() : null;
23683
23686
  var leaf = (value) => {
@@ -23761,18 +23764,20 @@ var firstAvailable = (candidates, host, now = new Date) => {
23761
23764
  }
23762
23765
  return { ...primary, skipped, allExhausted: true };
23763
23766
  };
23767
+ var FILE_ROLES = new Set(["decider", "verifier", "reviewer", "babysit"]);
23764
23768
  var CLAUDE_ALIASES = new Set(["sonnet", "opus", "haiku", "fable"]);
23765
23769
  var CLAUDE_EFFORTS = new Set(["low", "medium", "high", "xhigh", "max"]);
23766
23770
  var CLAUDE_SPAWNS = [
23767
- ...["hard", "standard", "mundane"].map((tier) => ({
23768
- label: tier === "hard" ? "workit:implementer hard" : tier,
23771
+ ...MODEL_TIERS.map((tier) => ({
23772
+ label: `workit:implementer ${tier}`,
23769
23773
  selector: { role: "implementer", tier }
23770
23774
  })),
23771
- { label: "workit:verifier", selector: { role: "verifier" } },
23772
- { label: "workit:reviewer", selector: { role: "reviewer" } },
23775
+ ...["verifier", "reviewer", "decider"].map((role) => ({
23776
+ label: `workit:${role}`,
23777
+ selector: { role }
23778
+ })),
23779
+ { label: "workit:babysitter", selector: { role: "babysit" } },
23773
23780
  { label: "Explore", selector: { role: "explore" } },
23774
- { label: "ROLE: decider", selector: { role: "decider" } },
23775
- { label: "ROLE: babysit", selector: { role: "babysit" } },
23776
23781
  { label: "general-purpose", selector: { role: "default" } }
23777
23782
  ];
23778
23783
  var uniformImplementerModel = (cwd, host, dir) => {
@@ -31762,7 +31767,13 @@ import {
31762
31767
  } from "node:fs";
31763
31768
  import os6 from "node:os";
31764
31769
  import path37 from "node:path";
31765
- var CODEX_AGENT_ROLES = ["verifier", "reviewer", "implementer"];
31770
+ var CODEX_AGENT_ROLES = [
31771
+ "verifier",
31772
+ "reviewer",
31773
+ "implementer",
31774
+ "decider",
31775
+ "babysitter"
31776
+ ];
31766
31777
  var CODEX_AGENT_MARKER = "# Generated by Workit";
31767
31778
  var codexAgentName = (role) => `workit-${role}`;
31768
31779
  var codexAgentFile = (role) => `${codexAgentName(role)}.toml`;
@@ -31918,10 +31929,15 @@ var codexContextProvider = (host = detectCodexSurface(process.env), root) => ({
31918
31929
  var pluginRoot = () => path38.resolve(path38.dirname(fileURLToPath3(import.meta.url)), "..");
31919
31930
  var codexRoleModels = (cwd) => {
31920
31931
  const out = {};
31921
- for (const role of ["verifier", "reviewer"]) {
31932
+ for (const [file, role] of [
31933
+ ["verifier", "verifier"],
31934
+ ["reviewer", "reviewer"],
31935
+ ["decider", "decider"],
31936
+ ["babysitter", "babysit"]
31937
+ ]) {
31922
31938
  const found = resolveRoleModel(cwd, { role }, "codex");
31923
31939
  if (found)
31924
- out[role] = { model: found.model, effort: found.effort };
31940
+ out[file] = { model: found.model, effort: found.effort };
31925
31941
  }
31926
31942
  const implementer = uniformImplementerModel(cwd, "codex");
31927
31943
  if (implementer)
@@ -7356,7 +7356,7 @@ var workspaceConfigSchema = object({
7356
7356
  fanout: object({
7357
7357
  tierModels: unknown().optional().describe("The model per slice TIER (mundane, standard, hard), as one name or per host.")
7358
7358
  }).passthrough().optional().describe("Fanout settings."),
7359
- models: object({ roles: modelRoles }).passthrough().optional().describe("Model and effort per role and host (roles), the lead's own advisory model (lead) and whether a model the lead names on a spawn wins (allowLeadOverride, default false); the same key at the top of workspaces.json is the global default."),
7359
+ models: object({ roles: modelRoles }).passthrough().optional().describe("Model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false); the same key at the top of workspaces.json is the global default."),
7360
7360
  resources: unknown().optional().describe("Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
7361
7361
  remotes: array(nonBlank.refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")).optional().describe("Remote URLs this entry owns: a checkout pushing to or opening PRs on one never exceeds this entry's grants, wherever the folder is (`owner/*` claims a whole owner). Only the user changes it, in their own terminal."),
7362
7362
  autonomy: object(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
@@ -7394,7 +7394,7 @@ var workspaceConfigSchema = object({
7394
7394
  });
7395
7395
  var workspacesFileSchema = object({
7396
7396
  workspaces: array(workspaceConfigSchema).optional().describe("Workspace entries, each mapping a path glob to its forge, policies and grants."),
7397
- models: object({ roles: modelRoles }).passthrough().optional().describe("The global default model and effort per role and host (roles), the lead's own advisory model (lead) and whether a model the lead names on a spawn wins (allowLeadOverride, default false).")
7397
+ models: object({ roles: modelRoles }).passthrough().optional().describe("The global default model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false).")
7398
7398
  }).passthrough().superRefine((file, context) => {
7399
7399
  const names = new Set;
7400
7400
  for (const [index, workspace] of (file.workspaces ?? []).entries()) {
@@ -8907,16 +8907,19 @@ var HOST_KEYS = new Set([
8907
8907
  "pi",
8908
8908
  "default"
8909
8909
  ]);
8910
- var BUILT_IN_CLAUDE_CODE = {
8910
+ var CLAUDE_AGENT_FILES = {
8911
8911
  decider: { model: "fable", effort: "high" },
8912
- "implementer.hard": { model: "opus" },
8913
- "implementer.standard": { model: "sonnet" },
8914
- "implementer.mundane": { model: "haiku" },
8912
+ implementer: { model: "sonnet" },
8915
8913
  verifier: { model: "sonnet" },
8916
8914
  reviewer: { model: "opus" },
8917
- explore: { model: "haiku" },
8918
8915
  babysit: { model: "haiku" }
8919
8916
  };
8917
+ var BUILT_IN_CLAUDE_CODE = {
8918
+ ...CLAUDE_AGENT_FILES,
8919
+ "implementer.hard": { model: "opus" },
8920
+ "implementer.standard": { model: "sonnet" },
8921
+ "implementer.mundane": { model: "haiku" }
8922
+ };
8920
8923
  var isObject2 = (value) => !!value && typeof value === "object" && !Array.isArray(value);
8921
8924
  var name = (value) => typeof value === "string" && value.trim() ? value.trim() : null;
8922
8925
  var leaf = (value) => {
@@ -8948,6 +8951,10 @@ var forHostList = (value, host) => {
8948
8951
  return [];
8949
8952
  };
8950
8953
  var rolesOf = (models) => isObject2(models) && isObject2(models.roles) ? models.roles : null;
8954
+ var resolveRoleModel = (cwd, selector, host, dir) => {
8955
+ const chosen = firstAvailable(resolveRoleModels(cwd, selector, host, dir), host);
8956
+ return chosen ? { model: chosen.model, effort: chosen.effort, source: chosen.source } : null;
8957
+ };
8951
8958
  var resolveRoleModels = (cwd, selector, host, dir) => {
8952
8959
  const { role, tier } = selector;
8953
8960
  for (const source of modelSources(cwd, dir)) {
@@ -9002,12 +9009,15 @@ var fallbackText = (chosen) => {
9002
9009
  const passed = chosen.skipped.map((one) => `${one.model} (${one.provider} exhausted until ${shortTime(one.until)})`).join(", ");
9003
9010
  return chosen.allExhausted ? `every model configured for it is exhausted: ${passed}; it runs on ${chosen.model} anyway. Add a model of another provider to the list in workspaces.json, then run \`workit models show\`.` : `fell back past ${passed}.`;
9004
9011
  };
9005
- var leadOverrideAllowed = (cwd, dir) => {
9012
+ var modelsKey = (cwd, key, dir) => {
9006
9013
  for (const source of modelSources(cwd, dir))
9007
- if (isObject2(source.models) && Object.hasOwn(source.models, "allowLeadOverride"))
9008
- return source.models.allowLeadOverride === true;
9009
- return false;
9014
+ if (isObject2(source.models) && Object.hasOwn(source.models, key))
9015
+ return source.models[key];
9016
+ return;
9010
9017
  };
9018
+ var leadOverrideAllowed = (cwd, dir) => modelsKey(cwd, "allowLeadOverride", dir) === true;
9019
+ var enforceMode = (cwd, dir) => modelsKey(cwd, "enforce", dir) === "strict" ? "strict" : "advise";
9020
+ var FILE_ROLES = new Set(["decider", "verifier", "reviewer", "babysit"]);
9011
9021
  var CLAUDE_ALIASES = new Set(["sonnet", "opus", "haiku", "fable"]);
9012
9022
  var CLAUDE_EFFORTS = new Set(["low", "medium", "high", "xhigh", "max"]);
9013
9023
  var FULL_CLAUDE_ID = /^(?:[\w.-]+[./])?claude-(?:\d[\d.-]*-)?(sonnet|opus|haiku|fable)(?:[-.@[]|$)/u;
@@ -9033,7 +9043,7 @@ var chooseSpawnModel = (cwd, selector, host, given, accept, dir) => {
9033
9043
  const givenModel = name(given.model);
9034
9044
  const label = roleLabel(selector);
9035
9045
  const configured = resolved.source !== "built-in";
9036
- if (givenModel && (!configured || leadOverrideAllowed(cwd, dir)))
9046
+ if (givenModel && (!configured || enforceMode(cwd, dir) === "advise" || leadOverrideAllowed(cwd, dir)))
9037
9047
  return none;
9038
9048
  const model = accept(resolved.model);
9039
9049
  const effort = resolved.effort && !name(given.effort) ? resolved.effort : null;
@@ -9059,40 +9069,34 @@ var chooseSpawnModel = (cwd, selector, host, given, accept, dir) => {
9059
9069
  model,
9060
9070
  effort,
9061
9071
  basis,
9062
- note: givenModel ? `Workit replaced model ${givenModel} with ${model} on this spawn: role ${label} is set in ${resolved.source}.${why} Next time ${next} on the spawn. To let a spawn's own model win, set "allowLeadOverride": true under models in workspaces.json.` : `Workit set ${model}${effort ? ` (effort ${effort})` : ""} on this spawn: role ${label}, ${resolved.source}.${why}${configured ? "" : " Name a model to choose another."}`
9063
- };
9064
- };
9065
- var claudeSpawnArgs = (cwd, selector, dir) => {
9066
- const choice = chooseSpawnModel(cwd, selector, "claude_code", {}, claudeAgentModel, dir);
9067
- if (!choice.model)
9068
- return null;
9069
- const effort = choice.effort?.toLowerCase() ?? null;
9070
- return {
9071
- model: choice.model,
9072
- effort: effort && CLAUDE_EFFORTS.has(effort) ? effort : null
9072
+ note: givenModel ? `Workit replaced model ${givenModel} with ${model} on this spawn: role ${label} is set in ${resolved.source}.${why} Next time ${next} on the spawn, or set models.enforce "advise" so a named model wins.` : `Workit set ${model}${effort ? ` (effort ${effort})` : ""} on this spawn: role ${label}, ${resolved.source}.${why}${configured ? "" : " Name a model to choose another."}`
9073
9073
  };
9074
9074
  };
9075
9075
  var CLAUDE_SPAWNS = [
9076
- ...["hard", "standard", "mundane"].map((tier) => ({
9077
- label: tier === "hard" ? "workit:implementer hard" : tier,
9076
+ ...MODEL_TIERS.map((tier) => ({
9077
+ label: `workit:implementer ${tier}`,
9078
9078
  selector: { role: "implementer", tier }
9079
9079
  })),
9080
- { label: "workit:verifier", selector: { role: "verifier" } },
9081
- { label: "workit:reviewer", selector: { role: "reviewer" } },
9080
+ ...["verifier", "reviewer", "decider"].map((role) => ({
9081
+ label: `workit:${role}`,
9082
+ selector: { role }
9083
+ })),
9084
+ { label: "workit:babysitter", selector: { role: "babysit" } },
9082
9085
  { label: "Explore", selector: { role: "explore" } },
9083
- { label: "ROLE: decider", selector: { role: "decider" } },
9084
- { label: "ROLE: babysit", selector: { role: "babysit" } },
9085
9086
  { label: "general-purpose", selector: { role: "default" } }
9086
9087
  ];
9087
9088
  var claudeSpawnTable = (cwd, dir) => {
9088
9089
  const rows = CLAUDE_SPAWNS.flatMap(({ label, selector }) => {
9089
- const args = claudeSpawnArgs(cwd, selector, dir);
9090
- return args ? [`${label} ${args.model}${args.effort ? `/${args.effort}` : ""}`] : [];
9090
+ const want = resolveRoleModel(cwd, selector, "claude_code", dir);
9091
+ const model = want && want.source !== "built-in" ? claudeAgentModel(want.model) : null;
9092
+ const effort = want?.effort?.toLowerCase();
9093
+ const file = label.startsWith("workit:") ? CLAUDE_AGENT_FILES[selector.role] : undefined;
9094
+ return model && (model !== file?.model || effort !== file.effort) ? [`${label} ${model}${effort ? `/${effort}` : ""}`] : [];
9091
9095
  });
9092
- return rows.length ? `Agent spawn model/effort (pass them, workers with run_in_background: true): ${rows.join(", ")}. Implementer prompt: \`workit fanout brief <slice>\` after \`workit fanout worktree create <slice>\`, even for one slice.` : null;
9096
+ return `Spawn Workit roles by name (workit:implementer, workit:verifier, workit:reviewer, workit:decider, workit:babysitter; search: Explore), workers with run_in_background: true, and pass no model or effort unless the user named one${rows.length ? `; configured here (pass them): ${rows.join(", ")}` : ""}. Implementer prompt: \`workit fanout brief <slice>\` after \`workit fanout worktree create <slice>\`, even for one slice.`;
9093
9097
  };
9094
9098
  var ROLE_SELECTORS = MODEL_ROLES.flatMap((role) => role === "implementer" ? MODEL_TIERS.map((tier) => ({ role, tier })) : [{ role }]);
9095
- var AGENT_ROLE = /^(?:workit[:-])?(decider|implementer|verifier|reviewer|explore|babysit)$/iu;
9099
+ var AGENT_ROLE = /^(?:workit[:-])?(decider|implementer|verifier|reviewer|explore|babysit)(?:(?<=babysit)ter)?$/iu;
9096
9100
  var ROLE_LINE = /^[ \t]*ROLE:[ \t]*(decider|implementer|verifier|reviewer|explore|babysit)\b/imu;
9097
9101
  var TIER_LINE = /^[ \t]*TIER:[ \t]*(mundane|standard|hard)\b/imu;
9098
9102
  var isBrief = (text) => TIER_LINE.test(text) && /^WORKTREE:/mu.test(text);
@@ -23903,11 +23907,12 @@ var respawn = (input, reasons, dropped, limits) => {
23903
23907
  return {
23904
23908
  kind: "deny",
23905
23909
  reason: [
23906
- `workit spawn args: spawn again with exactly ${args} (description and prompt as written${without}).`,
23907
- ...reasons,
23908
- "Workit denies instead of rewriting the spawn: Claude Code's auto mode refuses a hook-rewritten spawn.",
23910
+ `workit spawn args: ${reasons.join(" ")}`,
23911
+ `Retry as: Agent ${args} (description and prompt as written${without}).`,
23912
+ "Why: auto mode refuses a hook-rewritten spawn.",
23909
23913
  limits
23910
- ].filter(Boolean).join(" "),
23914
+ ].filter(Boolean).join(`
23915
+ `),
23911
23916
  unblock: args
23912
23917
  };
23913
23918
  };
@@ -23942,18 +23947,19 @@ var agentModelDecision = (cwd, tool, options = {}) => {
23942
23947
  if (!selector)
23943
23948
  return asWritten(null);
23944
23949
  const choice = chooseSpawnModel(cwd, selector, "claude_code", tool, claudeAgentModel);
23950
+ const file = String(tool.subagent_type).startsWith("workit:") ? CLAUDE_AGENT_FILES[selector.role] : undefined;
23945
23951
  const effort = choice.effort?.toLowerCase() ?? null;
23946
23952
  const input = { ...tool };
23947
- if (choice.model)
23953
+ if (choice.model && (given(tool.model) || choice.model !== file?.model))
23948
23954
  input.model = choice.model;
23949
- if (effort && CLAUDE_EFFORTS.has(effort) && !given(tool.effort))
23955
+ if (effort && CLAUDE_EFFORTS.has(effort) && !given(tool.effort) && effort !== file?.effort)
23950
23956
  input.effort = effort;
23951
23957
  const needs = [
23952
23958
  input.model === tool.model ? null : `model ${String(input.model)}`,
23953
23959
  input.effort === tool.effort ? null : `effort ${String(input.effort)}`
23954
23960
  ].filter(Boolean);
23955
23961
  if (!needs.length)
23956
- return asWritten(choice.note);
23962
+ return asWritten(choice.model ? null : choice.note);
23957
23963
  if (!auto) {
23958
23964
  const note = choice.note ?? `Workit set effort ${String(input.effort)} on this spawn: its role's configured effort.`;
23959
23965
  return {
@@ -23963,12 +23969,18 @@ var agentModelDecision = (cwd, tool, options = {}) => {
23963
23969
  `)
23964
23970
  };
23965
23971
  }
23972
+ if (enforceMode(cwd) === "advise") {
23973
+ if (changed)
23974
+ return respawn(tool, change.reasons, change.dropped, limits);
23975
+ const ran = file ? `${file.model}${file.effort ? `/${file.effort}` : ""}` : "its default model";
23976
+ const pass = spawnArgsText({ model: input.model, effort: input.effort });
23977
+ return asWritten(`Workit: this ${String(tool.subagent_type || "general-purpose")} spawn runs on ${ran}; ${choice.basis} sets ${needs.join(" and ")}. To use it, pass ${pass} on the spawn.`);
23978
+ }
23966
23979
  const replaced = given(tool.model) && input.model !== tool.model;
23967
23980
  return respawn(input, [
23968
23981
  ...change.reasons,
23969
- `It needs ${needs.join(" and ")}: ${choice.basis ?? "its role"}.`,
23970
- replaced ? `That replaces model ${String(tool.model)}: a configured role model wins unless "allowLeadOverride": true is set under models in workspaces.json.` : ""
23971
- ].filter(Boolean), change.dropped, limits);
23982
+ `It needs ${needs.join(" and ")} (${choice.basis}, models.enforce strict)${replaced ? `, not ${String(tool.model)}` : ""}.`
23983
+ ], change.dropped, limits);
23972
23984
  };
23973
23985
 
23974
23986
  // packages/workit-core/src/hooks/spawn-gate.ts
@@ -101,7 +101,7 @@ if (quiet) {
101
101
  `);
102
102
  } else {
103
103
  try {
104
- const { runCodexHook } = await import("./workit-hook-4wfr9txp.js");
104
+ const { runCodexHook } = await import("./workit-hook-mcerh8x3.js");
105
105
  await runCodexHook([payload]);
106
106
  } catch (error) {
107
107
  const { answerRuntimeFailure } = await import("./workit-hook-9k8dtngs.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/codex",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "private": false,
5
5
  "description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
6
6
  "keywords": [
@@ -41,8 +41,8 @@
41
41
  "build": "bun scripts/build.ts"
42
42
  },
43
43
  "devDependencies": {
44
- "@workit-dev/core": "^2.13.0",
45
- "@workit-dev/mcp": "^2.13.0"
44
+ "@workit-dev/core": "^2.14.0",
45
+ "@workit-dev/mcp": "^2.14.0"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"
@@ -39,7 +39,7 @@ units of ~100+ lines each. Coupled work stays with one owner. Workit never spawn
39
39
  6. **Retry once, then escalate.** A stuck or failed slice gets one retry with
40
40
  a fresh brief (`workit fanout brief <slice> --mode resume`, same branch);
41
41
  if that fails too, re-slice it, take it over, or report the gap. Never
42
- chain resumes. A fix round and recheck that both fail: a decider, not a
42
+ chain resumes. A fix round and recheck that both fail: the decider agent, not a
43
43
  third round; product choices go to the user (`references/orchestration.md`).
44
44
  7. **Verify by the workspace `verification` setting** (`workit grant show`).
45
45
  A report is a pointer, never evidence. `proportional` (default): each slice's lane (`workit pr status`) decides; none needs no verdict, self the author's `--self`, focused and full a verifier (Claude Code: the `model` and `effort` of `workit models show --role verifier`) after the last push; one verdict at a stack's top covers its unchanged lower PRs, and a stale one with `reverify: focused` re-checks only the new diff, reusing green CI. `self`: a verifier that wrote none
@@ -5,35 +5,37 @@ and fans in. Workit records and checks; the host's own subagents run the work.
5
5
 
6
6
  ## TIER to model
7
7
 
8
- TIER is a field of each slice and of its brief. Role models come from the
9
- workspace (`models.roles`; `fanout.tierModels` still feeds the implementer
10
- tiers) and, on Claude Code, built-in defaults: the brief has a `model:` line
11
- (with `effort:` when set) under TIER and a `verifier:` line; `workit fanout
12
- status` names the model next to each spawnable slice; `workit models show
13
- [--role r] [--host h] --json` lists every role (decider, implementer tiers,
14
- verifier, reviewer, explore, babysit). Pass exactly that `model` (and `effort`
15
- where the host's spawn call takes one) on the spawn call: a subagent that
16
- passes none inherits your model. Scouting and PR babysitting use the `explore`
17
- and `babysit` roles. A role with no model (other hosts without config) runs
18
- on the host's model, and TIER only sizes the timebox and decides whether to
19
- race. Claude Code's built-in defaults, when nothing is configured:
20
-
21
- | Role or TIER | `model` on the Agent call |
8
+ TIER is a field of each slice and of its brief. Each Workit role is a host
9
+ agent that carries its own model: spawn it by name and pass no `model` or
10
+ `effort` unless the user named one (a named model always wins).
11
+
12
+ | Host | Spawn by name |
13
+ | --- | --- |
14
+ | Claude Code | `workit:implementer`, `workit:verifier`, `workit:reviewer`, `workit:decider`, `workit:babysitter`; search: `Explore` |
15
+ | OpenCode | `workit-implementer`, `workit-verifier`, `workit-reviewer`, `workit-decider`, `workit-babysitter` |
16
+ | Codex | the same `workit-*` names |
17
+ | Cursor | `workit-verifier`, `workit-reviewer`, `workit-decider`, `workit-babysitter` |
18
+
19
+ Claude Code, with nothing configured (pass a brief's `SPAWN:` line as printed):
20
+
21
+ | Role or TIER | Model |
22
22
  | --- | --- |
23
- | decider | `fable`, effort `high` |
24
- | hard | `opus` |
25
- | standard | `sonnet` |
26
- | mundane | `haiku` |
27
- | verifier | `sonnet` |
28
- | reviewer | `opus` |
29
- | explore, babysit | `haiku` |
30
-
31
- Claude Code and OpenCode also get the role's model set on the spawn by
32
- Workit; a configured one beats a `model` you pass unless
33
- `models.allowLeadOverride` is true. A general spawn takes
34
- `models.roles.default`, or the role its prompt's `ROLE: <role>` line names.
35
- `models.lead` (your own model) is advisory. `workit models show` marks each
36
- role `enforced` or `advisory` per host: on advisory, pass the model.
23
+ | decider | `fable`, effort `high` (agent file) |
24
+ | hard | `opus` (the brief's SPAWN line) |
25
+ | standard, verifier | `sonnet` (agent file) |
26
+ | mundane | `haiku` (the brief's SPAWN line) |
27
+ | reviewer | `opus` (agent file) |
28
+ | babysitter | `haiku` (agent file) |
29
+
30
+ A role
31
+ configured in `models.roles` to another model is listed in your session
32
+ contract (Claude Code) or set on the host's agent (OpenCode, Codex); `workit
33
+ models show [--role r] [--host h]` prints per host whether it comes from the
34
+ `agent file`, a `spawn fill` or is `advisory` (pass it yourself), and the
35
+ `models.enforce` mode. Under `strict` a configured role model beats a named
36
+ one and Claude Code's auto mode denies a spawn that lacks it. A role with no
37
+ model runs on the host's model, and TIER only sizes the timebox and decides
38
+ whether to race. `models.lead` (your own model) is advisory.
37
39
 
38
40
  ## Rolling window
39
41
 
@@ -66,10 +68,9 @@ reversibility (the option cheapest to undo wins a tie), and the exact change
66
68
  list. The fixer applies that list once, then one focused recheck follows.
67
69
 
68
70
  - Hard call (shared contract, security, migration): two deciders on different
69
- models (Claude Code, OpenCode, Cursor: the `decider` role model and a
70
- different `model` on the spawn, kept on a configured decider role only with
71
- `models.allowLeadOverride`; Codex and Pi: one decider). If they disagree, you take the
72
- more reversible option.
71
+ models (Claude Code, OpenCode, Cursor: one bare decider spawn and one that
72
+ names another `model`; Codex and Pi: one decider). If they disagree, you
73
+ take the more reversible option.
73
74
  - Record it: `workit ledger decision "<pick>" --by decider --why "<why it is
74
75
  the more reversible>" --view "<decider A: view>" --view "<decider B: view>"`.
75
76
  The row is listed as a decider call; it is never the user's answer to a
@@ -45,7 +45,7 @@ those files since the judged head and reuse green CI there (no fresh install, no
45
45
  under your own session (the one the lead or the hook gave you).
46
46
  8. **Bound the loop.** A failed verdict gets one fix round and one recheck of
47
47
  the changed hunks. Still failing, or stuck: no third round; the lead spawns
48
- a decider (read the `workit-fanout` skill's SKILL.md and follow it). A product choice goes to the user.
48
+ the decider agent by name, no model (read the `workit-fanout` skill's SKILL.md and follow it). A product choice: the user.
49
49
  9. **Harness note** (optional): friction caused by the repo or harness, not
50
50
  the change (a flaky fixture, a missing check, a misleading doc or skill
51
51
  line), goes on its own `Harness note:` line in the report and any PR
@@ -29,7 +29,7 @@ once the verdict is accepted. `merged`: step 7. `null` (closed, not merged):
29
29
  stop and report. Stop early only for a new consequential choice, a host
30
30
  denial, a review comment that needs a product decision, a required update
31
31
  that repeats because the base keeps moving, or after 3 failed fix attempts on
32
- the same check. Fix round and recheck both failed: a decider (read the `workit-fanout` skill's SKILL.md and follow it).
32
+ the same check. Fix round and recheck both failed: the decider agent (read the `workit-fanout` skill's SKILL.md and follow it).
33
33
 
34
34
  1. **Open.** Last before the PR, if `workit grant show` has `changelog: update|create`: write the Unreleased entry with `workit changelog apply`, commit it; with `docs: when-user-facing` fix only docs the diff made false (`references/changelog.md`).
35
35
  Full local check (`workit check ci` when `.workit/checks.json` has a `ci` group), push once: `workit git push`, then `workit pr template` and fill the template it prints: every heading, each `<!-- -->` replaced (Workit's: `references/pr-body.md`).