Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ from existing transcripts. MEMORY.md is no longer read; move facts into INDEX.md
- Schema 14 (MP-78): `sessions` gains the scope `org` and the column `org_id`; `mypi db init` is required. `mypi org remove` refuses while an organization session or an event with its slug exists.
- Pipeline texts (MP-116): `docs/PLAN-FORMAT.md` no longer names a `/review` command (a rework plan comes from `/plan`; Acceptance is walked at the manual check before `/ship`) and gains the «Execution» section, mandatory for plans the Pi `/flow` runs and absent from Claude plans; `docs/PIPELINE.md` says a pi-subagents child's `PI_SESSION_ID` is its own id, so its scope falls back to `MYPI_SCOPE`, then `global`.

### Fixed

- Merged status in fresh databases (MP-122): a database created by `pnpm bootstrap` now has the non-terminal status `merged` that `/ship` and `docs/PIPELINE.md` rely on, so `mp-task status <KEY> merged` works on a fresh install. Existing databases are not changed and need no `db init`; a database without `merged` (created by v0.11.0 or earlier) adds it once with `mypi status add merged`.

### Removed

- Memory (MP-104): `MEMORY.md` files, the MCP tool and CLI command `memory` and the warmup's memory zones and fact hiding are removed; durable facts live on a level's entry or in a branch it links.
Expand Down
3 changes: 2 additions & 1 deletion src/infrastructure/database/migrations/001-initial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ END;

INSERT INTO request_statuses(code, is_terminal) VALUES
('new', 0), ('research', 0), ('planning', 0), ('in_progress', 0), ('review', 0),
('blocked', 0), ('paused', 0), ('done', 1), ('failed', 1), ('cancelled', 1);
('blocked', 0), ('paused', 0), ('done', 1), ('failed', 1), ('cancelled', 1),
('merged', 0);
19 changes: 18 additions & 1 deletion test/fast/database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ test('initialization is a no-op on a current database and rejects a newer schema
let db = openDatabase(filename);
assert.equal(db.pragma('journal_mode', { simple: true }), 'wal');
assert.deepEqual(db.prepare('SELECT code, is_terminal FROM task_statuses ORDER BY id').all(),
['new', 'research', 'planning', 'in_progress', 'review', 'blocked', 'paused', 'done', 'failed', 'cancelled']
['new', 'research', 'planning', 'in_progress', 'review', 'blocked', 'paused', 'done', 'failed', 'cancelled', 'merged']
.map(code => ({ code, is_terminal: ['done', 'failed', 'cancelled'].includes(code) ? 1 : 0 })));
db.prepare("UPDATE task_statuses SET code = 'fresh' WHERE code = 'new'").run();
db.prepare("INSERT INTO task_statuses(code, is_terminal) VALUES ('custom', 0)").run();
db.prepare("DELETE FROM task_statuses WHERE code = 'merged'").run();
db.prepare("INSERT INTO task_statuses(code, is_terminal) VALUES ('merged', 0)").run();
const expected = db.prepare('SELECT * FROM task_statuses ORDER BY id').all();
db.close();
initializeDatabase(filename);
Expand All @@ -84,6 +86,21 @@ test('initialization is a no-op on a current database and rejects a newer schema
} finally { unsupported.close(); }
});

test('a fresh database lets a task go review → merged → done', t => {
const { filename } = state(t);
const app = createApp(filename, false);
try {
const project = app.projects.add('one/project', 'MP');
const task = app.tasks.create({ projectId: project.id, slug: 'ship', title: 'ship', status: 'review' }, () => {});
const merged = app.tasks.change(task.id, { status: 'merged' }, 'merged');
assert.equal(merged.changed, true);
assert.equal(merged.after.isTerminal, false);
const done = app.tasks.change(task.id, { status: 'done' }, 'accepted');
assert.equal(done.changed, true);
assert.equal(done.after.isTerminal, true);
} finally { app.close(); }
});

test('schemas 6 and 7 upgrade a v0.7.0 database: work_chats dropped, requests renamed to tasks, journal literals mapped, ids and paths kept', async t => {
const dir = mkdtempSync(join(tmpdir(), 'mypi-'));
t.after(() => rmSync(dir, { recursive: true, force: true }));
Expand Down
Loading