Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (codex): repoint clawed-ollama task pins in TASKS.md/COS-TASKS.md
[._.]/ Adam Eivy3cf8707042ff
diff --git a/scripts/migrations/146-claude-ollama-providers.js b/scripts/migrations/146-claude-ollama-providers.jsindex f6d22fe859..e8aade0649 100644--- a/scripts/migrations/146-claude-ollama-providers.js+++ b/scripts/migrations/146-claude-ollama-providers.js@@ -115,6 +115,28 @@ function rewriteProviderPins(node) {return changed;}+// Task-level pins live in the markdown task queues (TASKS.md / COS-TASKS.md) as+// `metadata.provider` — read by resolveAgentProviderAndModel for a pending or+// in-progress task. Those aren't JSON, so rewrite the exact old-id token in+// place. `clawed-ollama` is a unique provider slug, so a boundary-guarded token+// replace (not preceded/followed by an id char) can't touch unrelated text, and+// it's format-agnostic (no markdown-metadata parser to keep in sync).+const PIN_TEXT_FILES = ['TASKS.md', 'COS-TASKS.md'];++async function rewritePinTextFile(rootDir, relPath) {+ const filePath = join(rootDir, relPath);+ const raw = await readFile(filePath, 'utf-8').catch((err) => {+ if (err.code === 'ENOENT') return null;+ throw err;+ });+ if (raw == null) return;+ const next = raw.replace(new RegExp(`(?<![a-z0-9-])${OLD_ID}(?![a-z0-9-])`, 'g'), NEW_ID);+ if (next !== raw) {+ await writeFile(filePath, next);+ console.log(`📝 ${relPath}: repointed ${OLD_ID} provider pins → ${NEW_ID}`);+ }+}+async function rewritePinFile(rootDir, relPath) {const filePath = join(rootDir, relPath);const raw = await readFile(filePath, 'utf-8').catch((err) => {@@ -201,5 +223,8 @@ export default {for (const relPath of PIN_FILES) {await rewritePinFile(rootDir, relPath);}+ for (const relPath of PIN_TEXT_FILES) {+ await rewritePinTextFile(rootDir, relPath);+ }},};diff --git a/scripts/migrations/146-claude-ollama-providers.test.js b/scripts/migrations/146-claude-ollama-providers.test.jsindex 9d0f505fb5..ee41dd6c09 100644--- a/scripts/migrations/146-claude-ollama-providers.test.js+++ b/scripts/migrations/146-claude-ollama-providers.test.js@@ -174,6 +174,33 @@ describe('migration 146 — Claude Ollama providers', () => {expect(jobs.jobs[2].providerId).toBe('claude-code'); // untouched});+ it('repoints clawed-ollama task pins in TASKS.md / COS-TASKS.md markdown', async () => {+ writeJson(providersPath, { providers: { 'clawed-ollama': clawed() } });+ const tasksPath = join(rootDir, 'TASKS.md');+ const cosTasksPath = join(rootDir, 'COS-TASKS.md');+ writeFileSync(tasksPath, '# Tasks\n\n- [ ] Do a thing\n provider: clawed-ollama\n model: qwen2.5:7b\n');+ writeFileSync(cosTasksPath, '# CoS Tasks\n\n- [ ] internal\n provider: clawed-ollama\n');++ await migration.up({ rootDir });++ expect(readFileSync(tasksPath, 'utf-8')).toContain('provider: claude-ollama');+ expect(readFileSync(tasksPath, 'utf-8')).not.toContain('clawed-ollama');+ expect(readFileSync(cosTasksPath, 'utf-8')).toContain('provider: claude-ollama');+ });++ it('does not touch claude-ollama-tui or unrelated tokens in markdown task files', async () => {+ writeJson(providersPath, { providers: { 'claude-code': { id: 'claude-code', type: 'cli', command: 'claude' } } });+ const tasksPath = join(rootDir, 'TASKS.md');+ // a task pinned to the TUI variant + prose must survive untouched+ writeFileSync(tasksPath, '- [ ] x\n provider: claude-ollama-tui\n context: see clawed-ollama-notes.md\n');+ const before = readFileSync(tasksPath, 'utf-8');++ await migration.up({ rootDir });++ // boundary guard: "claude-ollama-tui" and "clawed-ollama-notes.md" are NOT bare clawed-ollama tokens+ expect(readFileSync(tasksPath, 'utf-8')).toBe(before);+ });+it('leaves pin files untouched when they have no clawed-ollama references', async () => {writeJson(providersPath, { providers: { 'claude-code': { id: 'claude-code', type: 'cli', command: 'claude' } } });const schedulePath = join(rootDir, 'data/task-schedule.json');