diff --git a/TODO.md b/TODO.md index 7ce22cb..f441f5f 100644 --- a/TODO.md +++ b/TODO.md @@ -2,6 +2,11 @@ ## Active tickets +- [ ] [`ticket-033`](project/ticket-033/README.md) — restore communication LLM + prompt resolution after its helper moved one directory deeper. Current + state: `IN_PROGRESS / VALIDATION`; focused tests pass and both targeted + failures are removed, with no test or prompt-content changes. + - [ ] [`ticket-019`](project/ticket-019/README.md) — publish the dependency-free Python SDK as the root PyPI distribution `todo2code` through `goal -a`, with one root `pyproject.toml` and SDK-only artifacts. Current state: diff --git a/project/TICKETS.md b/project/TICKETS.md index 071ccc8..a7788bc 100644 --- a/project/TICKETS.md +++ b/project/TICKETS.md @@ -27,4 +27,5 @@ of `project/README.md`, which remains a generated technical-analysis artifact. | **ticket-019** | [`README.md`](./ticket-019/README.md) | [`preprompt.md`](./ticket-019/preprompt.md) | - | [`ai-codex.md`](./ticket-019/ai-codex.md) | [`ai-codex-logs.txt`](./ticket-019/ai-codex-logs.txt) | [`changelog.md`](./ticket-019/changelog.md) | | **ticket-020** | [`README.md`](./ticket-020/README.md) | [`preprompt.md`](./ticket-020/preprompt.md) | - | [`ai-codex.md`](./ticket-020/ai-codex.md) | [`ai-codex-logs.txt`](./ticket-020/ai-codex-logs.txt) | [`changelog.md`](./ticket-020/changelog.md) | | **ticket-022** | [`README.md`](./ticket-022/README.md) | [`preprompt.md`](./ticket-022/preprompt.md) | - | [`ai-codex.md`](./ticket-022/ai-codex.md) | [`ai-codex-logs.txt`](./ticket-022/ai-codex-logs.txt) | [`changelog.md`](./ticket-022/changelog.md) | +| **ticket-033** | [`README.md`](./ticket-033/README.md) | [`preprompt.md`](./ticket-033/preprompt.md) | - | [`ai-codex.md`](./ticket-033/ai-codex.md) | [`ai-codex-logs.txt`](./ticket-033/ai-codex-logs.txt) | [`changelog.md`](./ticket-033/changelog.md) | diff --git a/project/ticket-033/README.md b/project/ticket-033/README.md new file mode 100644 index 0000000..a3e72b3 --- /dev/null +++ b/project/ticket-033/README.md @@ -0,0 +1,63 @@ +# Ticket 033: Restore communication prompt resolution after module split + +- **ID**: ticket-033 +- **Owner**: unresolved:human +- **Status**: IN_PROGRESS +- **Workflow state**: VALIDATION +- **Created**: 2026-08-04 + +## Goal and scope + +Restore runtime resolution of `communication-to-intent.system.md` after the +communication LLM implementation moved one directory deeper. The copied path +logic still climbs three levels, which resolves from +`dist/src/communication/llm` to `dist/prompts`; repository prompts live at the +root `prompts` directory, requiring four levels from the compiled helper. + +The repair changes only the relative prompt root in the helper. It will not +copy prompts into `dist`, change provider fallback behavior, weaken +`require-llm`, edit tests or contact a live provider. One production file is +allowed and expected implementation time is under 30 minutes. + +## Planned changed paths + +- `src/communication/llm/implementation-helpers.ts`: correct the prompt root + for the module's new filesystem depth. +- `project/ticket-033/**`, `TODO.md`, `project/TICKETS.md`: intent and evidence. + +## Acceptance criteria + +- [x] AC-01: Scope is approved by a human owner. +- [x] AC-02: The communication prompt resolves from both compiled test/runtime + execution without relying on stale artifacts. +- [x] AC-03: Both audited communication enrichment tests pass using their + mocked provider and no live request. +- [x] AC-04: `require-llm` and correction validation behavior remain strict. +- [x] AC-05: Clean build, focused/full tests, diff scope and governance evidence + are recorded without changing tests or prompt contents. + +## Participants + +- Human participant: unresolved; no user-* file was created by this script. +- Agent participant: [ai-codex.md](ai-codex.md) + +## Approval boundary + +- Current state: `IN_PROGRESS / VALIDATION` after implementing and testing the + bounded repair. +- Chat approval authorizes this interactive implementation only; trusted merge + evidence must remain independent and bound to the final SHA. + +## Validation evidence + +- `npm run build`: PASS. +- Focused communication LLM suite: 3 passed, 0 failed; mocked provider only. +- Full fresh suite on isolated base: 338 tests, 328 passed, 9 failed and one + skipped. Both prompt failures are removed. The remaining failures correspond + exactly to independent tickets 030, 031 and 032. +- `git diff --check`: PASS. +- `make governance`: only four inherited ticket-018/ticket-019 diagnostics; + no ticket-033 scope or workstream finding. +- Ephemeral integration of implementation commits `9c25942`, `bbd236f`, + `c5db5fb` and `f96c0a8` over base `caf6551`: clean build PASS; full suite + 338 tests, 337 passed, 0 failed and one environment-dependent JDK skip. diff --git a/project/ticket-033/ai-codex-logs.txt b/project/ticket-033/ai-codex-logs.txt new file mode 100644 index 0000000..303e0dc --- /dev/null +++ b/project/ticket-033/ai-codex-logs.txt @@ -0,0 +1,14 @@ +2026-08-04 planning +- Fresh base `caf6551`: two communication LLM tests fail because the split + helper resolves the prompt under nonexistent `dist/prompts`. +- No production source edited; state remains `WAIT_FOR_APPROVAL`. +- Human response `kontynuuj` authorized ticket-033; transitioned to + `IN_PROGRESS / EDIT`. +- `npm run build`: PASS. +- `node --test dist/test/communication-llm.test.js`: PASS (3/3), mocked provider. +- Fresh full suite: 338 total, 328 pass, 9 fail, 1 skip; both ticket-033 prompt + failures removed, remaining failures belong to tickets 030/031/032. +- `git diff --check`: PASS. +- `make governance`: four inherited ticket-018/ticket-019 errors, no ticket-033 finding. +- Combined implementation-only integration on `caf6551`: build PASS; full suite + PASS (338 total, 337 pass, 0 fail, 1 JDK skip). diff --git a/project/ticket-033/ai-codex.md b/project/ticket-033/ai-codex.md new file mode 100644 index 0000000..eb71c88 --- /dev/null +++ b/project/ticket-033/ai-codex.md @@ -0,0 +1,45 @@ +--- +participant-id: agent:codex +participant: codex +role: agent +ticket: ticket-033 +--- +# Participant: codex (AI agent) + +## Understanding + +The old implementation lived at `src/communication/llm.ts`; its compiled +module needed three parent traversals to reach repository-root `prompts`. +`loadCommunicationPrompt` now lives in +`src/communication/llm/implementation-helpers.ts`, one directory deeper, but +retained the old traversal. The error therefore names nonexistent +`dist/prompts/communication-to-intent.system.md`. This explains exactly two +tests and does not indicate provider or schema failure. + +## Execution plan + +1. Wait for explicit human approval before editing source. +2. Correct the relative prompt root by one directory in the owning helper. +3. Run build and focused communication LLM tests with their mocked provider. +4. Run the full fresh suite and verify both prompt failures disappear. +5. Record diff/scope and governance evidence; do not change tests or prompts. + +## Actual changes + +- The human explicitly approved ticket-033 by replying `kontynuuj`; the + interactive implementation may enter `EDIT`. +- Corrected the prompt traversal by one directory in the owning helper. No + prompt content, provider behavior, schema or test changed. +- Clean build and all three focused communication LLM tests pass, including + correction retry and strict require-mode behavior. The isolated full suite + no longer contains either prompt-resolution failure. +- Verified the four sibling implementation commits together in a detached, + uncommitted integration worktree: build passes and all 337 runnable tests + pass. This is test evidence, not merge approval. + +## Blockers + +- Tickets 030, 031 and 032 remain independent sibling repairs and are not + absorbed into this diff. +- Four inherited ticket-018/ticket-019 governance errors remain outside scope. +- Trusted merge approval for the final head SHA is still required. diff --git a/project/ticket-033/changelog.md b/project/ticket-033/changelog.md new file mode 100644 index 0000000..f9137c1 --- /dev/null +++ b/project/ticket-033/changelog.md @@ -0,0 +1,18 @@ +# Ticket Changelog (ticket-033) + +## [0.1.0] - 2026-08-04 + +- Initial governance scaffold created. +- No human participant identity or content was generated. +- Renumbered the unpublished scaffold from 023 to 033 because remote PR #3 + already owns ticket-023. +- Documented the bounded prompt-resolution regression repair. + +## [0.2.0] - 2026-08-04 + +- Corrected communication prompt resolution for the helper's post-refactor + directory depth without changing prompt contents or LLM policy. +- Focused communication LLM tests pass 3/3 and the two targeted full-suite + failures are removed. +- Combined tickets 030-033 implementation verification passes all 337 runnable + tests on a clean build. diff --git a/project/ticket-033/intent.json b/project/ticket-033/intent.json new file mode 100644 index 0000000..ef068c4 --- /dev/null +++ b/project/ticket-033/intent.json @@ -0,0 +1,17 @@ +{ + "schema": "new-project.intent/v2", + "ticket": "ticket-033", + "summary": "Restore communication prompt resolution after module split", + "workstream": "interfaces", + "allowedPaths": [ + "src/communication/llm/implementation-helpers.ts", + "project/ticket-033/**", + "TODO.md", + "project/TICKETS.md" + ], + "forbiddenPaths": ["project/ticket-*/user-*.md"], + "stacks": ["node"], + "dependsOn": [], + "conflictsWith": [], + "integrationTicket": null +} diff --git a/project/ticket-033/preprompt.md b/project/ticket-033/preprompt.md new file mode 100644 index 0000000..c355298 --- /dev/null +++ b/project/ticket-033/preprompt.md @@ -0,0 +1,8 @@ +# Ticket preprompt + +- **Task ID**: ticket-033 +- **Task title**: Restore communication prompt resolution after module split +- **Created**: 2026-08-04T12:22:18Z + +Keep executable implementation outside this governance/evidence directory. +Read a human-owned user-*.md file only when one exists. diff --git a/src/communication/llm/implementation-helpers.ts b/src/communication/llm/implementation-helpers.ts index b139af3..7a0cb06 100644 --- a/src/communication/llm/implementation-helpers.ts +++ b/src/communication/llm/implementation-helpers.ts @@ -297,7 +297,7 @@ export function audit( } export async function readPrompt(): Promise { - const promptPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../prompts', 'communication-to-intent.system.md'); + const promptPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../prompts', 'communication-to-intent.system.md'); if (!(await pathExists(promptPath))) throw new Error(`Prompt not found: ${promptPath}`); return fs.readFile(promptPath, 'utf8'); }