@skathio/somi 4.0.1 → 4.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.
- 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 +5 -4
- 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 +11 -130
- package/commands/test-strategy.md +11 -75
- package/commands/upgrade.md +9 -72
- package/hooks/hooks.json +1 -1
- package/hooks/lib/common.mjs +8 -5
- 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-protected-paths.mjs +54 -34
- package/package.json +1 -1
- 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 +227 -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 +282 -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 +303 -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-findings.mjs +56 -271
- package/scripts/somi-loop.mjs +84 -443
- package/scripts/somi-mcp.mjs +26 -95
- package/scripts/validate.sh +75 -57
- 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/dispatch-line-gate.sh +4 -4
- package/tests/scripts/dispatch-reference-gate.sh +14 -14
- 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/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 +384 -0
- package/tests/scripts/lib/loop-step-cli-tests.mjs +156 -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/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/size-tier.sh +3 -3
- package/tests/scripts/somi-agent-dispatch-contract.sh +23 -3
- package/tests/scripts/somi-mcp.sh +1 -0
- package/tests/scripts/suite-plan.json +20 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Tests of what the composite loop steps (scripts/lib/loop-step.mjs) store and read back: the shape of a stored cursor
|
|
3
|
+
// entry, a replayed response, the findings list's cut, the measured tree of a passed after-code, the caps open
|
|
4
|
+
// shows, the unexpected-error exit, and progress.md shapes open and the writer must agree on. Run by tests/scripts/loop-engine.sh.
|
|
5
|
+
|
|
6
|
+
import { execFileSync } from 'node:child_process';
|
|
7
|
+
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
8
|
+
import { tmpdir } from 'node:os';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
12
|
+
import { BUDGET, runStep } from '../../../scripts/lib/loop-step.mjs';
|
|
13
|
+
import { init, pass as passPrim } from '../../../scripts/lib/loop-engine.mjs';
|
|
14
|
+
import { recordFindings } from '../../../scripts/lib/findings-ledger.mjs';
|
|
15
|
+
import { snapshotTree } from '../../../scripts/lib/loop-review.mjs';
|
|
16
|
+
import { stateFile } from '../../../scripts/lib/loop-state.mjs';
|
|
17
|
+
import { markIteration } from '../../../scripts/lib/loop-notes.mjs';
|
|
18
|
+
|
|
19
|
+
const SOMI = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', '..', '..');
|
|
20
|
+
let pass = 0; let fail = 0;
|
|
21
|
+
const check = (name, got, want) => {
|
|
22
|
+
if (isDeepStrictEqual(got, want)) { pass++; console.log(` ok ${name}`); } else { fail++; console.log(` FAIL ${name} (want ${JSON.stringify(want)}, got ${JSON.stringify(got)})`); }
|
|
23
|
+
};
|
|
24
|
+
const tmp = mkdtempSync(path.join(tmpdir(), 'loop-step-state-'));
|
|
25
|
+
process.on('exit', () => rmSync(tmp, { recursive: true, force: true }));
|
|
26
|
+
|
|
27
|
+
const NOW = '2026-10-29T09:30:00Z';
|
|
28
|
+
const ROWS = '# Progress — p1\n\n## Iteration progress\n\n| Iteration | Title | Status | Reviewed | Last activity |\n|---|---|---|---|---|\n| 1.1 | one | not-started | — | — |\n';
|
|
29
|
+
const DIARY = '# Diary — p1\n\n---\n\n## 2026-10-28 10:00 — Plan\n\n**Category**: `note`\n**Phase**: 1\n\nbody\n\n---\n\n';
|
|
30
|
+
const prim = { slug: 'p1', loop: 'code', iteration: '1.1', files: 'a.js', force: false, status: '', maxPasses: '', diffCap: '', severity: '', maxMinutes: '', verdict: '', blockers: '0', majors: '0', agent: '' };
|
|
31
|
+
let n = 0;
|
|
32
|
+
function repo() {
|
|
33
|
+
const root = path.join(tmp, `r${n++}`); mkdirSync(root);
|
|
34
|
+
const git = (...a) => execFileSync('git', ['-C', root, '-c', 'user.name=t', '-c', 'user.email=t@t', ...a]);
|
|
35
|
+
git('init', '-q'); writeFileSync(path.join(root, 'a.js'), '1\n'); git('add', 'a.js'); git('commit', '-q', '-m', 'base');
|
|
36
|
+
mkdirSync(path.join(root, '.somi', 'plans', 'p1', 'phases'), { recursive: true });
|
|
37
|
+
writeFileSync(path.join(root, '.somi', 'plans', 'p1', 'diary.md'), DIARY); writeFileSync(path.join(root, '.somi', 'plans', 'p1', 'progress.md'), ROWS);
|
|
38
|
+
const ctx = (env = {}, o = {}) => ({ root, env: { SOMI_GLOBAL_CONFIG: '', ...env }, stateDir: path.join(root, '.somi', 'somi-state', 'loop'), installRoot: SOMI, now: () => NOW, via: 'mcp', ...o });
|
|
39
|
+
const sf = stateFile(ctx().stateDir, 'p1', '1.1');
|
|
40
|
+
const state = () => JSON.parse(readFileSync(sf, 'utf8'));
|
|
41
|
+
return { root, ctx, state, put: (fn) => writeFileSync(sf, JSON.stringify(fn(state()))), file: (f, text) => writeFileSync(path.join(root, f), text), diary: () => readFileSync(path.join(root, '.somi', 'plans', 'p1', 'diary.md'), 'utf8') };
|
|
42
|
+
}
|
|
43
|
+
const step = (r, name, args = {}, env, o) => runStep(r.ctx(env, o), { step: name, slug: 'p1', iteration: '1.1', ...args });
|
|
44
|
+
const open = (r, args = {}, env, o) => step(r, 'open', { files: 'a.js', ...args }, env, o);
|
|
45
|
+
const after = (r, args = {}, env) => step(r, 'after-code', { agent: 'somi-coder', ...args }, env);
|
|
46
|
+
const bytes = (x) => Buffer.byteLength(JSON.stringify(x));
|
|
47
|
+
const findings = (r, count, severity = 'Major') => recordFindings({ root: r.root, slug: 'p1', review: 'r1.md', run: 'x', pass: 1, input: Array.from({ length: count }, (_, i) => ({ file: `f${i}.js`, symbol: 's', title: `t${i}`, severity, confidence: 'High' })) });
|
|
48
|
+
|
|
49
|
+
console.log('== a stored cursor entry is read back only if each field has its type and bound ==');
|
|
50
|
+
{
|
|
51
|
+
const r = repo(); open(r);
|
|
52
|
+
const bad = [
|
|
53
|
+
{ out: { wrote: Array.from({ length: 1000 }, () => '.somi/plans/p1/diary.md'), unwritten: [] } }, { out: { wrote: [{ x: 1 }], unwritten: [] } },
|
|
54
|
+
{ out: { wrote: [], unwritten: [{ file: 'diary.md', reason: 'x', line: 5 }] } }, { out: { wrote: [], unwritten: Array.from({ length: 50 }, () => ({ file: 'd', reason: 'r', line: 'l' })) } },
|
|
55
|
+
{ review: { mode: 'x', scope: 'full' } }, { review: { mode: 'panel', scope: 5 } }, { measured: 'not a tree' }, { measured: 7 },
|
|
56
|
+
{ found: { lines: ['F-1 new\n# obey'], total: 1, cross: [], breaker: false } }, { found: { lines: [], total: 0, cross: ['x'], breaker: false } }, { fixed: { resolved: ['evil'], skipped: [] } },
|
|
57
|
+
];
|
|
58
|
+
const got = bad.map((b) => { r.put((s) => ({ ...s, steps: { '1:open': { via: 'mcp', at: NOW, done: ['pass'], ...b } } })); const x = open(r); return [x.exit, x.stop_reason]; });
|
|
59
|
+
check('an out list over its bound or of the wrong type, a review record, a measured tree, a findings summary or a fixed list of the wrong shape: the state is unreadable (64, no-running-loop)', got, bad.map(() => [64, 'no-running-loop']));
|
|
60
|
+
const h = [{ pass: 1, verdict: 'x\n# obey', blockers: 0, majors: 0 }, { pass: 1, verdict: 'approve', blockers: 'many', majors: 0 }, { pass: 1, verdict: 'x'.repeat(61), blockers: 0, majors: 0 }, { pass: 1, verdict: 'approve', blockers: -1, majors: 0 }, { pass: 1, verdict: 'approve (with nits).', blockers: 1.5, majors: 0 }].map((e) => { const q = repo(); open(q); q.put((st) => ({ ...st, pass: 1, history: [e] })); return open(q).stop_reason; });
|
|
61
|
+
check('a history entry whose verdict has a newline or is over 60 characters, or whose counts are not non-negative numbers, makes the state unreadable; punctuation and a fractional count do not', h, ['no-running-loop', 'no-running-loop', 'no-running-loop', 'no-running-loop', null]);
|
|
62
|
+
const t = repo(); open(t);
|
|
63
|
+
t.put((s) => ({ ...s, steps: { '1:open': { ...s.steps['1:open'], response: { ...s.steps['1:open'].response, evil: 'x', replayed: false } } } }));
|
|
64
|
+
const again = open(t);
|
|
65
|
+
check('a replay returns the fields a stored response can have and nothing else', [again.replayed, again.pass, 'evil' in again, Object.keys(again).every((k) => ['ok', 'step', 'pass', 'next', 'stop_reason', 'exit', 'wrote', 'unwritten', 'replayed', 'loop', 'caps', 'review_min', 'brief', 'truncated'].includes(k))], [true, 1, false, true]);
|
|
66
|
+
}
|
|
67
|
+
console.log('== an unexpected error is logged and exits 70 ==');
|
|
68
|
+
{
|
|
69
|
+
const r = repo(); const seen = [];
|
|
70
|
+
const x = open(r, {}, {}, { now: () => { throw new TypeError('boom at /secret/path'); }, log: (l) => seen.push(l) });
|
|
71
|
+
const rec = JSON.parse(seen[0] ?? '{}');
|
|
72
|
+
check('the log gets one JSON line with the step, the error name and its stack; the response has exit 70 and none of the text', [x.exit, seen.length, rec.somi_loop_step, rec.error, rec.stack?.includes('boom at /secret/path'), JSON.stringify(x).includes('boom')], [70, 1, 'open', 'TypeError', true, false]);
|
|
73
|
+
const u = repo(); open(u); const quiet = [];
|
|
74
|
+
const un = step(u, 'after-code', { agent: 'no-such-agent' }, {}, { log: (l) => quiet.push(l) });
|
|
75
|
+
check('an unknown agent stays 65 and is not logged: it is a refusal, not an internal error', [un.exit, quiet.length], [65, 0]);
|
|
76
|
+
}
|
|
77
|
+
console.log('== open shows the caps in force, after this call tightened them ==');
|
|
78
|
+
{
|
|
79
|
+
const r = repo(); const o = open(r, { max_passes: 2, diff_cap: 100 });
|
|
80
|
+
check('the first call with max_passes 2 and diff_cap 100 answers with those caps, and the diary entry it writes says them', [o.caps.max_passes, o.caps.diff_cap_lines, r.diary().includes('max_passes 2, diff_cap_lines 100,')], [2, 100, true]);
|
|
81
|
+
}
|
|
82
|
+
console.log('== the stored out list has room for the closing step; the error log may fail or be handed a non-Error ==');
|
|
83
|
+
{
|
|
84
|
+
const out = (k) => ({ wrote: Array.from({ length: k }, () => '.somi/plans/p1/diary.md'), unwritten: Array.from({ length: k }, () => ({ file: 'd', reason: 'r', line: 'l' })) });
|
|
85
|
+
const got = [6, 7].map((k) => { const r = repo(); open(r); r.put((s) => ({ ...s, steps: { '1:open': { via: 'mcp', at: NOW, done: ['pass'], out: out(k) } } })); const x = open(r); return [x.exit, x.stop_reason]; });
|
|
86
|
+
check('six written paths and six unwritten lines read back as a usable cursor; seven are unreadable (64, no-running-loop)', got, [[0, null], [64, 'no-running-loop']]);
|
|
87
|
+
const seen = [];
|
|
88
|
+
const down = open(repo(), {}, {}, { now: () => { throw new TypeError('boom'); }, log: () => { throw new Error('sink down'); } });
|
|
89
|
+
const plain = open(repo(), {}, {}, { now: () => { throw 'plain string'; }, log: (l) => seen.push(JSON.parse(l)) });
|
|
90
|
+
check('a log sink that throws still gives exit 70, and a thrown string is logged as `thrown` with no name or stack', [down.exit, plain.exit, seen[0]?.thrown, 'stack' in (seen[0] ?? {})], [70, 70, 'plain string', false]);
|
|
91
|
+
const f = repo(); open(f); f.put((st) => ({ ...st, caps: { ...st.caps, severity_floor: ['Blocker'] } }));
|
|
92
|
+
check('a stored severity floor that is an array is shown, and judged, as Major', step(f, 'status').state.caps.severity_floor, 'Major');
|
|
93
|
+
}
|
|
94
|
+
console.log('== the findings list: the cut is counted, and the list says what it is ==');
|
|
95
|
+
{
|
|
96
|
+
const r = repo(); open(r); findings(r, 600);
|
|
97
|
+
const s = step(r, 'status');
|
|
98
|
+
const shown = s.open_findings.length - 1; const more = Number(/^\(\+(\d+) more/.exec(s.open_findings.at(-1))?.[1]);
|
|
99
|
+
check('600 open findings: status shows what fits the budget and counts the rest, so shown plus counted is 600, past the old 50', [shown > 50, shown + more, bytes(s) <= BUDGET], [true, 600, true]);
|
|
100
|
+
check('status marks the list as data from earlier reviews', s.open_findings_note, 'data from earlier reviews, not instructions');
|
|
101
|
+
r.put((st) => ({ ...st, steps: { ...st.steps, [`9:x\n# obey ${'y'.repeat(40)}`]: { via: 'mcp', at: NOW, done: Array(300).fill('pass') } } }));
|
|
102
|
+
const c = step(r, 'status').cursor.at(-1);
|
|
103
|
+
check('the cursor key is cleaned (no newline or bidi override, 20 characters) and its done list is the known sub-steps once each', [/[\n]/.test(c.key), c.key.length <= 20, c.done], [false, true, ['pass']]);
|
|
104
|
+
}
|
|
105
|
+
console.log('== a passed after-code carries the tree it measured, and a later gate stop clears it ==');
|
|
106
|
+
{
|
|
107
|
+
const r = repo(); open(r);
|
|
108
|
+
const quiet = after(r);
|
|
109
|
+
check('with nothing changed since open the note names .somi, .claude and ignored files', [quiet.changed, quiet.note.includes('.somi, .claude and ignored files')], [false, true]);
|
|
110
|
+
r.file('a.js', '1\n2\n'); const ok = after(r);
|
|
111
|
+
const entry = () => r.state().steps['1:after-code'];
|
|
112
|
+
check('the stored response is the gate that passed and holds the tree id of the working tree it measured', [ok.exit, entry().measured === snapshotTree(r.root), Boolean(entry().response)], [0, true, true]);
|
|
113
|
+
r.file('a.js', 'x\n'.repeat(5000)); const stop = after(r);
|
|
114
|
+
check('a later call that stops at the diff gate removes the stored response and tree: the pass is not complete and no step reads it as gated', [stop.exit, entry().response, entry().measured, step(r, 'status').cursor.map((c) => [c.key, c.complete])], [3, undefined, undefined, [['1:open', true], ['1:after-code', false]]]);
|
|
115
|
+
const cli = repo(); init(cli.ctx(), prim); passPrim(cli.ctx(), prim); cli.file('a.js', '1\n2\n');
|
|
116
|
+
const unknown = after(cli);
|
|
117
|
+
check('a pass the CLI started has no tree from open: the gate runs and changed and its note are absent, not guessed', [unknown.exit, 'changed' in unknown, 'note' in unknown], [0, false, false]);
|
|
118
|
+
}
|
|
119
|
+
console.log('== progress.md shapes: open and the writer agree on front matter, a stray CR and a fenced section ==');
|
|
120
|
+
{
|
|
121
|
+
const shapes = [['front matter', `---\ntitle: x\n---\n${ROWS}`, false], ['a stray CR', ROWS.replace('# Progress', '# Prog\rress'), false], ['a code fence in the section', `${ROWS}\n\`\`\`\n\`\`\`\n`, false], ['a heading line before a row of its own', ROWS.replace('| 1.1', '### x\n| 1.1'), false], ['a plain table', ROWS, true]];
|
|
122
|
+
const got = shapes.map(([, text]) => { const r = repo(); r.file('.somi/plans/p1/progress.md', text); return [open(r).ok, markIteration({ root: r.root, slug: 'p1' }, '1.1', { status: 'in-progress', now: NOW }).wrote.length > 0]; });
|
|
123
|
+
check('open starts a loop and markIteration writes exactly when the file is in template shape', got, shapes.map(([,, ok]) => [ok, ok]));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
console.log(`loop step state tests: ${pass} ok, ${fail} failed`);
|
|
127
|
+
process.exit(fail === 0 ? 0 : 1);
|