From 3e26cd5ad7a0cbd1445f535ccd63c2e79d3580a4 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 2 Sep 2026 23:47:56 +0000 Subject: Hide paused chains' tasks from the task list Pausing a chain is supposed to take its work off the list -- that's the entire point of the control. But the three task-fetching queries only ever checked `chain_unlocked`, never the owning chain's status, so a paused chain's head task kept appearing exactly like an active one. Verified against production: 4 of the 8 visible chain tasks came from chains that had been explicitly paused ("Will", "ABYC Marine Electrical certification", "Standard services agreement", "Find a broker who writes marine trades"). Half the chain clutter on the list was work the user had already told doot to put away. Fixed the class, not just the instances: the predicate now lives in one shared visibleChainTaskClause constant used by all three queries, with a structural test asserting no query spells it out inline and that every query still references it. The previous shape -- the same predicate copy-pasted into three separate query strings -- is exactly why a fourth query would have gotten it wrong too. Also added task_chains to sqlite_test.go's leaner test schema, since the queries now join against it even for chain-less tasks. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B --- internal/store/sqlite_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'internal/store/sqlite_test.go') diff --git a/internal/store/sqlite_test.go b/internal/store/sqlite_test.go index c64e6b3..95996b3 100644 --- a/internal/store/sqlite_test.go +++ b/internal/store/sqlite_test.go @@ -193,6 +193,15 @@ func setupTestStoreWithNativeTasks(t *testing.T) *Store { bucket_state TEXT DEFAULT '', bucket_last_active_at DATETIME ); + -- The task queries join against this to check the owning chain's status + -- (see visibleChainTaskClause), so it has to exist even for tests that + -- only ever create plain, chain-less tasks. + CREATE TABLE IF NOT EXISTS task_chains ( + id TEXT PRIMARY KEY, + project_id TEXT DEFAULT '', + status TEXT DEFAULT 'active', + created_at DATETIME DEFAULT CURRENT_TIMESTAMP + ); ` if _, err := db.Exec(schema); err != nil { t.Fatalf("Failed to create schema: %v", err) -- cgit v1.2.3