Revert 12 PRs merged without authorization

Reverts:
- #413 fix(install): build hooks/dist on the fly for dev installs
- #396 refactor(statusline): display git branch in status line
- #543 Add in-progress state for todos
- #532 feat: add git_tag config option
- #171 Add OpenCode installer package
- #519 feat: Add Mistral Vibe CLI Support
- #389 docs: use @latest for uninstall commands
- #288 fix(install): auto-migrate renamed statusline.js reference
- #502 fix(#501): verify-work defers diagnosis/planning
- #497 fix: move resolved debug sessions to resolved/ folder
- #512 fix: create feature branch before first commit
- #545 fix: add Write tool to gsd-verifier

These were merged without owner approval.
This commit is contained in:
Lex Christopherson
2026-02-14 14:25:26 -06:00
parent e146b0846a
commit 9d815d31db
26 changed files with 424 additions and 1383 deletions

View File

@@ -51,8 +51,7 @@
* progress [json|table|bar] Render progress in various formats
*
* Todos:
* todo start <filename> Move todo from pending to in-progress
* todo complete <filename> Move todo from in-progress (or pending) to done
* todo complete <filename> Move todo from pending to completed
*
* Scaffolding:
* scaffold context --phase <N> Create CONTEXT.md template
@@ -161,7 +160,6 @@ function loadConfig(cwd) {
model_profile: 'balanced',
commit_docs: true,
search_gitignored: false,
git_tag: true,
branching_strategy: 'none',
phase_branch_template: 'gsd/phase-{phase}-{slug}',
milestone_branch_template: 'gsd/{milestone}-{slug}',
@@ -195,7 +193,6 @@ function loadConfig(cwd) {
model_profile: get('model_profile') ?? defaults.model_profile,
commit_docs: get('commit_docs', { section: 'planning', field: 'commit_docs' }) ?? defaults.commit_docs,
search_gitignored: get('search_gitignored', { section: 'planning', field: 'search_gitignored' }) ?? defaults.search_gitignored,
git_tag: get('git_tag', { section: 'planning', field: 'git_tag' }) ?? defaults.git_tag,
branching_strategy: get('branching_strategy', { section: 'git', field: 'branching_strategy' }) ?? defaults.branching_strategy,
phase_branch_template: get('phase_branch_template', { section: 'git', field: 'phase_branch_template' }) ?? defaults.phase_branch_template,
milestone_branch_template: get('milestone_branch_template', { section: 'git', field: 'milestone_branch_template' }) ?? defaults.milestone_branch_template,
@@ -518,12 +515,9 @@ function cmdCurrentTimestamp(format, raw) {
function cmdListTodos(cwd, area, raw) {
const pendingDir = path.join(cwd, '.planning', 'todos', 'pending');
const inProgressDir = path.join(cwd, '.planning', 'todos', 'in-progress');
let count = 0;
const todos = [];
let inProgressCount = 0;
const inProgressTodos = [];
try {
const files = fs.readdirSync(pendingDir).filter(f => f.endsWith('.md'));
@@ -552,35 +546,7 @@ function cmdListTodos(cwd, area, raw) {
}
} catch {}
try {
const files = fs.readdirSync(inProgressDir).filter(f => f.endsWith('.md'));
for (const file of files) {
try {
const content = fs.readFileSync(path.join(inProgressDir, file), 'utf-8');
const createdMatch = content.match(/^created:\s*(.+)$/m);
const titleMatch = content.match(/^title:\s*(.+)$/m);
const areaMatch = content.match(/^area:\s*(.+)$/m);
const startedMatch = content.match(/^started:\s*(.+)$/m);
const todoArea = areaMatch ? areaMatch[1].trim() : 'general';
if (area && todoArea !== area) continue;
inProgressCount++;
inProgressTodos.push({
file,
created: createdMatch ? createdMatch[1].trim() : 'unknown',
started: startedMatch ? startedMatch[1].trim() : 'unknown',
title: titleMatch ? titleMatch[1].trim() : 'Untitled',
area: todoArea,
path: path.join('.planning', 'todos', 'in-progress', file),
});
} catch {}
}
} catch {}
const result = { count, todos, in_progress_count: inProgressCount, in_progress_todos: inProgressTodos };
const result = { count, todos };
output(result, raw, count.toString());
}
@@ -632,7 +598,6 @@ function cmdConfigEnsureSection(cwd, raw) {
model_profile: 'balanced',
commit_docs: true,
search_gitignored: false,
git_tag: true,
branching_strategy: 'none',
phase_branch_template: 'gsd/phase-{phase}-{slug}',
milestone_branch_template: 'gsd/{milestone}-{slug}',
@@ -3418,35 +3383,6 @@ function cmdProgressRender(cwd, format, raw) {
}
}
// ─── Todo Start ──────────────────────────────────────────────────────────────
function cmdTodoStart(cwd, filename, raw) {
if (!filename) {
error('filename required for todo start');
}
const pendingDir = path.join(cwd, '.planning', 'todos', 'pending');
const inProgressDir = path.join(cwd, '.planning', 'todos', 'in-progress');
const sourcePath = path.join(pendingDir, filename);
if (!fs.existsSync(sourcePath)) {
error(`Todo not found: ${filename}`);
}
// Ensure in-progress directory exists
fs.mkdirSync(inProgressDir, { recursive: true });
// Read, add started timestamp, move
let content = fs.readFileSync(sourcePath, 'utf-8');
const today = new Date().toISOString().split('T')[0];
content = `started: ${today}\n` + content;
fs.writeFileSync(path.join(inProgressDir, filename), content, 'utf-8');
fs.unlinkSync(sourcePath);
output({ started: true, file: filename, date: today }, raw, 'started');
}
// ─── Todo Complete ────────────────────────────────────────────────────────────
function cmdTodoComplete(cwd, filename, raw) {
@@ -3454,28 +3390,23 @@ function cmdTodoComplete(cwd, filename, raw) {
error('filename required for todo complete');
}
const inProgressDir = path.join(cwd, '.planning', 'todos', 'in-progress');
const pendingDir = path.join(cwd, '.planning', 'todos', 'pending');
const doneDir = path.join(cwd, '.planning', 'todos', 'done');
const completedDir = path.join(cwd, '.planning', 'todos', 'completed');
const sourcePath = path.join(pendingDir, filename);
// Check in-progress first, then fall back to pending
let sourcePath = path.join(inProgressDir, filename);
if (!fs.existsSync(sourcePath)) {
sourcePath = path.join(pendingDir, filename);
if (!fs.existsSync(sourcePath)) {
error(`Todo not found: ${filename}`);
}
error(`Todo not found: ${filename}`);
}
// Ensure done directory exists
fs.mkdirSync(doneDir, { recursive: true });
// Ensure completed directory exists
fs.mkdirSync(completedDir, { recursive: true });
// Read, add completion timestamp, move
let content = fs.readFileSync(sourcePath, 'utf-8');
const today = new Date().toISOString().split('T')[0];
content = `completed: ${today}\n` + content;
fs.writeFileSync(path.join(doneDir, filename), content, 'utf-8');
fs.writeFileSync(path.join(completedDir, filename), content, 'utf-8');
fs.unlinkSync(sourcePath);
output({ completed: true, file: filename, date: today }, raw, 'completed');
@@ -3721,7 +3652,6 @@ function cmdInitPlanPhase(cwd, phase, includes, raw) {
research_enabled: config.research,
plan_checker_enabled: config.plan_checker,
commit_docs: config.commit_docs,
branching_strategy: config.branching_strategy,
// Phase info
phase_found: !!phaseInfo,
@@ -3731,17 +3661,6 @@ function cmdInitPlanPhase(cwd, phase, includes, raw) {
phase_slug: phaseInfo?.phase_slug || null,
padded_phase: phaseInfo?.phase_number?.padStart(2, '0') || null,
// Branch name (pre-computed) — ensures early branching before first commit
branch_name: config.branching_strategy === 'phase' && phaseInfo
? config.phase_branch_template
.replace('{phase}', phaseInfo.phase_number)
.replace('{slug}', phaseInfo.phase_slug || 'phase')
: config.branching_strategy === 'milestone'
? config.milestone_branch_template
.replace('{milestone}', getMilestoneInfo(cwd).version)
.replace('{slug}', generateSlugInternal(getMilestoneInfo(cwd).name) || 'milestone')
: null,
// Existing artifacts
has_research: phaseInfo?.has_research || false,
has_context: phaseInfo?.has_context || false,
@@ -4000,13 +3919,11 @@ function cmdInitVerifyWork(cwd, phase, raw) {
function cmdInitPhaseOp(cwd, phase, raw) {
const config = loadConfig(cwd);
const phaseInfo = findPhaseInternal(cwd, phase);
const milestone = getMilestoneInfo(cwd);
const result = {
// Config
commit_docs: config.commit_docs,
brave_search: config.brave_search,
branching_strategy: config.branching_strategy,
// Phase info
phase_found: !!phaseInfo,
@@ -4016,17 +3933,6 @@ function cmdInitPhaseOp(cwd, phase, raw) {
phase_slug: phaseInfo?.phase_slug || null,
padded_phase: phaseInfo?.phase_number?.padStart(2, '0') || null,
// Branch name (pre-computed) — ensures early branching before first commit
branch_name: config.branching_strategy === 'phase' && phaseInfo
? config.phase_branch_template
.replace('{phase}', phaseInfo.phase_number)
.replace('{slug}', phaseInfo.phase_slug || 'phase')
: config.branching_strategy === 'milestone'
? config.milestone_branch_template
.replace('{milestone}', milestone.version)
.replace('{slug}', generateSlugInternal(milestone.name) || 'milestone')
: null,
// Existing artifacts
has_research: phaseInfo?.has_research || false,
has_context: phaseInfo?.has_context || false,
@@ -4046,7 +3952,7 @@ function cmdInitTodos(cwd, area, raw) {
const config = loadConfig(cwd);
const now = new Date();
// List pending todos
// List todos (reuse existing logic)
const pendingDir = path.join(cwd, '.planning', 'todos', 'pending');
let count = 0;
const todos = [];
@@ -4075,37 +3981,6 @@ function cmdInitTodos(cwd, area, raw) {
}
} catch {}
// List in-progress todos
const inProgressDir = path.join(cwd, '.planning', 'todos', 'in-progress');
let inProgressCount = 0;
const inProgressTodos = [];
try {
const files = fs.readdirSync(inProgressDir).filter(f => f.endsWith('.md'));
for (const file of files) {
try {
const content = fs.readFileSync(path.join(inProgressDir, file), 'utf-8');
const createdMatch = content.match(/^created:\s*(.+)$/m);
const titleMatch = content.match(/^title:\s*(.+)$/m);
const areaMatch = content.match(/^area:\s*(.+)$/m);
const startedMatch = content.match(/^started:\s*(.+)$/m);
const todoArea = areaMatch ? areaMatch[1].trim() : 'general';
if (area && todoArea !== area) continue;
inProgressCount++;
inProgressTodos.push({
file,
created: createdMatch ? createdMatch[1].trim() : 'unknown',
started: startedMatch ? startedMatch[1].trim() : 'unknown',
title: titleMatch ? titleMatch[1].trim() : 'Untitled',
area: todoArea,
path: path.join('.planning', 'todos', 'in-progress', file),
});
} catch {}
}
} catch {}
const result = {
// Config
commit_docs: config.commit_docs,
@@ -4117,20 +3992,16 @@ function cmdInitTodos(cwd, area, raw) {
// Todo inventory
todo_count: count,
todos,
in_progress_count: inProgressCount,
in_progress_todos: inProgressTodos,
area_filter: area || null,
// Paths
pending_dir: '.planning/todos/pending',
in_progress_dir: '.planning/todos/in-progress',
done_dir: '.planning/todos/done',
completed_dir: '.planning/todos/completed',
// File existence
planning_exists: pathExistsInternal(cwd, '.planning'),
todos_dir_exists: pathExistsInternal(cwd, '.planning/todos'),
pending_dir_exists: pathExistsInternal(cwd, '.planning/todos/pending'),
in_progress_dir_exists: pathExistsInternal(cwd, '.planning/todos/in-progress'),
};
output(result, raw);
@@ -4623,12 +4494,10 @@ async function main() {
case 'todo': {
const subcommand = args[1];
if (subcommand === 'start') {
cmdTodoStart(cwd, args[2], raw);
} else if (subcommand === 'complete') {
if (subcommand === 'complete') {
cmdTodoComplete(cwd, args[2], raw);
} else {
error('Unknown todo subcommand. Available: start, complete');
error('Unknown todo subcommand. Available: complete');
}
break;
}

View File

@@ -1885,60 +1885,6 @@ describe('progress command', () => {
});
});
// ─────────────────────────────────────────────────────────────────────────────
// todo start command
// ─────────────────────────────────────────────────────────────────────────────
describe('todo start command', () => {
let tmpDir;
beforeEach(() => {
tmpDir = createTempProject();
});
afterEach(() => {
cleanup(tmpDir);
});
test('moves todo from pending to in-progress', () => {
const pendingDir = path.join(tmpDir, '.planning', 'todos', 'pending');
fs.mkdirSync(pendingDir, { recursive: true });
fs.writeFileSync(
path.join(pendingDir, 'add-dark-mode.md'),
`title: Add dark mode\narea: ui\ncreated: 2025-01-01\n`
);
const result = runGsdTools('todo start add-dark-mode.md', tmpDir);
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
assert.strictEqual(output.started, true);
// Verify moved
assert.ok(
!fs.existsSync(path.join(tmpDir, '.planning', 'todos', 'pending', 'add-dark-mode.md')),
'should be removed from pending'
);
assert.ok(
fs.existsSync(path.join(tmpDir, '.planning', 'todos', 'in-progress', 'add-dark-mode.md')),
'should be in in-progress'
);
// Verify started timestamp added
const content = fs.readFileSync(
path.join(tmpDir, '.planning', 'todos', 'in-progress', 'add-dark-mode.md'),
'utf-8'
);
assert.ok(content.startsWith('started:'), 'should have started timestamp');
});
test('fails for nonexistent todo', () => {
const result = runGsdTools('todo start nonexistent.md', tmpDir);
assert.ok(!result.success, 'should fail');
assert.ok(result.error.includes('not found'), 'error mentions not found');
});
});
// ─────────────────────────────────────────────────────────────────────────────
// todo complete command
// ─────────────────────────────────────────────────────────────────────────────
@@ -1954,12 +1900,12 @@ describe('todo complete command', () => {
cleanup(tmpDir);
});
test('completes todo from in-progress', () => {
const inProgressDir = path.join(tmpDir, '.planning', 'todos', 'in-progress');
fs.mkdirSync(inProgressDir, { recursive: true });
test('moves todo from pending to completed', () => {
const pendingDir = path.join(tmpDir, '.planning', 'todos', 'pending');
fs.mkdirSync(pendingDir, { recursive: true });
fs.writeFileSync(
path.join(inProgressDir, 'add-dark-mode.md'),
`started: 2025-01-01\ntitle: Add dark mode\narea: ui\ncreated: 2025-01-01\n`
path.join(pendingDir, 'add-dark-mode.md'),
`title: Add dark mode\narea: ui\ncreated: 2025-01-01\n`
);
const result = runGsdTools('todo complete add-dark-mode.md', tmpDir);
@@ -1970,47 +1916,22 @@ describe('todo complete command', () => {
// Verify moved
assert.ok(
!fs.existsSync(path.join(tmpDir, '.planning', 'todos', 'in-progress', 'add-dark-mode.md')),
'should be removed from in-progress'
!fs.existsSync(path.join(tmpDir, '.planning', 'todos', 'pending', 'add-dark-mode.md')),
'should be removed from pending'
);
assert.ok(
fs.existsSync(path.join(tmpDir, '.planning', 'todos', 'done', 'add-dark-mode.md')),
'should be in done'
fs.existsSync(path.join(tmpDir, '.planning', 'todos', 'completed', 'add-dark-mode.md')),
'should be in completed'
);
// Verify completion timestamp added
const content = fs.readFileSync(
path.join(tmpDir, '.planning', 'todos', 'done', 'add-dark-mode.md'),
path.join(tmpDir, '.planning', 'todos', 'completed', 'add-dark-mode.md'),
'utf-8'
);
assert.ok(content.startsWith('completed:'), 'should have completed timestamp');
});
test('completes todo from pending directly', () => {
const pendingDir = path.join(tmpDir, '.planning', 'todos', 'pending');
fs.mkdirSync(pendingDir, { recursive: true });
fs.writeFileSync(
path.join(pendingDir, 'fix-bug.md'),
`title: Fix bug\narea: api\ncreated: 2025-01-01\n`
);
const result = runGsdTools('todo complete fix-bug.md', tmpDir);
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
assert.strictEqual(output.completed, true);
// Verify moved to done (not completed)
assert.ok(
!fs.existsSync(path.join(tmpDir, '.planning', 'todos', 'pending', 'fix-bug.md')),
'should be removed from pending'
);
assert.ok(
fs.existsSync(path.join(tmpDir, '.planning', 'todos', 'done', 'fix-bug.md')),
'should be in done'
);
});
test('fails for nonexistent todo', () => {
const result = runGsdTools('todo complete nonexistent.md', tmpDir);
assert.ok(!result.success, 'should fail');