@skathio/somi 3.1.0 → 3.1.1

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.
@@ -13,7 +13,7 @@
13
13
  "url": "https://github.com/skathio/somi.git"
14
14
  },
15
15
  "description": "Multi-agent engineering workflow: discover/design → plan → code → review. Agents declare their own cost tiers and a per-session ceiling selects among them; SOLID, OWASP and clean-code guardrails.",
16
- "version": "3.1.0",
16
+ "version": "3.1.1",
17
17
  "tags": ["workflow", "agents", "review", "security"],
18
18
  "homepage": "https://github.com/skathio/somi"
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "somi",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "displayName": "SoMi",
5
5
  "description": "Multi-agent engineering workflow system: plan, code, review — with SOLID/OWASP guardrails, deterministic hooks, and a global ruleset.",
6
6
  "keywords": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "somi",
3
3
  "displayName": "SoMi",
4
- "version": "3.1.0",
4
+ "version": "3.1.1",
5
5
  "description": "Multi-agent engineering workflow system: plan, code, review — with SOLID/OWASP guardrails, deterministic hooks, and a global ruleset.",
6
6
  "keywords": [
7
7
  "workflow",
@@ -11,7 +11,7 @@
11
11
  "name": "somi",
12
12
  "source": "github:skathio/somi",
13
13
  "description": "Multi-agent engineering workflow: discover/design → plan → code → review. Agents declare their own cost tiers and a per-session ceiling selects among them; SOLID, OWASP and clean-code guardrails.",
14
- "version": "3.1.0",
14
+ "version": "3.1.1",
15
15
  "tags": ["workflow", "agents", "review", "security"],
16
16
  "homepage": "https://github.com/skathio/somi"
17
17
  }
package/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.0
1
+ 3.1.1
package/agents/coder.md CHANGED
@@ -30,9 +30,9 @@ flawed design quietly. You operate inside somi (SOMI) and follow
30
30
  > member, so this stays a hand-edit rather than a declared range.
31
31
 
32
32
  > **Running at `low`.** You learn your dispatched tier only if the spawner tells you. Unless your
33
- > briefing states you were dispatched at `cost: low`, run the full procedure below — never infer
34
- > `low` from budget language, your model, or task size. If you were told you were dispatched at
35
- > `cost: low`: every numbered step below still runs, unconditionally — read the work item state
33
+ > briefing states `dispatched at cost: low` or `requested cost: low`, run the full procedure below — never infer
34
+ > `low` from budget language, your model, or task size. If you were told either (the trim follows the requested tier, not the
35
+ > model: a `low` ceiling keeps trimming where no model is mapped): every numbered step below still runs, unconditionally — read the work item state
36
36
  > (1), read the code before editing (2), mark the iteration in-progress (3), map the change against
37
37
  > the iteration's "Files (approx)" as your wrong-shaped-plan signal (4), take the first Decision
38
38
  > Ladder rung that works (5), implement the smallest sufficient change (6), write and run the tests
package/agents/planner.md CHANGED
@@ -25,9 +25,9 @@ inside somi (SOMI) and follow [`rules/CLAUDE.md`](../rules/CLAUDE.md).
25
25
  > member, so this stays a hand-edit rather than a declared range.
26
26
 
27
27
  > **Running at `low`.** You learn your dispatched tier only if the spawner tells you. Unless your
28
- > briefing states you were dispatched at `cost: low`, run the full procedure below — never infer
29
- > `low` from budget language, your model, or task size. If you were told you were dispatched at
30
- > `cost: low`: still restate the request; still run step 1a's false-premise/XY **and**
28
+ > briefing states `dispatched at cost: low` or `requested cost: low`, run the full procedure below — never infer
29
+ > `low` from budget language, your model, or task size. If you were told either (the trim follows the requested tier, not the
30
+ > model: a `low` ceiling keeps trimming where no model is mapped): still restate the request; still run step 1a's false-premise/XY **and**
31
31
  > contradiction sub-checks (skipping the contradiction check would itself violate this block's own
32
32
  > no-silent-pick promise — a conflict resolved without the user seeing it is a silent pick); still
33
33
  > run the depth gate at step 1c unconditionally; still write `context.md`, `spec.md`, `phases/`,
@@ -24,9 +24,9 @@ change. The tests stay green. The diff is purely structural. You operate inside
24
24
  > See "Running at `low`" below for the specifics.
25
25
 
26
26
  > **Running at `low`.** You learn your dispatched tier only if the spawner tells you. Unless your
27
- > briefing states you were dispatched at `cost: low`, run the full procedure below — never infer
28
- > `low` from budget language, your model, or task size. If you were told you were dispatched at
29
- > `cost: low`: still name the smell precisely, still add characterization tests before touching
27
+ > briefing states `dispatched at cost: low` or `requested cost: low`, run the full procedure below — never infer
28
+ > `low` from budget language, your model, or task size. If you were told either (the trim follows the requested tier, not the
29
+ > model: a `low` ceiling keeps trimming where no model is mapped): still name the smell precisely, still add characterization tests before touching
30
30
  > behavior you don't yet have coverage for, still run the tests after **every individual
31
31
  > transform** — that check never batches — and still preserve behavior exactly. None of that
32
32
  > relaxes; it is the entire contract. What you trim: batch the **commit** boundary only, folding
package/agents/somi.md CHANGED
@@ -78,8 +78,8 @@ choice as it happens, even though you don't pause for approval before making it.
78
78
 
79
79
  **Minimum, even if the skill below can't be loaded:** before this `Task`, call `somi_resolve` for
80
80
  the agent about to start, passing `project_dir`; on an error, map it and stop — never guess a tier
81
- or a model to keep going. Once it succeeds, pass its `model` and put `dispatched at cost: <tier>`
82
- in the agent's briefing. That is the floor that must hold regardless of whether the next paragraph
81
+ or a model to keep going. Once it succeeds, pass its `model` and put the cost line in the agent's
82
+ briefing: `dispatched at cost: <tier>` only when its `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)` — never claim a tier no model was pinned to. That is the floor that must hold regardless of whether the next paragraph
83
83
  loads — a failure to load the skill is never a cue to skip resolution.
84
84
 
85
85
  For everything else — the fallback order when `somi_resolve` can't be reached at all, the exit-code
@@ -150,7 +150,7 @@ rather than in parallel.
150
150
  **A `Task <agent>` line names an agent — resolve and start it through Step 4.** Whenever the
151
151
  procedure you are following calls for starting an agent (not a command) via `Task`, follow
152
152
  [`skills/somi-dispatch/SKILL.md`](../skills/somi-dispatch/SKILL.md) end to end at that point — the
153
- resolve call, the `dispatched at cost: <tier>` briefing line, the model, the retry rule if the host
153
+ resolve call, the briefing's cost line (`dispatched`, or `requested` when unenforced), the model, the retry rule if the host
154
154
  rejects a self-picked model. Resolve right then, not in advance, and not once for the whole
155
155
  command. The one exception: when the procedure itself calls for **several agent `Task`s issued
156
156
  together in one turn** so they run concurrently (`/review-panel` seating its lenses is the shipped
@@ -240,5 +240,5 @@ gate, cannot make Step 5 follow a different procedure than Step 3 announced, and
240
240
  > `somi_command` rather than resolving them; inside those, each `Task planner` / `Task coder` /
241
241
  > `Task reviewer` line goes through Step 4 on its own, at the moment it starts
242
242
  > (`somi_resolve({agent: "coder", host: "copilot", project_dir: "<abs path>"})`, briefing line
243
- > `dispatched at cost: <tier>`). A bare `@somi` would instead have hit branch 1(a) and rendered the
243
+ > `dispatched at cost: <tier>` when `enforced`, else `requested cost: <tier> (not enforced: ...)`). A bare `@somi` would instead have hit branch 1(a) and rendered the
244
244
  > dashboard.
package/commands/adopt.md CHANGED
@@ -24,7 +24,7 @@ This is a composite of existing pieces, run in order, with the user confirming a
24
24
  ## Stage 1 — Build the Repo Atlas (`cost: high`, the expensive step)
25
25
 
26
26
  Before this `Task`, call `somi_resolve` for `atlas` (with `project_dir`), pass its model, and put
27
- `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`,
27
+ the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`,
28
28
  or `somi:somi-dispatch` on Claude Code). Task the `atlas` agent
29
29
  ([`agents/atlas.md`](../agents/atlas.md)) to build or refresh
30
30
  `.somi/atlas.md` (module map, dependency rules, conventions digest, hotspots, test topology,
@@ -35,7 +35,7 @@ or `plan <slug>`.
35
35
  ### 2. Brief the `architecture-reviewer` agent
36
36
 
37
37
  Before this `Task`, call `somi_resolve` for `architecture-reviewer` (with `project_dir`), pass its
38
- model, and put `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill
38
+ model, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill
39
39
  (`somi_skill`, or `somi:somi-dispatch` on Claude Code). Via the Task tool, pass:
40
40
 
41
41
  - The diff or plan-artifact set.
package/commands/atlas.md CHANGED
@@ -20,8 +20,7 @@ member.
20
20
  in-place update on small drift or a rebuild of just the affected sections on structural drift,
21
21
  never the whole atlas.
22
22
  2. **Brief the `atlas` agent** ([`agents/atlas.md`](../agents/atlas.md)) — before this `Task`, call
23
- `somi_resolve` for `atlas` (with `project_dir`), pass its model, and put `dispatched at cost:
24
- <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`, or
23
+ `somi_resolve` for `atlas` (with `project_dir`), pass its model, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`, or
25
24
  `somi:somi-dispatch` on Claude Code) — with the mode. It runs the
26
25
  staleness check itself, does the deep read, and writes `.somi/atlas.md` (and `.somi/README.md`
27
26
  if missing) directly — this command owns no writes here.
@@ -105,7 +105,7 @@ while true:
105
105
  exit 2 → STOP — write remaining ≥Major findings as progress.md follow-ups (by F-id),
106
106
  summarise, exit "max-passes-exceeded"
107
107
 
108
- # 3b. Code — call somi_resolve for coder first (project_dir, model, dispatched-at-cost line in
108
+ # 3b. Code — call somi_resolve for coder first (project_dir, model, cost line in
109
109
  # the briefing); full rules: the somi-dispatch skill (somi_skill, or somi:somi-dispatch on
110
110
  # Claude Code)
111
111
  Task coder ( = /code <slug> phase <N>, iteration <M>, brief = current_findings or initial spec )
package/commands/code.md CHANGED
@@ -64,7 +64,7 @@ unblock first, switch iterations, or proceed despite the block.
64
64
  ### 3. Brief the `coder` agent
65
65
 
66
66
  Before this `Task`, call `somi_resolve` for `coder` (with `project_dir`), pass its model, and put
67
- `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`,
67
+ the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`,
68
68
  or `somi:somi-dispatch` on Claude Code). Via the Task tool, pass:
69
69
 
70
70
  - The work-item slug and `.somi/plans/<slug>/` paths.
package/commands/debug.md CHANGED
@@ -84,7 +84,7 @@ in `rca.md` §3's cause chain, and move on. Rules:
84
84
  cause flips the repro.
85
85
  - After **`MAX_HYPOTHESES`** failed hypotheses: **escalate to the higher-cost tier.** Task the
86
86
  [`reviewer`](../agents/reviewer.md) (declares `cost: medium, high`) — call `somi_resolve` for
87
- `reviewer` first (`project_dir`, its model, `dispatched at cost: <tier>` in the briefing; full
87
+ `reviewer` first (`project_dir`, its model, the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full
88
88
  rules: the `somi-dispatch` skill) — on a **fresh context** with the evidence only —
89
89
  `rca.md` (symptom, repro, cause chain so far, dead hypotheses) and the relevant code — for a
90
90
  differential diagnosis: what candidate causes does the evidence *not yet rule out*, and which
@@ -82,7 +82,7 @@ If `.somi/README.md` does not yet exist at the repo root, also write it from
82
82
  ### 4. Invoke the `designer` agent
83
83
 
84
84
  Before this `Task`, call `somi_resolve` for `designer` (with `project_dir`), pass its model, and put
85
- `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`,
85
+ the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`,
86
86
  or `somi:somi-dispatch` on Claude Code). Brief
87
87
  [`agents/designer.md`](../agents/designer.md) via the Task tool with:
88
88
  - The full feature (kept inside the `user-feature` fence).
@@ -94,7 +94,7 @@ If `.somi/README.md` does not yet exist at the repo root, also write it from
94
94
  ### 4. Invoke the `discovery-analyst` agent
95
95
 
96
96
  Before this `Task`, call `somi_resolve` for `discovery-analyst` (with `project_dir`), pass its
97
- model, and put `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill
97
+ model, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill
98
98
  (`somi_skill`, or `somi:somi-dispatch` on Claude Code). Brief the agent via the
99
99
  Task tool with:
100
100
  - The full idea (kept inside the `user-software-idea` fence).
@@ -19,8 +19,7 @@ $ARGUMENTS
19
19
  ## What to do
20
20
 
21
21
  1. **Brief the `impact` agent** ([`agents/impact.md`](../agents/impact.md)) — before this `Task`,
22
- call `somi_resolve` for `impact` (with `project_dir`), pass its model, and put `dispatched at
23
- cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`, or
22
+ call `somi_resolve` for `impact` (with `project_dir`), pass its model, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`, or
24
23
  `somi:somi-dispatch` on Claude Code) — with the target above (a proposed
25
24
  change, a file/symbol, or a diff range/PR).
26
25
  2. **Relay its report** in-chat: blast radius in one sentence, the callers/contracts/tests table,
@@ -29,7 +29,7 @@ diary entry = the fenced report + the timeline as known. No spec, no phases, no
29
29
  ### 2. Brief the `incident` agent
30
30
 
31
31
  Before this `Task`, call `somi_resolve` for `incident` (with `project_dir`), pass its model, and put
32
- `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`,
32
+ the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`,
33
33
  or `somi:somi-dispatch` on Claude Code). Via the Task tool, pass
34
34
  the slug and the frame from step 1. The agent
35
35
  ([`agents/incident.md`](../agents/incident.md)) mitigates, verifies against the live symptom, and
package/commands/plan.md CHANGED
@@ -130,7 +130,7 @@ If `.somi/README.md` does not yet exist at the repo root, also write it from
130
130
  ### 4. Invoke the `planner` agent
131
131
 
132
132
  Before this `Task`, call `somi_resolve` for `planner` (with `project_dir`), pass its model, and put
133
- `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`,
133
+ the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`,
134
134
  or `somi:somi-dispatch` on Claude Code). Brief the agent via the
135
135
  Task tool with:
136
136
  - The full problem statement.
package/commands/pr.md CHANGED
@@ -15,8 +15,7 @@ Target work item: **$ARGUMENTS** (a slug under `.somi/plans/`; empty = the singl
15
15
  ## What to do
16
16
 
17
17
  1. **Brief the `pr` agent** ([`agents/pr.md`](../agents/pr.md)) — before this `Task`, call
18
- `somi_resolve` for `pr` (with `project_dir`), pass its model, and put `dispatched at cost:
19
- <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`, or
18
+ `somi_resolve` for `pr` (with `project_dir`), pass its model, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`, or
20
19
  `somi:somi-dispatch` on Claude Code) — with the resolved slug. It gathers
21
20
  the artifacts itself and returns a composed title + body — it never writes or publishes
22
21
  anything; this command owns every write, including `gh pr create`.
@@ -51,7 +51,7 @@ from [`templates/SOMI-README.md.tmpl`](../templates/SOMI-README.md.tmpl), same a
51
51
  ### 3. Invoke the `refactor-designer` agent
52
52
 
53
53
  Before this `Task`, call `somi_resolve` for `refactor-designer` (with `project_dir`), pass its
54
- model, and put `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill
54
+ model, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill
55
55
  (`somi_skill`, or `somi:somi-dispatch` on Claude Code). Brief
56
56
  [`agents/refactor-designer.md`](../agents/refactor-designer.md) via the Task tool with: the
57
57
  refactor target, the slug and paths, and a reminder to name the destination shape, map the seams
@@ -33,7 +33,7 @@ than a mode flag; see [`agents/refactorer.md`](../agents/refactorer.md)'s `> **C
33
33
  `test-strategist` first.
34
34
  3. **Brief the `refactorer` agent** ([`agents/refactorer.md`](../agents/refactorer.md)) — before
35
35
  this `Task`, call `somi_resolve` for `refactorer` (with `project_dir`), pass its model, and put
36
- `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill
36
+ the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill
37
37
  (`somi_skill`, or `somi:somi-dispatch` on Claude Code) — with the smell, the target
38
38
  files, and the destination shape.
39
39
  4. **The agent performs small, named refactor steps** with tests green between each.
@@ -44,8 +44,8 @@ Any hard failure here (open Blocker, red tests, unexecutable rollback) → the v
44
44
  Per-iteration reviews saw each diff in isolation. Task the [`reviewer`](../agents/reviewer.md)
45
45
  (declares `cost: medium, high`; the session ceiling picks the highest permitted member — typically
46
46
  `high`, the fresh-context depth this stage wants). Before this `Task`, call `somi_resolve` for
47
- `reviewer` (with `project_dir`), pass its model, and put `dispatched at cost: <tier>` in the
48
- briefing; full rules: the `somi-dispatch` skill (`somi_skill`, or `somi:somi-dispatch` on Claude
47
+ `reviewer` (with `project_dir`), pass its model, and put the cost line in the
48
+ briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`, or `somi:somi-dispatch` on Claude
49
49
  Code). Task it on the **cumulative release diff** (merge-base of
50
50
  the release scope vs. the default branch) with an explicit integration framing: interactions **between** the work
51
51
  items, contract mismatches across independently-reviewed changes, migration ordering across
@@ -74,7 +74,7 @@ the panel's value (it shows the surface was considered, not ignored).
74
74
 
75
75
  Issue the seated lenses as **multiple `Task` calls in a single turn** so they run concurrently —
76
76
  call `somi_resolve` for each lens back-to-back immediately before the batch (each call's own
77
- `project_dir`, model, and `dispatched at cost: <tier>` in that lens's own briefing — this is the
77
+ `project_dir`, model, and cost line (`dispatched at cost: <tier>` only when `enforced`, else `requested cost: <tier> (not enforced: no mapped model)`) in that lens's own briefing — this is the
78
78
  concurrent-batch case the `somi-dispatch` skill's §5 names explicitly). Give each the *same* scoped
79
79
  diff and work-item context, and each its own briefing:
80
80
 
@@ -64,7 +64,7 @@ errors that are cheaper to fix here than after code is written.
64
64
  ### 3. Brief the `reviewer` agent
65
65
 
66
66
  Before this `Task`, call `somi_resolve` for `reviewer` (with `project_dir`), pass its model, and put
67
- `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`,
67
+ the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`,
68
68
  or `somi:somi-dispatch` on Claude Code). Via the Task tool, pass:
69
69
 
70
70
  - The target (diff, file, or plan-artifact set).
@@ -23,7 +23,7 @@ Use the same resolution logic as [`/review`](./review.md):
23
23
  ### 2. Brief the `security-reviewer` agent
24
24
 
25
25
  Before this `Task`, call `somi_resolve` for `security-reviewer` (with `project_dir`), pass its
26
- model, and put `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill
26
+ model, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill
27
27
  (`somi_skill`, or `somi:somi-dispatch` on Claude Code). Via the Task tool, pass:
28
28
 
29
29
  - The diff and the relevant repo context.
@@ -30,7 +30,7 @@ Target: **$ARGUMENTS** (empty = scoped to the single in-progress work item if ex
30
30
  ### 2. Brief the `test-strategist` agent
31
31
 
32
32
  Before this `Task`, call `somi_resolve` for `test-strategist` (with `project_dir`), pass its model,
33
- and put `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill
33
+ and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill
34
34
  (`somi_skill`, or `somi:somi-dispatch` on Claude Code). Via the Task tool, pass:
35
35
 
36
36
  - The work-item or code paths.
@@ -32,7 +32,7 @@ path: apply, test, done — no ceremony.
32
32
 
33
33
  Task the [`discovery-analyst`](../agents/discovery-analyst.md) (`cost: high`) — before this `Task`,
34
34
  call `somi_resolve` for `discovery-analyst` (with `project_dir`), pass its model, and put
35
- `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`,
35
+ the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`,
36
36
  or `somi:somi-dispatch` on Claude Code) — scoped to the upgrade —
37
37
  **research integrity rules apply** (cite every claim; "no evidence found" is a valid result;
38
38
  never fabricate a changelog entry):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skathio/somi",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "scripts": {
5
5
  "test": "bash scripts/validate.sh",
6
6
  "eval:behavioral": "node tests/evals/run.mjs",
@@ -210,6 +210,14 @@ export function resolveDispatch({ agent, host, ceiling, projectRoot, installRoot
210
210
  return err(EXIT_MALFORMED, e.message);
211
211
  }
212
212
 
213
+ // `enforced` is true only when a concrete model id came out of the merged mapping (shipped table
214
+ // or the project's cost.mapping). A null model means nothing pins the tier on this host: the
215
+ // agent runs on whatever the host picks, so a caller must not report the tier as "dispatched".
216
+ const enforced = model !== null;
217
+ const modelFields = enforced
218
+ ? { enforced }
219
+ : { enforced, reason: `no model mapping for host ${HOST} (set cost.mapping.${HOST} with low, medium and high in .somi/config.json)` };
220
+
213
221
  return {
214
222
  ok: true,
215
223
  result: {
@@ -217,6 +225,7 @@ export function resolveDispatch({ agent, host, ceiling, projectRoot, installRoot
217
225
  supported: decision.supported,
218
226
  tier: decision.selected,
219
227
  model,
228
+ ...modelFields,
220
229
  ceiling: ceilingResult.ceiling,
221
230
  ceiling_source: ceilingResult.source,
222
231
  ceiling_origin: ceilingResult.ceiling_origin,
@@ -78,13 +78,17 @@ The tool's JSON comes back in its text content; the CLI fallback prints the iden
78
78
  stdout:
79
79
 
80
80
  ```json
81
- {"agent": "coder", "supported": ["low", "medium"], "tier": "medium", "model": "<mapped model>", "ceiling": "high", "ceiling_source": "default", "ceiling_origin": "default"}
81
+ {"agent": "coder", "supported": ["low", "medium"], "tier": "medium", "model": "<mapped model>", "enforced": true, "ceiling": "high", "ceiling_source": "default", "ceiling_origin": "default"}
82
82
  ```
83
83
 
84
84
  - `tier` — the cost tier the resolver selected for this agent, right now.
85
85
  - `model` — pass this to `Task` when it is non-null. When it is `null` (no mapping for this
86
86
  host/tier), see "No mapped model" below — never omit a model silently *and* never invent one
87
87
  without saying so.
88
+ - `enforced` — `true` only when `model` is a concrete id from a mapping (the shipped table or the
89
+ project's `cost.mapping`). `false` means nothing pins this tier on this host: the agent runs on
90
+ whatever model the host gives it. Then `reason` says why (e.g. `no model mapping for host
91
+ copilot`). The tier is still the one *requested*; it is never a claim about what ran.
88
92
  - `ceiling` / `ceiling_source` / `ceiling_origin` — see the announcement rule immediately below.
89
93
 
90
94
  **Announce a `low` ceiling once per session, before the first agent it applies to starts** — not
@@ -118,7 +122,20 @@ an agent, and say plainly that the raise **persists**: it is saved to
118
122
  `.somi/somi-state/ceiling.json` and stays in force for every later resolve this session — and every
119
123
  later session — until something moves it again.
120
124
 
121
- **No mapped model.** When `model` comes back `null`, pick only from model identifiers **actually
125
+ **No mapped model — which rule wins.** `enforced: false` (a `null` model) is settled in this order,
126
+ first match wins, and the briefing (§5) reports what actually happened, never what was hoped for:
127
+
128
+ 1. **A `cost.mapping` entry in `.somi/config.json`** — the resolver already applied it, so `model`
129
+ is non-null and `enforced` is `true`. Pass it. A configured mapping counts as the user naming
130
+ the model, so a host rule such as "do not set `model` unless the user names one" does **not**
131
+ block it.
132
+ 2. **The host's own guidance** — if it says not to set a model unless the user names one, pass none.
133
+ Nothing pins the agent's model: state `requested cost: <tier> (not enforced: no mapped model)`.
134
+ 3. **Your own pick** (the paragraph below) — only when neither of the above applies. Passing a model
135
+ you picked yourself still leaves `enforced: false`: say it is your choice, and use the
136
+ `requested cost:` line.
137
+
138
+ Pick only from model identifiers **actually
122
139
  visible to you this turn** — e.g. the subagent tool's own `model` parameter, when it lists
123
140
  candidates — to match the resolved `tier`: the lightest visible model for `low`, the strongest for
124
141
  `high`. Say plainly that this is your own choice, not a value the mapping supplied, and pass it to
@@ -128,9 +145,18 @@ you this turn, pass no model at all and say so**: the agent then runs on its own
128
145
  `model:` or the session's own model, and `cost.mapping` is how a project binds tiers to specific
129
146
  models on this host — never invent an identifier you cannot actually see. **The host's own
130
147
  instructions win over this pick:** if they say not to set a model unless the user names one, pass
131
- none, and say the agent runs on the host's model rather than at the resolved tier, and that
148
+ none, and say no model was pinned for the resolved tier, and that
132
149
  `cost.mapping` is how to bind one. `null` is expected on Copilot, which has no shipped mapping
133
- because its model ids vary by plan and editor. If the host then rejects
150
+ because its model ids vary by plan and editor — and a `ceiling` of `high` is only an upper bound,
151
+ never a request for a high model.
152
+
153
+ **Unenforced notice.** When `enforced` is `false` and the resolved `tier` is `high`, print ONE
154
+ user-visible line per agent type per session (once in this conversation's visible context, as with
155
+ the `low` announcement), before that agent's `Task` call: `<agent> is high-tier but no model is
156
+ pinned on <host>, so its model was not chosen by SoMi. To pin models, set cost.mapping.<host> with
157
+ low, medium and high in .somi/config.json (see docs/USAGE.md, "Pinning models per tier on
158
+ Copilot").` Name all three tiers: a host named in `cost.mapping` replaces its whole tier map, so a
159
+ high-only block fails the other tiers with exit `67`. Lower tiers get the briefing line only. If the host then rejects
134
160
  a model you *did* pick yourself, retry the same dispatch once without it and say you're doing so
135
161
  (§5 below) — never silently pass nothing while claiming a choice was made, and never retry more
136
162
  than once.
@@ -166,7 +192,9 @@ ceiling yourself, in the same order the resolver itself would check —
166
192
  `.somi/somi-state/ceiling.json` if it exists, else `.somi/config.json`'s `cost.ceiling` if set, else
167
193
  `high` (the shipped default) — then read this agent's `cost:` frontmatter yourself and pick the
168
194
  highest declared tier at or below that ceiling — the same selection the resolver would have made —
169
- mirroring `/code-loop`'s own no-shell fallback honesty.
195
+ mirroring `/code-loop`'s own no-shell fallback honesty. Nothing was resolved against a mapping
196
+ here, so nothing is enforced: the briefing's cost line is `requested cost: <tier> (not enforced: no
197
+ mapped model)`, never `dispatched at cost:`.
170
198
 
171
199
  ## 5. Start the agent
172
200
 
@@ -176,12 +204,16 @@ once for a whole command. The one exception: when your own procedure calls for *
176
204
  `Task`s issued together in one turn** so they run concurrently (`/review-panel` seating its lenses
177
205
  is the shipped example), resolve each one back-to-back, immediately before issuing that batch —
178
206
  still not once for the whole command, and each still gets its own `project_dir`, model, and
179
- `dispatched at cost: <tier>` line in that agent's own briefing.
180
-
181
- 1. **State `dispatched at cost: <tier>` in the agent's briefing**, using §1's resolved `tier`
182
- verbatim — this is the exact phrase `coder`, `planner`, and `refactorer` look for before
183
- trusting they were dispatched at `low`; without it, their own disclosure instruction can never
184
- fire.
207
+ cost briefing line in that agent's own briefing.
208
+
209
+ 1. **State the cost line in the agent's briefing**, using §1's resolved `tier` verbatim. When
210
+ `enforced` is `true`: `dispatched at cost: <tier>`. When it is `false`:
211
+ `requested cost: <tier> (not enforced: no mapped model)` — **`dispatched at cost:` is
212
+ reserved for enforced dispatches**, so a briefing never claims a tier no model was pinned to.
213
+ `coder`, `planner`, and `refactorer` take their "Running at `low`" trim from **either** line
214
+ (`dispatched at cost: low` or `requested cost: low`) — the trim is about the procedure, not the
215
+ model, so it follows the requested tier; without a cost line, their disclosure instruction can
216
+ never fire.
185
217
  2. **Pass §2's `model`** — the mapped value, or your own no-mapped-model pick when it applies.
186
218
  3. **Hand it the scope your own procedure defines** (the iteration, the slug, the target file —
187
219
  whatever your own instruction says to pass) — never a paraphrase of the whole command standing
@@ -217,8 +249,10 @@ dispatched agent's or command's own text says they do.
217
249
  calls for your own pick for that tier when a model identifier is actually visible to you this
218
250
  turn, disclosed as a choice — never an invented value passed off as the mapping's own answer, and
219
251
  never a silent omission when one genuinely was visible.
220
- - **Dispatching without the `dispatched at cost: <tier>` briefing line.** Without it, the agent's
221
- own "Running at `low`" disclosure can never fire, even when it should.
252
+ - **Dispatching without a cost briefing line.** Without `dispatched at cost: <tier>` or `requested
253
+ cost: <tier>`, the agent's own "Running at `low`" disclosure can never fire, even when it should.
254
+ - **Writing `dispatched at cost: <tier>` for an unenforced dispatch** (`enforced: false`), or staying
255
+ silent about a high-tier agent whose model nothing pinned. Use `requested cost: <tier> (not enforced: no mapped model)` and print the unenforced notice (§2).
222
256
 
223
257
  ## Consumers
224
258
 
@@ -76,7 +76,7 @@ const refCases = [
76
76
  ["full rules: the `somi-dispatch` skill (`somi_skill`, or `somi:somi-dispatch` on Claude Code) only, nothing else", false],
77
77
  // The real shape every rewritten command reference line now uses -- true because it names
78
78
  // `somi_resolve` literally, not because it mentions the skill by name.
79
- ["Before this `Task`, call `somi_resolve` for `coder` (with `project_dir`), pass its model, and put `dispatched at cost: <tier>` in the briefing; full rules: the `somi-dispatch` skill (`somi_skill`, or `somi:somi-dispatch` on Claude Code).", true],
79
+ ["Before this `Task`, call `somi_resolve` for `coder` (with `project_dir`), pass its model, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`, or `somi:somi-dispatch` on Claude Code).", true],
80
80
  // The older full-path markdown-link shape still satisfies it too.
81
81
  ["started per [`skills/somi-dispatch`](../skills/somi-dispatch/SKILL.md)", true],
82
82
  ["no dispatch reference here at all", false],
@@ -89,6 +89,23 @@ async function run() {
89
89
  check('the resolved project dir is where ceiling state actually landed', existsSync(path.join(proj, '.somi', 'somi-state', 'ceiling.json')), true);
90
90
  });
91
91
 
92
+ // --- #32: enforced/reason are exposed, and a config mapping makes copilot enforced ----------
93
+ await withClient({}, async (client) => {
94
+ await client.initialize();
95
+ const bare = JSON.parse(toolText(await toolCall(client, 'somi_resolve', { agent: 'designer', host: 'copilot', project_dir: fresh() })));
96
+ check('copilot, no mapping: model null, enforced false, reason names host',
97
+ [bare.model, bare.enforced, /no model mapping for host copilot.*low, medium and high/.test(bare.reason ?? '')], [null, false, true]);
98
+ const mapped = fresh();
99
+ mkdirSync(path.join(mapped, '.somi'), { recursive: true });
100
+ writeFileSync(path.join(mapped, '.somi', 'config.json'),
101
+ JSON.stringify({ cost: { mapping: { copilot: { low: 'gpt-5-mini', medium: 'gpt-5', high: 'gpt-5-pro' } } } }));
102
+ const m = JSON.parse(toolText(await toolCall(client, 'somi_resolve', { agent: 'designer', host: 'copilot', project_dir: mapped })));
103
+ check('copilot with config mapping: model set, enforced true, no reason',
104
+ [m.model, m.enforced, 'reason' in m], ['gpt-5-pro', true, false]);
105
+ const cc = JSON.parse(toolText(await toolCall(client, 'somi_resolve', { agent: 'designer', host: 'claude-code', project_dir: fresh() })));
106
+ check('claude-code default: model set, enforced true', [typeof cc.model, cc.enforced], ['string', true]);
107
+ });
108
+
92
109
  // --- the four failure codes surface as isError with the matching code --------------------
93
110
  await withClient({}, async (client) => {
94
111
  await client.initialize();
@@ -136,6 +136,53 @@ check "copilot mapped via project config: model is the mapped medium entry" "$(f
136
136
  out="$(run "$(fresh)" resolve --agent coder --host copilot)"
137
137
  check "copilot with no project mapping: model is null" "$(field "$out" model)" "null"
138
138
 
139
+ # #32: `enforced` is true only when a concrete model id was resolved; otherwise false with a reason.
140
+ out="$(run "$(fresh)" resolve --agent designer --host copilot)"
141
+ check "copilot, no mapping, high agent: model is null" "$(field "$out" model)" "null"
142
+ check "copilot, no mapping: enforced is false" "$(field "$out" enforced)" "false"
143
+ case "$(field "$out" reason)" in
144
+ *"low, medium and high"*) ok "copilot, no mapping: reason tells the user to map all three tiers" ;;
145
+ *) bad "copilot, no mapping: reason tells the user to map all three tiers (got '$(field "$out" reason)')" ;;
146
+ esac
147
+ case "$(field "$out" reason)" in
148
+ *"no model mapping for host copilot"*) ok "copilot, no mapping: reason names the host" ;;
149
+ *) bad "copilot, no mapping: reason names the host (got '$(field "$out" reason)')" ;;
150
+ esac
151
+ out="$(run "$R_MAP" resolve --agent designer --host copilot)"
152
+ check "copilot with a config mapping: model is the mapped high entry" "$(field "$out" model)" "gpt-5-pro"
153
+ check "copilot with a config mapping: enforced is true" "$(field "$out" enforced)" "true"
154
+ check "copilot with a config mapping: no reason key" "$(field "$out" reason)" "undefined"
155
+ out="$(run "$(fresh)" resolve --agent designer --host claude-code)"
156
+ check "claude-code default: enforced is true" "$(field "$out" enforced)" "true"
157
+
158
+ # #32: the dispatch skill keeps the honesty rule -- a text-level guard so it cannot be edited away.
159
+ SKILL="$ROOT_REPO/skills/somi-dispatch/SKILL.md"
160
+ skill_flat="$(tr '\n' ' ' < "$SKILL" | tr -s ' ')" # phrases may be line-wrapped in the source
161
+ if printf '%s' "$skill_flat" | grep -qF 'requested cost: <tier> (not enforced: no mapped model)' \
162
+ && printf '%s' "$skill_flat" | grep -qF 'reserved for enforced dispatches' \
163
+ && printf '%s' "$skill_flat" | grep -qF 'which rule wins' \
164
+ && printf '%s' "$skill_flat" | grep -qF 'ONE user-visible line per agent type per session'; then
165
+ ok "dispatch skill carries the requested-cost line, the rule order, and the unenforced notice"
166
+ else
167
+ bad "dispatch skill is missing the requested-cost line, the rule order, or the unenforced notice (#32)"
168
+ fi
169
+ # Newline-insensitive: a phrase wrapped across two source lines must still be seen. Any file naming
170
+ # the enforced line must also name the unenforced one; the three trimming agents must honour both.
171
+ unguarded=""
172
+ for c in "$ROOT_REPO"/commands/*.md "$ROOT_REPO"/agents/*.md; do
173
+ flat="$(tr '\n' ' ' < "$c" | tr -s ' ')"
174
+ case "$flat" in *'dispatched at cost:'*) case "$flat" in *'requested cost:'*) ;; *) unguarded="$unguarded $(basename "$c")" ;; esac ;; esac
175
+ done
176
+ check "every command/agent naming 'dispatched at cost:' also names the unenforced 'requested cost' line" "$unguarded" ""
177
+ trim_missing=""
178
+ for a in coder planner refactorer; do
179
+ flat="$(tr '\n' ' ' < "$ROOT_REPO/agents/$a.md" | tr -s ' ')"
180
+ case "$flat" in *'dispatched at cost: low` or `requested cost: low'*) ;; *) trim_missing="$trim_missing $a" ;; esac
181
+ done
182
+ check "coder/planner/refactorer trim on 'requested cost: low' as well as 'dispatched at cost: low'" "$trim_missing" ""
183
+ check "the unenforced briefing line reads 'no mapped model' everywhere" \
184
+ "$(grep -rlE 'running on the host model' "$ROOT_REPO/commands" "$ROOT_REPO/agents" "$ROOT_REPO/skills" "$ROOT_REPO/docs" | tr '\n' ' ')" ""
185
+
139
186
  # A project mapping can override a single claude-code tier; designer (cost: high, no cheaper mode)
140
187
  # always selects high, isolating the override to exactly the tier it names.
141
188
  R_OVERRIDE="$(fresh)"; mkdir -p "$R_OVERRIDE/.somi"
@@ -328,11 +375,11 @@ case "$envbad_msg" in
328
375
  *) bad "the bad SOMI_COST_CEILING error is unclear (got: $envbad_msg)" ;;
329
376
  esac
330
377
 
331
- # --- output shape: exactly the seven documented fields, and a real JSON array for `supported` -----
378
+ # --- output shape: exactly the documented fields (`enforced` added by #32; `reason` only when unenforced), and a real JSON array for `supported` -----
332
379
  out="$(run "$(fresh)" resolve --agent coder --ceiling medium)"
333
- check "JSON output carries exactly agent/ceiling/ceiling_origin/ceiling_source/model/supported/tier" \
380
+ check "JSON output carries exactly agent/ceiling/ceiling_origin/ceiling_source/enforced/model/supported/tier" \
334
381
  "$(node -e 'process.stdout.write(Object.keys(JSON.parse(process.argv[1])).sort().join("|"))' "$out")" \
335
- "agent|ceiling|ceiling_origin|ceiling_source|model|supported|tier"
382
+ "agent|ceiling|ceiling_origin|ceiling_source|enforced|model|supported|tier"
336
383
  check "coder's supported set is exactly [low, medium], echoing its declared frontmatter" \
337
384
  "$(node -e 'process.stdout.write(JSON.parse(process.argv[1]).supported.join(","))' "$out")" \
338
385
  "low,medium"