Implement the work orchestrator commands - #5
Merged
Conversation
Work state is zod-validated JSON mutated only through the CLI; the log is append-only JSON lines; config changes flow into instruction blocks via tod sync. All mutations are atomic and idempotence is reported. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Milestone 4 of the v0.1 plan: the deterministic commands agents use to track the operator's work, completing the v0.1 command surface.
Changes
src/work.ts): zod-validated~/.tod/work.jsonholding projects, features, bugs, and tasks with ids and parent links. Pure state-transition functions (addItem,setStatus) keep mutations testable; saves go through the atomic boundary-checked write layer. Malformed state stops every command with a what/why/fix error and no changes.tod work(src/commands/work.ts):add(with--project,--kind,--parent),done(multiple ids, idempotent with explicit "unchanged" reporting),status, andlist. Projects come into existence the first time work is recorded against them; there is no registration step.tod log(src/commands/log.ts): append-only timestamped JSON lines, the one write that intentionally skips temp-file-plus-rename because a rename would rewrite history.tod config(src/commands/config.ts):get/setover the communication dimensions with values validated against the schema;setreminds the agent to runtod syncso blocks pick up the change.tod status(src/commands/status.ts): operator-facing in-flight report across projects, hiding done items unless--all.tests/orchestrator.test.ts): end-to-end runs against fake homes covering the add/list/done/status flow, idempotence, unknown-id and malformed-state failures, log append behaviour, and the config-set-then-sync render pipeline.Why
This is the deterministic half of the harness contract: the instruction block tells agents to record work through these commands instead of interpreting file formats, so the commands carry the validation, atomicity, and guidance that make that rule safe to follow.
🤖 Generated with Claude Code