steroids-cli 0.4.49 → 0.4.51
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/dist/commands/llm.d.ts.map +1 -1
- package/dist/commands/llm.js +89 -17
- package/dist/commands/llm.js.map +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/database/schema.d.ts.map +1 -1
- package/dist/database/schema.js +1 -0
- package/dist/database/schema.js.map +1 -1
- package/migrations/008_add_section_skipped.sql +9 -0
- package/migrations/manifest.json +10 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../src/commands/llm.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../src/commands/llm.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAsOnD,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA4HlF"}
|
package/dist/commands/llm.js
CHANGED
|
@@ -18,17 +18,88 @@ const LLM_INSTRUCTIONS = `# STEROIDS LLM QUICK REFERENCE
|
|
|
18
18
|
Steroids=automated task orchestration system.
|
|
19
19
|
It manages tasks and invokes LLM agents (coders/reviewers) to execute them.
|
|
20
20
|
The system spawns separate LLM processes for coding and reviewing.
|
|
21
|
+
Deterministic daemon — never makes decisions, just follows the state machine.
|
|
21
22
|
|
|
22
|
-
## TASK
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
## TASK STATE MACHINE
|
|
24
|
+
|
|
25
|
+
### All 8 Statuses
|
|
26
|
+
|
|
27
|
+
| Marker | Status | Terminal? | Runner picks it? | Description |
|
|
28
|
+
|--------|-------------|-----------|-------------------|------------------------------------------------|
|
|
29
|
+
| [ ] | pending | No | YES → coder | Not started, waiting for coder |
|
|
30
|
+
| [-] | in_progress | No | YES → coder | Coder is actively working |
|
|
31
|
+
| [o] | review | No | YES → reviewer | Coder finished, waiting for reviewer |
|
|
32
|
+
| [x] | completed | YES | No | Reviewer approved, code pushed |
|
|
33
|
+
| [!] | disputed | YES | No | Coder/reviewer disagreement, code pushed |
|
|
34
|
+
| [F] | failed | YES | No | Exceeded 15 rejections, needs human |
|
|
35
|
+
| [S] | skipped | YES | No | Fully external — nothing to code |
|
|
36
|
+
| [s] | partial | YES | No | Some coded, rest needs external setup |
|
|
37
|
+
|
|
38
|
+
CRITICAL: skipped [S] and partial [s] are TERMINAL states. The runner will NEVER
|
|
39
|
+
pick them up for coding. Once a task is marked partial/skipped, it is DONE from the
|
|
40
|
+
runner's perspective. If coding is still needed, reset to pending manually.
|
|
41
|
+
|
|
42
|
+
### State Transitions
|
|
43
|
+
|
|
44
|
+
pending [ ] → in_progress [-] → review [o] → completed [x] (approved)
|
|
45
|
+
↓ rejected → back to in_progress [-]
|
|
46
|
+
↓ disputed → disputed [!] (code pushed, move on)
|
|
47
|
+
if 15 rejections → failed [F] (full stop)
|
|
48
|
+
Human can mark at any time → skipped [S] or partial [s] (terminal)
|
|
49
|
+
|
|
50
|
+
### Coordinator Intervention
|
|
51
|
+
At rejection thresholds [2, 5, 9], a coordinator LLM is invoked to analyze the
|
|
52
|
+
rejection pattern and provide guidance to both coder and reviewer. This breaks
|
|
53
|
+
coder/reviewer deadlocks without human intervention.
|
|
54
|
+
|
|
55
|
+
## TASK SELECTION ALGORITHM
|
|
56
|
+
|
|
57
|
+
Runner selects tasks in strict priority order:
|
|
58
|
+
|
|
59
|
+
Priority 1: review [o] — complete reviews before starting new work
|
|
60
|
+
Priority 2: in_progress [-] — resume incomplete work
|
|
61
|
+
Priority 3: pending [ ] — start new work
|
|
62
|
+
|
|
63
|
+
Within each priority, ordered by: section position (lower=first), then created_at (older=first).
|
|
64
|
+
|
|
65
|
+
### Filters Applied Before Selection
|
|
66
|
+
1. Terminal statuses excluded: completed, disputed, failed, skipped, partial
|
|
67
|
+
2. Tasks in skipped sections excluded (unless runner focused on specific section)
|
|
68
|
+
3. Tasks in sections with UNMET DEPENDENCIES excluded (see below)
|
|
69
|
+
4. Tasks locked by another runner excluded
|
|
70
|
+
|
|
71
|
+
If no selectable task exists → runner goes idle.
|
|
72
|
+
|
|
73
|
+
## SECTION DEPENDENCIES
|
|
74
|
+
|
|
75
|
+
Sections can declare dependencies on other sections:
|
|
76
|
+
steroids sections depends-on <A> <B> → Section A depends on Section B
|
|
77
|
+
|
|
78
|
+
Effect: ALL tasks in section B must be completed before ANY task in section A
|
|
79
|
+
can be picked by the runner. "Completed" means status=completed (not just
|
|
80
|
+
skipped/partial — those count as incomplete for dependency purposes).
|
|
81
|
+
|
|
82
|
+
Dependency checks:
|
|
83
|
+
- Cycle detection prevents circular dependencies
|
|
84
|
+
- Runner evaluates dependencies at task selection time
|
|
85
|
+
- Use \`steroids sections graph\` to visualize the dependency tree
|
|
86
|
+
|
|
87
|
+
Commands:
|
|
88
|
+
steroids sections depends-on <id> <dep-id> # add dependency
|
|
89
|
+
steroids sections no-depends-on <id> <dep-id> # remove dependency
|
|
90
|
+
steroids sections list --deps # show deps inline
|
|
91
|
+
steroids sections graph # ASCII dependency tree
|
|
92
|
+
steroids sections graph --mermaid # Mermaid syntax
|
|
93
|
+
steroids sections graph --json # JSON output
|
|
25
94
|
|
|
26
95
|
## ARCHITECTURE
|
|
27
|
-
- Tasks stored in .steroids/steroids.db (per project)
|
|
96
|
+
- Tasks stored in .steroids/steroids.db (SQLite, per project)
|
|
28
97
|
- Runner daemon executes the loop (one per project)
|
|
29
98
|
- Coder LLM: implements task, commits, submits for review
|
|
30
99
|
- Reviewer LLM: verifies implementation, approves or rejects
|
|
31
|
-
-
|
|
100
|
+
- Coordinator LLM: breaks deadlocks at rejection thresholds [2, 5, 9]
|
|
101
|
+
- Build verification: orchestrator re-runs build+tests after coder submits
|
|
102
|
+
- If build/tests fail → auto-reject back to in_progress (coder fixes)
|
|
32
103
|
|
|
33
104
|
## MULTI-PROJECT
|
|
34
105
|
- Multiple projects can have runners simultaneously
|
|
@@ -44,7 +115,7 @@ steroids tasks # pending tasks (current project)
|
|
|
44
115
|
steroids tasks --status active # in_progress+review (current project)
|
|
45
116
|
steroids tasks --status active --global # active across ALL projects
|
|
46
117
|
steroids tasks --status all # all tasks
|
|
47
|
-
steroids tasks audit <id>
|
|
118
|
+
steroids tasks audit <id> # view task spec, history, rejection notes
|
|
48
119
|
|
|
49
120
|
### Add Tasks
|
|
50
121
|
steroids tasks add "Title" --section <id> --source <spec-file>
|
|
@@ -79,8 +150,13 @@ steroids tasks skip <id> --partial --notes "reason" # coded some, rest e
|
|
|
79
150
|
|
|
80
151
|
### Sections
|
|
81
152
|
steroids sections list # list sections
|
|
153
|
+
steroids sections list --deps # list with dependencies shown
|
|
82
154
|
steroids sections skip <id> # exclude from runner
|
|
83
155
|
steroids sections unskip <id> # include in runner
|
|
156
|
+
steroids sections priority <id> <val> # set priority (0-100 or high/medium/low)
|
|
157
|
+
steroids sections depends-on <A> <B> # A depends on B (B must complete first)
|
|
158
|
+
steroids sections no-depends-on <A> <B> # remove dependency
|
|
159
|
+
steroids sections graph # show dependency graph
|
|
84
160
|
|
|
85
161
|
### Runners (daemon that executes tasks)
|
|
86
162
|
steroids runners list # all runners (all projects)
|
|
@@ -115,26 +191,22 @@ steroids tasks reject <id> --model human --notes "reason" # reject manually
|
|
|
115
191
|
### Restart failed task
|
|
116
192
|
steroids tasks update <id> --status pending --reset-rejections # reset to pending with fresh count
|
|
117
193
|
|
|
194
|
+
### Fix incorrectly marked partial/skipped tasks
|
|
195
|
+
steroids tasks update <id> --status pending --actor human:cli
|
|
196
|
+
# Use when: a task was marked partial/skipped but still needs coding
|
|
197
|
+
|
|
118
198
|
### Skip external setup task
|
|
119
199
|
steroids tasks skip <id> --notes "spec says SKIP, needs Cloud SQL setup"
|
|
120
200
|
# Use when: spec says SKIP/MANUAL, requires cloud console, account creation, etc.
|
|
121
201
|
# --partial: use if you coded some parts but rest needs human action
|
|
122
202
|
|
|
123
|
-
## TASK STATES
|
|
124
|
-
- pending: waiting to be picked up
|
|
125
|
-
- in_progress: coder is working on it
|
|
126
|
-
- review: coder submitted, waiting for reviewer
|
|
127
|
-
- completed: approved by reviewer
|
|
128
|
-
- skipped: fully external (Cloud SQL, manual setup) - human must do
|
|
129
|
-
- partial: some coded, rest external - human must complete
|
|
130
|
-
- failed: exceeded 15 rejections, needs human intervention
|
|
131
|
-
- disputed: coder/reviewer disagreement, needs human resolution
|
|
132
|
-
|
|
133
203
|
## IMPORTANT NOTES
|
|
134
204
|
- Task spec is in source file (see tasks audit output)
|
|
135
|
-
- Max 15 rejections before task fails
|
|
205
|
+
- Max 15 rejections before task fails; coordinator intervenes at [2, 5, 9]
|
|
136
206
|
- Runner auto-restarts via cron (steroids runners cron install)
|
|
137
207
|
- Each project isolated: own database, own runner
|
|
208
|
+
- Section dependencies block entire sections, not individual tasks
|
|
209
|
+
- Build+test verification happens automatically after coder submits
|
|
138
210
|
`;
|
|
139
211
|
const HELP = (0, help_js_1.generateHelp)({
|
|
140
212
|
command: 'llm',
|
package/dist/commands/llm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm.js","sourceRoot":"","sources":["../../src/commands/llm.ts"],"names":[],"mappings":";AAAA;;;GAGG;;
|
|
1
|
+
{"version":3,"file":"llm.js","sourceRoot":"","sources":["../../src/commands/llm.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAwOH,gCA4HC;AAjWD,qCAAqC;AACrC,yCAAqC;AACrC,wDAA+D;AAC/D,oDAAmD;AACnD,6DAAyD;AACzD,uDAAmD;AACnD,4CAA8C;AAE9C,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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5 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const SCHEMA_VERSION = "0.1.0";
|
|
6
6
|
export declare const SCHEMA_SQL = "\n-- Schema metadata (version tracking)\nCREATE TABLE IF NOT EXISTS _schema (\n key TEXT PRIMARY KEY,\n value TEXT NOT NULL\n);\n\n-- Applied migrations log\nCREATE TABLE IF NOT EXISTS _migrations (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n checksum TEXT NOT NULL,\n applied_at TEXT NOT NULL DEFAULT (datetime('now'))\n);\n\n-- Sections (task groups)\nCREATE TABLE IF NOT EXISTS sections (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n position INTEGER NOT NULL,\n priority INTEGER DEFAULT 50,\n skipped INTEGER DEFAULT 0,\n created_at TEXT NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE INDEX IF NOT EXISTS idx_sections_priority ON sections(priority);\n\n-- Tasks\nCREATE TABLE IF NOT EXISTS tasks (\n id TEXT PRIMARY KEY,\n title TEXT NOT NULL,\n status TEXT NOT NULL DEFAULT 'pending',\n section_id TEXT REFERENCES sections(id),\n source_file TEXT,\n file_path TEXT,\n file_line INTEGER,\n file_commit_sha TEXT,\n file_content_hash TEXT,\n rejection_count INTEGER NOT NULL DEFAULT 0,\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n updated_at TEXT NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status);\nCREATE INDEX IF NOT EXISTS idx_tasks_section ON tasks(section_id);\n\n-- Audit trail (immutable log of status changes)\nCREATE TABLE IF NOT EXISTS audit (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n task_id TEXT NOT NULL REFERENCES tasks(id),\n from_status TEXT,\n to_status TEXT NOT NULL,\n actor TEXT NOT NULL,\n actor_type TEXT DEFAULT 'human',\n model TEXT,\n notes TEXT,\n commit_sha TEXT,\n created_at TEXT NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE INDEX IF NOT EXISTS idx_audit_task ON audit(task_id);\nCREATE INDEX IF NOT EXISTS idx_audit_commit ON audit(commit_sha);\n\n-- Disputes\nCREATE TABLE IF NOT EXISTS disputes (\n id TEXT PRIMARY KEY,\n task_id TEXT NOT NULL REFERENCES tasks(id),\n type TEXT NOT NULL,\n status TEXT NOT NULL DEFAULT 'open',\n reason TEXT NOT NULL,\n coder_position TEXT,\n reviewer_position TEXT,\n resolution TEXT,\n resolution_notes TEXT,\n created_by TEXT NOT NULL,\n resolved_by TEXT,\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n resolved_at TEXT\n);\n\nCREATE INDEX IF NOT EXISTS idx_disputes_task ON disputes(task_id);\nCREATE INDEX IF NOT EXISTS idx_disputes_status ON disputes(status);\n\n-- Task locks (for orchestrator coordination)\nCREATE TABLE IF NOT EXISTS task_locks (\n task_id TEXT PRIMARY KEY REFERENCES tasks(id),\n runner_id TEXT NOT NULL,\n acquired_at TEXT NOT NULL DEFAULT (datetime('now')),\n expires_at TEXT NOT NULL,\n heartbeat_at TEXT NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE INDEX IF NOT EXISTS idx_task_locks_expires ON task_locks(expires_at);\n\n-- Section locks (for orchestrator coordination)\nCREATE TABLE IF NOT EXISTS section_locks (\n section_id TEXT PRIMARY KEY REFERENCES sections(id),\n runner_id TEXT NOT NULL,\n acquired_at TEXT NOT NULL DEFAULT (datetime('now')),\n expires_at TEXT NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_section_locks_expires ON section_locks(expires_at);\n\n-- Section dependencies (ordering constraints between sections)\nCREATE TABLE IF NOT EXISTS section_dependencies (\n id TEXT PRIMARY KEY,\n section_id TEXT NOT NULL REFERENCES sections(id),\n depends_on_section_id TEXT NOT NULL REFERENCES sections(id),\n created_at TEXT DEFAULT (datetime('now')),\n UNIQUE(section_id, depends_on_section_id)\n);\n\nCREATE INDEX IF NOT EXISTS idx_section_dependencies_section ON section_dependencies(section_id);\nCREATE INDEX IF NOT EXISTS idx_section_dependencies_depends_on ON section_dependencies(depends_on_section_id);\n\n-- Task invocations (LLM calls per task)\nCREATE TABLE IF NOT EXISTS task_invocations (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n task_id TEXT NOT NULL REFERENCES tasks(id),\n role TEXT NOT NULL,\n provider TEXT NOT NULL,\n model TEXT NOT NULL,\n prompt TEXT NOT NULL,\n response TEXT,\n error TEXT,\n exit_code INTEGER NOT NULL DEFAULT 0,\n duration_ms INTEGER NOT NULL DEFAULT 0,\n success INTEGER NOT NULL DEFAULT 0,\n timed_out INTEGER NOT NULL DEFAULT 0,\n rejection_number INTEGER,\n created_at TEXT NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE INDEX IF NOT EXISTS idx_task_invocations_task ON task_invocations(task_id);\nCREATE INDEX IF NOT EXISTS idx_task_invocations_role ON task_invocations(role);\nCREATE INDEX IF NOT EXISTS idx_task_invocations_created ON task_invocations(created_at DESC);\n";
|
|
7
|
-
export declare const INITIAL_SCHEMA_DATA = "\nINSERT OR REPLACE INTO _schema (key, value) VALUES ('version', '0.1.0');\nINSERT OR REPLACE INTO _schema (key, value) VALUES ('created_at', datetime('now'));\n\n-- Mark all migrations as applied since new databases have the full schema\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (1, '001_initial_schema', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (2, '002_add_commit_sha', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (3, '003_add_section_priority', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (4, '004_add_section_dependencies', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (5, '005_add_audit_actor_model', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (6, '006_add_task_invocations', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (7, '007_add_file_anchor', 'builtin');\n";
|
|
7
|
+
export declare const INITIAL_SCHEMA_DATA = "\nINSERT OR REPLACE INTO _schema (key, value) VALUES ('version', '0.1.0');\nINSERT OR REPLACE INTO _schema (key, value) VALUES ('created_at', datetime('now'));\n\n-- Mark all migrations as applied since new databases have the full schema\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (1, '001_initial_schema', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (2, '002_add_commit_sha', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (3, '003_add_section_priority', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (4, '004_add_section_dependencies', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (5, '005_add_audit_actor_model', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (6, '006_add_task_invocations', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (7, '007_add_file_anchor', 'builtin');\nINSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (8, '008_add_section_skipped', 'builtin');\n";
|
|
8
8
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/database/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,eAAO,MAAM,UAAU,4jJAyItB,CAAC;AAEF,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/database/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,eAAO,MAAM,UAAU,4jJAyItB,CAAC;AAEF,eAAO,MAAM,mBAAmB,+jCAa/B,CAAC"}
|
package/dist/database/schema.js
CHANGED
|
@@ -156,5 +156,6 @@ INSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (4, '004_add_secti
|
|
|
156
156
|
INSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (5, '005_add_audit_actor_model', 'builtin');
|
|
157
157
|
INSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (6, '006_add_task_invocations', 'builtin');
|
|
158
158
|
INSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (7, '007_add_file_anchor', 'builtin');
|
|
159
|
+
INSERT OR IGNORE INTO _migrations (id, name, checksum) VALUES (8, '008_add_section_skipped', 'builtin');
|
|
159
160
|
`;
|
|
160
161
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/database/schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,cAAc,GAAG,OAAO,CAAC;AAEzB,QAAA,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyIzB,CAAC;AAEW,QAAA,mBAAmB,GAAG;kEAC+B,sBAAc
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/database/schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,cAAc,GAAG,OAAO,CAAC;AAEzB,QAAA,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyIzB,CAAC;AAEW,QAAA,mBAAmB,GAAG;kEAC+B,sBAAc;;;;;;;;;;;;CAY/E,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- Migration: Add skipped column to sections table
|
|
2
|
+
-- Allows sections to be excluded from runner processing (e.g., "Needs User Input")
|
|
3
|
+
|
|
4
|
+
-- UP
|
|
5
|
+
ALTER TABLE sections ADD COLUMN skipped INTEGER DEFAULT 0;
|
|
6
|
+
|
|
7
|
+
-- DOWN
|
|
8
|
+
-- Note: SQLite doesn't support DROP COLUMN directly
|
|
9
|
+
-- Forward-only migration
|
package/migrations/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
3
|
-
"latestDbVersion":
|
|
2
|
+
"version": "0.2.1",
|
|
3
|
+
"latestDbVersion": 8,
|
|
4
4
|
"migrations": [
|
|
5
5
|
{
|
|
6
6
|
"id": 1,
|
|
@@ -57,6 +57,14 @@
|
|
|
57
57
|
"description": "Add file anchor columns (file_path, file_line, file_commit_sha, file_content_hash) to tasks table",
|
|
58
58
|
"checksum": "",
|
|
59
59
|
"cliVersion": "0.4.39"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": 8,
|
|
63
|
+
"name": "008_add_section_skipped",
|
|
64
|
+
"file": "008_add_section_skipped.sql",
|
|
65
|
+
"description": "Add skipped column to sections table for excluding sections from runner",
|
|
66
|
+
"checksum": "",
|
|
67
|
+
"cliVersion": "0.4.51"
|
|
60
68
|
}
|
|
61
69
|
]
|
|
62
70
|
}
|