xonecas.io
64875
Mc

mini-coder / commit cf00575

docs: update AGENTS.md and TODO.md to reflect current state

- Mark Phase 4a complete (input.ts, theme.ts), add phase notes
- Update test count to 158 across 9 files
- Remove stale Phase 3 references from readImage testing strategy
- Replace aspirational compaction test claim with actual test coverage
- Add Theme section to testing strategy
- Add context limit compaction as explicit Phase 4d task

xonecas2026-04-05 cf00575ee4af16f1b243721b436abb2287ec8060 parent d0a9f8e

2 files changed

AGENTS.md+13−7
@@ -48,12 +48,12 @@
4848
4949 We test our logic at the boundaries. Never test dependencies (pi-ai, cel-tui, bun:sqlite). Never use mocks or stubs.
5050
51-**Tools** (`tools.ts` — `shell`, `edit`; `readImage` deferred to Phase 3):
51+**Tools** (`tools.ts` — `shell`, `edit`, `readImage`):
5252
5353 - `edit`: exact-text match/replace, multi-match failure, missing text failure, new file creation, parent dir creation, existing-file guard, line ending preservation (LF/CRLF), UTF-8 handling, relative/absolute path resolution.
5454 - `shell`: stdout/stderr capture, exit code passthrough, output truncation (head + tail with marker), abort signal, cwd propagation.
5555 - `truncateOutput`: pure function — within limit, head+tail+marker, no overlap, empty/single-line/exact-limit edge cases.
56-- `readImage` (Phase 3): base64 encoding, mime type detection, unsupported format rejection, missing file handling.
56+- `readImage`: base64 encoding, mime type detection, unsupported format rejection, missing file handling, relative/absolute path resolution.
5757
5858 **Git** (`git.ts`):
5959
@@ -83,10 +83,16 @@ We test our logic at the boundaries. Never test dependencies (pi-ai, cel-tui, bu
8383 **Agent loop** (`agent.ts`):
8484
8585 - Use pi-ai's `faux` provider for end-to-end loop tests.
86-- Verify: tool calls are executed, messages are appended in correct order, turns are numbered, interrupt preserves partial response, context limit triggers compaction.
86+- Verify: tool calls are executed, messages are appended in correct order, turns are numbered, interrupt preserves partial response, error handling, unknown tool self-correction, length stop reason.
8787
88-**Input parsing**:
88+**Input parsing** (`input.ts`):
8989
90-- `/skill:name rest of message` → skill body + "rest of message".
91-- `/command` detection and routing.
92-- Image path detection (entire input is an image path that exists and has a valid extension).
90+- `/command` detection and routing (all 11 commands, case-sensitive, unknown commands fall through).
91+- `/skill:name rest of message` → skill name + user text extraction.
92+- Image path detection (entire input is an existing image path with valid extension, requires `supportsImages` opt-in).
93+- Priority ordering: commands > skills > images > plain text.
94+
95+**Theme** (`theme.ts`):
96+
97+- Default theme has all required keys (9 terminal palette colors).
98+- `mergeThemes` applies partial overrides left-to-right without mutating the base.
TODO.md+9−2
@@ -55,11 +55,17 @@
5555
5656 ### 4a — Input parsing (TDD, no UI)
5757
58-- [ ] `input.ts` — pure logic for parsing user input:
58+- [x] `input.ts` — pure logic for parsing user input:
5959 - `/command` detection and routing (extract command name + args)
6060 - `/skill:name rest of message` → skill body + user text
6161 - Image path detection (entire input is an existing image path with valid extension)
62-- [ ] `input.test.ts` — tests for all parsing cases
62+- [x] `input.test.ts` — 30 tests: command detection (6), skill references (6), image paths (12), plain text (4), priority (2)
63+
64+### Notes from Phase 4a
65+
66+- `input.ts` exports: `COMMANDS` (const tuple), `Command` type, `ParsedInput` discriminated union, `ParseInputOpts`, `parseInput(raw, opts?)`. Pure logic — no IO beyond `existsSync` for image path validation.
67+- `theme.ts` (also implemented here): `Theme` interface, `DEFAULT_THEME`, `mergeThemes(base, ...overrides)`. Uses terminal palette colors (`color01`–`color08`) for automatic light/dark adaptation. 5 tests in `theme.test.ts`.
68+- 158 tests total across 9 files (session: 20, tools: 36, git: 10, skills: 14, prompt: 21, agent: 12, plugins: 10, input: 30, theme: 5).
6369
6470 ### 4b — App shell (running app, no commands)
6571
@@ -89,6 +95,7 @@
8995 - [ ] `/skill:name` input handling (strip prefix, prepend skill body)
9096 - [ ] Image embedding (entire input is image path → embed as ImageContent)
9197 - [ ] Conditional `readImage` tool registration (only for vision-capable models, re-evaluated on `/model`)
98+- [ ] Context limit compaction (threshold detection, model-generated summary, prompt cache preservation)
9299
93100 ## Future ideas