Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Carry old task lists over when daily-task-manager first loads ops/tasks
garrytan7c3085c91944
diff --git a/plugin-variants/gbrain-daily/skills/daily-task-manager/SKILL.md b/plugin-variants/gbrain-daily/skills/daily-task-manager/SKILL.mdindex 8d050dc503..9ca616bb1b 100644--- a/plugin-variants/gbrain-daily/skills/daily-task-manager/SKILL.md+++ b/plugin-variants/gbrain-daily/skills/daily-task-manager/SKILL.md@@ -58,7 +58,7 @@ Map user intent deterministically before touching state:## Phases-1. **Load.** `get_page("ops/tasks")`. **First run:** if the page does not exist, create it from the Output Format template, then proceed.+1. **Load.** `get_page("ops/tasks")`. **First run:** if the page does not exist, look for `ops/tasks.md` (where earlier versions of this skill saved tasks): if it exists, create `ops/tasks` with its tasks and leave the old page in place; otherwise create it from the Output Format template. Then proceed.2. **Validate.** Determine the action via Action Routing. If required fields are missing (see per-action rules), ask ONE concise clarification before mutating state. Never fabricate priorities, due dates, or defer reasons.3. **Identify the target task** (complete/defer/remove): match by `id` when given; otherwise fuzzy-match description against ACTIVE tasks only. Zero matches → return `not_found`, do not mutate. Multiple matches → list candidates with IDs, return `ambiguous`, do not mutate.4. **Execute:**@@ -71,7 +71,7 @@ Map user intent deterministically before touching state:## Edge Cases-- **First run:** page missing → create from template before acting; `status: ok`, note "initialized".+- **First run:** page missing → carry the tasks over from `ops/tasks.md` if that page exists and leave the old page in place, else create from template, before acting; `status: ok`, note "initialized".- **Malformed page:** if `ops/tasks` exists but doesn't match the schema, do NOT rewrite it wholesale. Append/edit within it minimally, preserve unknown content verbatim, and flag the malformation in the reply.- **Retry/duplicate add:** if an identical description already exists in active tasks, do not add a duplicate — report the existing task ID instead.- **Dates:** ISO 8601 (`YYYY-MM-DD`) everywhere. Compute "today"/"next week" with code/clock, never guess.diff --git a/plugin/skills/daily-task-manager/SKILL.md b/plugin/skills/daily-task-manager/SKILL.mdindex 8d050dc503..9ca616bb1b 100644--- a/plugin/skills/daily-task-manager/SKILL.md+++ b/plugin/skills/daily-task-manager/SKILL.md@@ -58,7 +58,7 @@ Map user intent deterministically before touching state:## Phases-1. **Load.** `get_page("ops/tasks")`. **First run:** if the page does not exist, create it from the Output Format template, then proceed.+1. **Load.** `get_page("ops/tasks")`. **First run:** if the page does not exist, look for `ops/tasks.md` (where earlier versions of this skill saved tasks): if it exists, create `ops/tasks` with its tasks and leave the old page in place; otherwise create it from the Output Format template. Then proceed.2. **Validate.** Determine the action via Action Routing. If required fields are missing (see per-action rules), ask ONE concise clarification before mutating state. Never fabricate priorities, due dates, or defer reasons.3. **Identify the target task** (complete/defer/remove): match by `id` when given; otherwise fuzzy-match description against ACTIVE tasks only. Zero matches → return `not_found`, do not mutate. Multiple matches → list candidates with IDs, return `ambiguous`, do not mutate.4. **Execute:**@@ -71,7 +71,7 @@ Map user intent deterministically before touching state:## Edge Cases-- **First run:** page missing → create from template before acting; `status: ok`, note "initialized".+- **First run:** page missing → carry the tasks over from `ops/tasks.md` if that page exists and leave the old page in place, else create from template, before acting; `status: ok`, note "initialized".- **Malformed page:** if `ops/tasks` exists but doesn't match the schema, do NOT rewrite it wholesale. Append/edit within it minimally, preserve unknown content verbatim, and flag the malformation in the reply.- **Retry/duplicate add:** if an identical description already exists in active tasks, do not add a duplicate — report the existing task ID instead.- **Dates:** ISO 8601 (`YYYY-MM-DD`) everywhere. Compute "today"/"next week" with code/clock, never guess.diff --git a/skills/daily-task-manager/SKILL.md b/skills/daily-task-manager/SKILL.mdindex 994a5809e1..27168c025b 100644--- a/skills/daily-task-manager/SKILL.md+++ b/skills/daily-task-manager/SKILL.md@@ -57,7 +57,7 @@ Map user intent deterministically before touching state:## Phases-1. **Load.** `get_page("ops/tasks")`. **First run:** if the page does not exist, create it from the Output Format template, then proceed.+1. **Load.** `get_page("ops/tasks")`. **First run:** if the page does not exist, look for `ops/tasks.md` (where earlier versions of this skill saved tasks): if it exists, create `ops/tasks` with its tasks and leave the old page in place; otherwise create it from the Output Format template. Then proceed.2. **Validate.** Determine the action via Action Routing. If required fields are missing (see per-action rules), ask ONE concise clarification before mutating state. Never fabricate priorities, due dates, or defer reasons.3. **Identify the target task** (complete/defer/remove): match by `id` when given; otherwise fuzzy-match description against ACTIVE tasks only. Zero matches → return `not_found`, do not mutate. Multiple matches → list candidates with IDs, return `ambiguous`, do not mutate.4. **Execute:**@@ -70,7 +70,7 @@ Map user intent deterministically before touching state:## Edge Cases-- **First run:** page missing → create from template before acting; `status: ok`, note "initialized".+- **First run:** page missing → carry the tasks over from `ops/tasks.md` if that page exists and leave the old page in place, else create from template, before acting; `status: ok`, note "initialized".- **Malformed page:** if `ops/tasks` exists but doesn't match the schema, do NOT rewrite it wholesale. Append/edit within it minimally, preserve unknown content verbatim, and flag the malformation in the reply.- **Retry/duplicate add:** if an identical description already exists in active tasks, do not add a duplicate — report the existing task ID instead.- **Dates:** ISO 8601 (`YYYY-MM-DD`) everywhere. Compute "today"/"next week" with code/clock, never guess.diff --git a/skills/skills.lock.history.json b/skills/skills.lock.history.jsonindex 48e9b78d17..f05c3a91fc 100644--- a/skills/skills.lock.history.json+++ b/skills/skills.lock.history.json@@ -405,6 +405,7 @@"8ea2f89afcdd3cc84e0dc01ed4b5f6f1bae8c525bf717063e14cd2e15c3af23c","a0e019eb2b0c8aff5bf97889f30a3f13e61c0052289a79d00effd7b84177f4b0","cbec93c0d90829a9c3772722d69056616d3eddf13db6216f21f5b43c57282f40",+ "d1968b1284b2284691b15c3d7430df7c47b83b59703177a36f49d973ea24ff22","e616f74a6befffc7bb64c0e29b2d2caa37c51bc470bca96df70101c772429d83","e93264a83b5fd0a19b2f06a322b3a4ad92d418f6a968c1cd51f4bea79cbca4d9"],diff --git a/skills/skills.lock.json b/skills/skills.lock.jsonindex 9802cabb37..5190ed409f 100644--- a/skills/skills.lock.json+++ b/skills/skills.lock.json@@ -69,7 +69,7 @@"correction-pipeline/routing-eval.jsonl": "7f8d96606a8d7bed3d79fdcee6904764c8abb9fa0b506adb414b5c4805b69d0b","cron-scheduler/SKILL.md": "f336cd032ee61d88c40605ddfe884c91623b29bdfb20d78d6b2764f502c9a999","cross-modal-review/SKILL.md": "fc00a04e2ff9f498bee9b0b636bceba9dcfdc869c35d9a983109f408170f0807",- "daily-task-manager/SKILL.md": "8ea2f89afcdd3cc84e0dc01ed4b5f6f1bae8c525bf717063e14cd2e15c3af23c",+ "daily-task-manager/SKILL.md": "d1968b1284b2284691b15c3d7430df7c47b83b59703177a36f49d973ea24ff22","daily-task-manager/routing-eval.jsonl": "e98b2592e65c26952242436a960d8b2061e375b269004a18c230cbcf1d692ff9","daily-task-prep/SKILL.md": "5ea839012b48761ed8d7a9bab056a2566587d6f7fe044e3907d77b20f8eec5ac","data-loss-gate/SKILL.md": "8628ca47c450c8e4563565a1dfa264db8b909161c6bbb9b9a0ead124e4870dad",@@ -226,7 +226,7 @@"skillpack-check/SKILL.md": "0d2d2d201ed72e19b47d7e3743b5bbdfb5c2655d1f34d29447c601fca3908f9e","skillpack-harvest/SKILL.md": "0f86314b58d25b5511809f567c04aedc3fba6fe35ed642ac52d8216ae365b6eb","skillpack-harvest/routing-eval.jsonl": "cb4783288e95af3132b32ecb40a54cffc095f57b36240f96a25c2d2adf5e68c6",- "skills.lock.history.json": "a3b0e30e4415b6347d21dda7f87079953cb9b66ebcdaef0f42a450cd9a99c9b9",+ "skills.lock.history.json": "c3232c8135187a3452aa9d85c6fd052bdbf26c23ef7cb6871d6ef91e22367ed7","smoke-test/SKILL.md": "f5099e1d2ab9dc6827096249e68414f7ae357c29b39fb069a54bb7fb74f414a5","soul-audit/SKILL.md": "7a48e180849f7502d332878c443397f90a3756f45caa94f76bcfcc7c997469c8","strategic-reading/SKILL.md": "ab2cd3adc79289374cfbc5cb3d5ee17f962fd8f7f3c997a1da708da0ed67797c",diff --git a/test/daily-task-manager-slug-7932.test.ts b/test/daily-task-manager-slug-7932.test.tsindex a034d95aac..e22aada9f5 100644--- a/test/daily-task-manager-slug-7932.test.ts+++ b/test/daily-task-manager-slug-7932.test.ts@@ -5,6 +5,9 @@* skill's first-run rule could then start a second list at slug* `ops/tasks.md` that sync, `resolveTodayTasks()` and `gbrain get ops/tasks`* never read. Checked in the source skill and both generated copies.+ * Brains where the old skill already saved tasks at `ops/tasks.md` keep them:+ * the first-run rule carries that page's tasks over instead of starting an+ * empty list, and leaves the old page in place.*/import { describe, expect, test } from 'bun:test';import { readFileSync } from 'fs';@@ -26,6 +29,11 @@ describe('#7932: daily-task-manager page-tool calls use the slug ops/tasks', ()expect(text).toContain('put_page("ops/tasks"');expect(text).toContain('page: "ops/tasks"');expect(text).not.toMatch(/always `ops\/tasks\.md` \(with extension\) in tool calls/);+ for (const rule of text.split('\n').filter(l => l.includes('**First run:**'))) {+ expect(rule).toContain('`ops/tasks.md`');+ expect(rule).toContain('leave the old page in place');+ }+ expect(text.split('\n').filter(l => l.includes('**First run:**')).length).toBe(2);});}});