@skathio/somi 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.copilot-extension/extension.json +1 -1
- package/.copilot-extension/marketplace.json +1 -1
- package/README.md +11 -5
- package/VERSION +1 -1
- package/agents/somi-coder.md +4 -228
- package/agents/somi-designer.md +4 -160
- package/agents/somi-discovery-analyst.md +4 -276
- package/agents/somi-flow.md +47 -0
- package/agents/somi-general.md +36 -0
- package/agents/somi-planner.md +4 -341
- package/agents/somi-reviewer.md +4 -199
- package/agents/somi.md +81 -253
- package/commands/adopt.md +6 -84
- package/commands/architecture-review.md +11 -86
- package/commands/atlas.md +10 -25
- package/commands/code-loop.md +10 -221
- package/commands/code-parallel.md +10 -151
- package/commands/code.md +9 -157
- package/commands/debug.md +9 -131
- package/commands/design.md +9 -160
- package/commands/discover.md +9 -194
- package/commands/impact.md +9 -25
- package/commands/incident.md +9 -39
- package/commands/plan-loop.md +9 -181
- package/commands/plan.md +9 -244
- package/commands/pr.md +10 -25
- package/commands/refactor-design.md +11 -89
- package/commands/refactor.md +11 -50
- package/commands/release-readiness.md +11 -70
- package/commands/review-panel.md +10 -141
- package/commands/review.md +11 -181
- package/commands/security-review.md +11 -75
- package/commands/ship-loop.md +9 -260
- package/commands/ship.md +9 -115
- package/commands/somi-config.md +12 -124
- package/commands/test-strategy.md +11 -75
- package/commands/upgrade.md +9 -72
- package/hooks/hooks.json +1 -1
- package/hooks/lib/common.mjs +15 -13
- package/hooks/pre-tool/block-dangerous-bash.mjs +1 -1
- package/hooks/pre-tool/block-secret-writes.mjs +5 -7
- package/hooks/pre-tool/guard-cost-lowering.mjs +26 -11
- package/hooks/pre-tool/guard-protected-paths.mjs +54 -34
- package/hooks/session-start/ensure-default-config.mjs +34 -42
- package/package.json +1 -1
- package/scripts/lib/config-files.mjs +145 -0
- package/scripts/lib/cost-ceiling.mjs +29 -22
- package/scripts/lib/cost-defaults.mjs +2 -0
- package/scripts/lib/escalation-facts.mjs +146 -0
- package/scripts/lib/escalation.mjs +129 -0
- package/scripts/lib/findings-ledger.mjs +241 -0
- package/scripts/lib/install-text.mjs +97 -0
- package/scripts/lib/loop-caps.mjs +140 -0
- package/scripts/lib/loop-diff.mjs +12 -70
- package/scripts/lib/loop-engine.mjs +226 -0
- package/scripts/lib/loop-escalate.mjs +49 -0
- package/scripts/lib/loop-exit.mjs +47 -0
- package/scripts/lib/loop-notes-compact.mjs +72 -0
- package/scripts/lib/loop-notes.mjs +278 -0
- package/scripts/lib/loop-review.mjs +355 -12
- package/scripts/lib/loop-state.mjs +44 -0
- package/scripts/lib/loop-step-close.mjs +75 -0
- package/scripts/lib/loop-step-kit.mjs +179 -0
- package/scripts/lib/loop-step-review.mjs +140 -0
- package/scripts/lib/loop-step-tool.mjs +89 -0
- package/scripts/lib/loop-step.mjs +301 -0
- package/scripts/lib/mcp-project-root.mjs +18 -7
- package/scripts/lib/path-facts.mjs +187 -0
- package/scripts/lib/path-safety.mjs +171 -0
- package/scripts/lib/run-card.mjs +73 -0
- package/scripts/size-budget-overrides.json +5 -13
- package/scripts/somi-card.mjs +39 -0
- package/scripts/somi-check.mjs +4 -3
- package/scripts/somi-config.mjs +113 -50
- package/scripts/somi-findings.mjs +56 -271
- package/scripts/somi-loop.mjs +77 -446
- package/scripts/somi-mcp.mjs +27 -96
- package/scripts/validate.sh +92 -54
- package/skills/flow-adopt/SKILL.md +92 -0
- package/skills/flow-architecture-review/SKILL.md +94 -0
- package/skills/flow-atlas/SKILL.md +34 -0
- package/skills/flow-code/SKILL.md +167 -0
- package/skills/flow-code-loop/SKILL.md +263 -0
- package/skills/flow-code-parallel/SKILL.md +160 -0
- package/skills/flow-debug/SKILL.md +141 -0
- package/skills/flow-design/SKILL.md +170 -0
- package/skills/flow-discover/SKILL.md +204 -0
- package/skills/flow-impact/SKILL.md +35 -0
- package/skills/flow-incident/SKILL.md +49 -0
- package/skills/flow-plan/SKILL.md +254 -0
- package/skills/flow-plan-loop/SKILL.md +254 -0
- package/skills/flow-pr/SKILL.md +34 -0
- package/skills/flow-refactor/SKILL.md +58 -0
- package/skills/flow-refactor-design/SKILL.md +97 -0
- package/skills/flow-release-readiness/SKILL.md +82 -0
- package/skills/flow-review/SKILL.md +193 -0
- package/skills/flow-review-panel/SKILL.md +154 -0
- package/skills/flow-security-review/SKILL.md +83 -0
- package/skills/flow-ship/SKILL.md +125 -0
- package/skills/flow-ship-loop/SKILL.md +274 -0
- package/skills/flow-somi-config/SKILL.md +142 -0
- package/skills/flow-status/SKILL.md +43 -0
- package/skills/flow-test-strategy/SKILL.md +83 -0
- package/skills/flow-upgrade/SKILL.md +82 -0
- package/skills/role-coder/SKILL.md +247 -0
- package/skills/role-designer/SKILL.md +172 -0
- package/skills/role-discovery-analyst/SKILL.md +288 -0
- package/skills/role-planner/SKILL.md +353 -0
- package/skills/role-reviewer/SKILL.md +218 -0
- package/skills/somi-checkpoint/SKILL.md +95 -0
- package/skills/somi-dispatch/SKILL.md +14 -14
- package/skills/somi-routing/SKILL.md +6 -2
- package/tests/hooks/cases/block-secret-writes.json +6 -1
- package/tests/hooks/cases/guard-protected-paths.json +44 -2
- package/tests/hooks/run.sh +21 -0
- package/tests/scripts/checkpoint-gate.sh +2 -2
- package/tests/scripts/cost-defaults.sh +2 -0
- package/tests/scripts/cost-hardcap.sh +26 -17
- package/tests/scripts/dispatch-line-gate.sh +4 -4
- package/tests/scripts/dispatch-reference-gate.sh +14 -14
- package/tests/scripts/ensure-default-config.sh +4 -4
- package/tests/scripts/escalation.sh +409 -0
- package/tests/scripts/eval-runner.sh +8 -7
- package/tests/scripts/fact-sheet.sh +296 -0
- package/tests/scripts/global-config.sh +167 -0
- package/tests/scripts/goldens/somi-loop.json +2 -2
- package/tests/scripts/lib/dispatch-reference-gate.mjs +14 -5
- package/tests/scripts/lib/escalation-facts-tests.mjs +140 -0
- package/tests/scripts/lib/escalation-tests.mjs +154 -0
- package/tests/scripts/lib/findings-ledger-tests.mjs +118 -0
- package/tests/scripts/lib/loop-engine-tests.mjs +287 -0
- package/tests/scripts/lib/loop-escalate-tests.mjs +356 -0
- package/tests/scripts/lib/loop-flow-gate.mjs +173 -0
- package/tests/scripts/lib/loop-notes-tests.mjs +371 -0
- package/tests/scripts/lib/loop-step-cli-tests.mjs +141 -0
- package/tests/scripts/lib/loop-step-close-tests.mjs +351 -0
- package/tests/scripts/lib/loop-step-lenient-tests.mjs +114 -0
- package/tests/scripts/lib/loop-step-state-tests.mjs +127 -0
- package/tests/scripts/lib/loop-step-tests.mjs +499 -0
- package/tests/scripts/lib/loop-step-unwritten-tests.mjs +55 -0
- package/tests/scripts/lib/path-facts-tests.mjs +198 -0
- package/tests/scripts/lib/path-safety-tests.mjs +201 -0
- package/tests/scripts/lib/run-suites.mjs +139 -0
- package/tests/scripts/lib/site-roadmap-gate.mjs +64 -0
- package/tests/scripts/lib/sizing-score-tests.mjs +210 -0
- package/tests/scripts/lib/sizing-set-tests.mjs +131 -0
- package/tests/scripts/lib/somi-mcp-loop-tests.mjs +226 -0
- package/tests/scripts/lib/somi-mcp-tests.mjs +21 -1
- package/tests/scripts/loop-engine.sh +22 -0
- package/tests/scripts/loop-flow-gate.sh +11 -0
- package/tests/scripts/review-panel-seats.sh +4 -4
- package/tests/scripts/run-card.sh +57 -0
- package/tests/scripts/run-suites.sh +74 -0
- package/tests/scripts/run.sh +11 -0
- package/tests/scripts/site-roadmap-gate.sh +76 -0
- package/tests/scripts/size-tier.sh +3 -3
- package/tests/scripts/somi-agent-dispatch-contract.sh +23 -3
- package/tests/scripts/somi-config.sh +9 -4
- package/tests/scripts/somi-mcp.sh +1 -0
- package/tests/scripts/suite-plan.json +20 -0
|
@@ -11,7 +11,7 @@ ROOT_REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
|
11
11
|
AGENT_MD="$ROOT_REPO/agents/somi.md"
|
|
12
12
|
SKILL_MD="$ROOT_REPO/skills/somi-dispatch/SKILL.md"
|
|
13
13
|
CLI="$ROOT_REPO/scripts/somi-dispatch.mjs"
|
|
14
|
-
COMMAND_MDS="$ROOT_REPO"/
|
|
14
|
+
COMMAND_MDS="$ROOT_REPO/agents/somi-flow.md $ROOT_REPO/agents/somi-general.md $ROOT_REPO/skills/somi-checkpoint/SKILL.md "$(ls "$ROOT_REPO"/skills/flow-*/SKILL.md)
|
|
15
15
|
|
|
16
16
|
pass=0; fail=0
|
|
17
17
|
ok() { pass=$((pass+1)); printf ' ok %s\n' "$1"; }
|
|
@@ -133,9 +133,9 @@ else
|
|
|
133
133
|
REAL_TOOLS="$(node -e 'console.log(Object.keys(JSON.parse(process.argv[1])).filter((t) => t !== "somi_agent").sort().join(" "))' "$SCHEMA_JSON")"
|
|
134
134
|
PROMPT_TOOLS="$(grep -ohE '`somi_[a-z_]+`' "$AGENT_MD" "$SKILL_MD" $COMMAND_MDS | tr -d '`' | sort -u | tr '\n' ' ' | sed 's/ *$//')"
|
|
135
135
|
if [ "$REAL_TOOLS" = "$PROMPT_TOOLS" ]; then
|
|
136
|
-
ok "agents/somi.md + skills/somi-dispatch/SKILL.md +
|
|
136
|
+
ok "agents/somi.md + skills/somi-dispatch/SKILL.md + the runner, general agent, checkpoint and flow skills together name exactly the server's real tools ($REAL_TOOLS)"
|
|
137
137
|
else
|
|
138
|
-
bad "tool-name mismatch -- server: [$REAL_TOOLS] vs agents/somi.md + skills/somi-dispatch/SKILL.md +
|
|
138
|
+
bad "tool-name mismatch -- server: [$REAL_TOOLS] vs agents/somi.md + skills/somi-dispatch/SKILL.md + the runner, general agent, checkpoint and flow skills: [$PROMPT_TOOLS]"
|
|
139
139
|
fi
|
|
140
140
|
if node -e 'process.exit(Object.keys(JSON.parse(process.argv[1])).includes("somi_agent") ? 0 : 1)' "$SCHEMA_JSON"; then
|
|
141
141
|
ok "somi_agent still exists as a reader, and the dispatch text above names it nowhere"
|
|
@@ -200,5 +200,25 @@ else
|
|
|
200
200
|
done
|
|
201
201
|
fi
|
|
202
202
|
|
|
203
|
+
# --- the dispatcher's known-command list is exactly commands/*.md, and each has a flow skill ------
|
|
204
|
+
# The dispatcher recognises explicit commands from its own inline list (it reads no install files),
|
|
205
|
+
# so a command added without the list would degrade to classification silently.
|
|
206
|
+
known_list() { # $1 = agents/somi.md path; prints the backticked names after "Known commands:"
|
|
207
|
+
awk '/Known commands:/{f=1} f{print} f&&/Never re-classify/{exit}' "$1" | grep -oE '`[a-z][a-z0-9-]*`' | tr -d '`' | sort -u
|
|
208
|
+
}
|
|
209
|
+
LISTED="$(known_list "$AGENT_MD")"
|
|
210
|
+
REAL="$(for f in "$ROOT_REPO"/commands/*.md; do basename "$f" .md; done | sort -u)"
|
|
211
|
+
if [ -n "$LISTED" ] && [ "$LISTED" = "$REAL" ]; then
|
|
212
|
+
ok "agents/somi.md's known-command list equals commands/*.md ($(echo "$REAL" | wc -l) commands)"
|
|
213
|
+
else
|
|
214
|
+
bad "agents/somi.md's known-command list differs from commands/*.md: $(diff <(echo "$LISTED") <(echo "$REAL") | tr '\n' ' ')"
|
|
215
|
+
fi
|
|
216
|
+
for n in $REAL status; do
|
|
217
|
+
[ -f "$ROOT_REPO/skills/flow-$n/SKILL.md" ] || bad "no skills/flow-$n/SKILL.md for the '$n' flow"
|
|
218
|
+
done
|
|
219
|
+
ok "every known flow has its skills/flow-<name>/SKILL.md"
|
|
220
|
+
cp "$AGENT_MD" "$TMP/somi.md"; sed -i 's/`upgrade`\./`upgrade`, `bogus`./' "$TMP/somi.md"
|
|
221
|
+
if [ "$(known_list "$TMP/somi.md")" != "$REAL" ]; then ok "red proof: an extra name in the list is caught"; else bad "red proof: an extra name in the list was not caught"; fi
|
|
222
|
+
|
|
203
223
|
echo "somi agent <-> somi-dispatch.mjs dispatch contract tests: $pass ok, $fail failed"
|
|
204
224
|
[ "$fail" -eq 0 ] || exit 1
|
|
@@ -41,7 +41,7 @@ check "... a no-op, file untouched, reported created:false" "$(cat "$P/.somi/con
|
|
|
41
41
|
# --- show -----------------------------------------------------------------------------------------
|
|
42
42
|
P="$(proj)"; cfg "$CLI" "$P" init > /dev/null
|
|
43
43
|
check "show: exit 0" "$(cfg "$CLI" "$P" show)" "0"
|
|
44
|
-
check "show on a fresh default config: ceiling medium from config" "$(jf 'o.ceiling')" '{"value":"medium","source":"config"}'
|
|
44
|
+
check "show on a fresh default config: ceiling medium from config" "$(jf 'o.ceiling')" '{"value":"medium","source":"config","from":"project"}'
|
|
45
45
|
check "show: every shipped agent is listed with default, tier, source" "$(jf 'o.agents.length === Object.keys(JSON.parse(require("fs").readFileSync("'"$EXPECT"'","utf8")).cost.agents).length && o.agents.every((a) => a.tier === a.default && a.source === "override")')" "true"
|
|
46
46
|
check "show: no warnings for a fresh default config" "$(jf 'o.warnings')" "[]"
|
|
47
47
|
check "show output is one ASCII line" "$(wc -l < "$TMP/out" | tr -d ' ')|$(ascii_only "$TMP/out")" "1|yes"
|
|
@@ -126,7 +126,7 @@ check "show carries the same warning" "$(cfg "$CLI" "$P" show)|$(jf 'o.warnings.
|
|
|
126
126
|
check "set security-reviewer back to high clears it" "$(cfg "$CLI" "$P" set cost.agents.somi-security-reviewer high)|$(jf 'o.warnings')" "0|[]"
|
|
127
127
|
check "set an agent not in the default table: accepted, unknown warning" "$(cfg "$CLI" "$P" set cost.agents.my-agent high)|$(jf 'o.warnings.length')" "0|1"
|
|
128
128
|
cfg "$CLI" "$P" show > /dev/null
|
|
129
|
-
check "show flags the extra name unknown:true with no default" "$(jf 'JSON.stringify(o.agents.find((a) => a.name === "my-agent"))')" '{"name":"my-agent","tier":"high","source":"override","default":null,"unknown":true}'
|
|
129
|
+
check "show flags the extra name unknown:true with no default" "$(jf 'JSON.stringify(o.agents.find((a) => a.name === "my-agent"))')" '{"name":"my-agent","tier":"high","source":"override","from":"project","default":null,"unknown":true}'
|
|
130
130
|
|
|
131
131
|
# --- 64: arguments ---------------------------------------------------------------------------------
|
|
132
132
|
P="$(proj)"; cfg "$CLI" "$P" init > /dev/null; cp "$P/.somi/config.json" "$TMP/before"
|
|
@@ -156,15 +156,20 @@ P="$(proj)"; mkdir "$P/.somi"; head -c 70000 /dev/zero | tr '\0' ' ' > "$P/.somi
|
|
|
156
156
|
check "an oversize config exits 67, untouched" "$(cfg "$CLI" "$P" set cost.ceiling low)|$(cmp -s "$P/.somi/config.json" "$TMP/big.before" && echo same)" "67|same"
|
|
157
157
|
check "error text does not echo file text" "$(P="$(proj)"; mkdir "$P/.somi"; printf '{"cost":{"cieling":"SECRET-VALUE"}}' > "$P/.somi/config.json"; cfg "$CLI" "$P" show > /dev/null; grep -c SECRET-VALUE "$TMP/err" | tr -d ' ')" "0"
|
|
158
158
|
|
|
159
|
-
# ---
|
|
159
|
+
# --- links: writes never follow one, reads (show, get) do -----------------------------------------
|
|
160
160
|
echo KEEP > "$TMP/victim.txt"; OUTSIDE="$(mktemp -d -p "$TMP")"
|
|
161
161
|
P="$(proj)"; ln -s "$OUTSIDE" "$P/.somi"
|
|
162
|
-
for op in "set cost.ceiling low" init
|
|
162
|
+
for op in "set cost.ceiling low" "unset cost.agents.somi-coder" init; do
|
|
163
163
|
# shellcheck disable=SC2086
|
|
164
164
|
check "a symlinked .somi: $op exits 67" "$(cfg "$CLI" "$P" $op)" "67"
|
|
165
165
|
done
|
|
166
166
|
check "... nothing was written outside" "$(ls -A "$OUTSIDE" | wc -l | tr -d ' ')" "0"
|
|
167
|
+
check "a symlinked .somi: show reads through it (a junction on Windows)" "$(cfg "$CLI" "$P" show)|$(jf 'o.exists')" "0|false"
|
|
168
|
+
SHARED="$(mktemp -d -p "$TMP")"; printf '{"cost":{"ceiling":"low"}}' > "$SHARED/config.json"; P="$(proj)"; ln -s "$SHARED" "$P/.somi"
|
|
169
|
+
check "... and reads the config behind it" "$(cfg "$CLI" "$P" show)|$(jf 'o.ceiling.value')" "0|low"
|
|
170
|
+
check "... get too" "$(cfg "$CLI" "$P" get cost.ceiling)|$(jf 'o.value')" "0|low"
|
|
167
171
|
P="$(proj)"; mkdir "$P/.somi"; printf '{"cost":{"ceiling":"high"}}' > "$TMP/real.json"; ln -s "$TMP/real.json" "$P/.somi/config.json"
|
|
172
|
+
check "a symlinked config.json: show reads through it" "$(cfg "$CLI" "$P" show)|$(jf 'o.ceiling.value')" "0|high"
|
|
168
173
|
check "a symlinked config.json: set exits 67" "$(cfg "$CLI" "$P" set cost.ceiling low)" "67"
|
|
169
174
|
check "... the link target is untouched" "$(cat "$TMP/real.json")" '{"cost":{"ceiling":"high"}}'
|
|
170
175
|
check "init over a symlinked config.json is a no-op (it exists)" "$(cfg "$CLI" "$P" init)|$(jf 'o.created')" "0|false"
|
|
@@ -12,3 +12,4 @@ ROOT_REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
|
12
12
|
node "$ROOT_REPO/tests/scripts/lib/somi-mcp-tests.mjs"
|
|
13
13
|
node "$ROOT_REPO/tests/scripts/lib/somi-mcp-tier-tests.mjs"
|
|
14
14
|
node "$ROOT_REPO/tests/scripts/lib/agent-registry-tests.mjs"
|
|
15
|
+
node "$ROOT_REPO/tests/scripts/lib/somi-mcp-loop-tests.mjs"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comment": "How validate.sh's test scripts are scheduled (tests/scripts/lib/run-suites.mjs --plan). 'alone' scripts run by themselves, with nothing else on the machine: their checks carry wall-clock limits that CPU contention breaks. 'shards' split the slow scripts across CI runners; the 'light' shard is every queued script no shard names, so the shards together always cover every script once. A name here that validate.sh does not queue fails the run.",
|
|
3
|
+
"alone": [
|
|
4
|
+
"tests/scripts/eval-gate-micro-tasks.sh"
|
|
5
|
+
],
|
|
6
|
+
"shards": {
|
|
7
|
+
"heavy-1": [
|
|
8
|
+
"tests/scripts/eval-gate-micro-tasks.sh"
|
|
9
|
+
],
|
|
10
|
+
"heavy-2": [
|
|
11
|
+
"tests/scripts/eval-gate-ab-driver.sh",
|
|
12
|
+
"tests/scripts/eval-gate-ab-tasks.sh"
|
|
13
|
+
],
|
|
14
|
+
"heavy-3": [
|
|
15
|
+
"tests/scripts/eval-gate-review-recall.sh",
|
|
16
|
+
"tests/scripts/eval-gate-bench-compare.sh",
|
|
17
|
+
"tests/scripts/eval-gate-micro-lint.sh"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|