Repository navigation
feat(plan): archive an imported task's file to plan/imported/, stamped with its card - #18
Merged
Merged
Conversation
…d with its card A card's status is never written back into its source file (the file is a draft, the board is authoritative once a card exists) — so once a plan task lands a card, its file moves from plan/tasks/ to plan/imported/ instead of staying in plan/tasks/ looking like an open proposal. Why location, not just a status field: during a room turn a bot has no list_tasks tool (only a queued background task gets _ccs_task_manager), so the board is not something it can check from inside a room — the file's location is the only cheap, reliable "already done" signal available there. ROOM_RULES now says so explicitly for every participant. - plan-lib.js: stampImported (pure) inserts imported_card/imported_at into a file's front matter, given a card id and timestamp. - plan-import.js: archivePlanFiles (fs-injectable) moves each entry from plan/tasks/ to plan/imported/, stamped; one file's failure is reported and does not stop the rest. - server.js: applyPlanImport (now async) archives only tasks that actually landed a card this run (toCreate always; a toUpdate whose card was deleted from under us does not) — a SKIPPED task (not selected, or blocked by an unselected dependency) never loses its only copy. Runs strictly after the board transaction commits; a failed archive is logged and reported (archived/archiveErrors) but never fails or undoes the import itself. Committed via room-git.js the same way a room's own changes are (ROOM_GIT=off disables it here too). Tests: plan-lib (59), plan-import (31, fake fs incl. a missing file reported without stopping the rest), plans-api (24, real server + real files: archived files actually gone from plan/tasks/ and present in plan/imported/ stamped with the REAL card id; re-import only reviews a task whose file is back; the dependent-skip case now also asserts the skipped files are untouched on disk). Whole npm test suite green. docs/plan-kanban-import.md. Not verified: a live room run reading plan/imported/ and acting on the new rule. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2ZSHUdJHqVsvSNQ5ZeQ3f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #17. A card's status is never written back into its source file (the file is a draft, the board is authoritative once a card exists) — so once a plan task lands a card, its file moves from
plan/tasks/toplan/imported/instead of sitting there still looking like an open proposal.Why location, not a status field
During a room turn a bot has no
list_taskstool (only a queued background task gets_ccs_task_manager), so the board is not something it can check from inside a room — the file's location is the only cheap, reliable "already done" signal available there.ROOM_RULESnow says so explicitly for every participant.What
plan-lib.js:stampImported(pure) — insertsimported_card/imported_atinto a file's front matter.plan-import.js:archivePlanFiles(fs-injectable) — moves each entryplan/tasks/→plan/imported/, stamped; one file's failure is reported and does not stop the rest.server.js:applyPlanImport(now async) archives only tasks that actually landed a card this run — a skipped task (not selected, or blocked by an unselected dependency) never loses its only copy; atoUpdatewhose card was deleted from under us is not archived either. Runs strictly after the board transaction commits; a failed archive is logged and reported (archived/archiveErrors) but never fails or undoes the import itself. Committed viaroom-git.jsthe same way a room's own changes are.Tests
plan-lib59,plan-import31 (fake fs, incl. a missing file reported without stopping the rest),plans-api24 (real server + real files: archived files actually gone fromplan/tasks/and present inplan/imported/stamped with the real card id; re-import only reviews a task whose file is back; the dependent-skip case now also asserts the skipped files are untouched on disk). Wholenpm testsuite green.docs/plan-kanban-import.md.Not verified
A live room run reading
plan/imported/and acting on the new rule.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y2ZSHUdJHqVsvSNQ5ZeQ3f