Skip to content

feat(patcher): PatcherContext + PatchConversation + tmbx CLI (closes #117)#119

Open
hugolytics wants to merge 25 commits into
mainfrom
feature/timebox-patcher-cli
Open

feat(patcher): PatcherContext + PatchConversation + tmbx CLI (closes #117)#119
hugolytics wants to merge 25 commits into
mainfrom
feature/timebox-patcher-cli

Conversation

@hugolytics
Copy link
Copy Markdown
Collaborator

Summary

  • Replaces monolithic _PATCHER_SYSTEM_PROMPT / _build_context with PatcherContext Pydantic model — system_prompt() is cacheable per stage, user_message_text() is rebuilt per call
  • Adds ErrorFeedback model so the LLM gets all three states (original plan, attempted patch, partial result) on retry — it can patch-the-patch or rewrite from scratch
  • Adds PatchConversation for caller-owned multi-turn history; retries append to conversation rather than rebuilding a monolithic context string
  • Refactors TimeboxPatcher to own the retry loop using both; deletes dead _format_actions, _build_context, _to_log_string
  • Adds tmbx REPL CLI (load / patch / validate / submit / show / reset / quit) via fateforger.cli.patch; thin orchestrator — no LLM calls, no retry logic, no prompt strings

Test Plan

  • pytest tests/unit/test_patcher_context.py — 23 tests for ErrorFeedback, PatcherContext, PatchConversation
  • pytest tests/unit/test_patching.py — existing + 3 new tests verify PatcherContext delegation and multi-turn retry
  • pytest tests/unit/test_patch_cli.py — 6 tests for PatchSession
  • Full suite: pytest tests/unit/ -q — 1023 passed, 2 pre-existing failures (unrelated to this PR, in test_timeboxing_session_init_order and test_timeboxing_stage_actions)
  • tmbx --help shows expected usage after install

Architecture note

The CLI is deliberately thin: it holds PatchConversation, calls TimeboxPatcher.apply_patch(), and delegates everything else. The agent re-implementation (separate epic) will compose these same components programmatically.

🤖 Generated with Claude Code

hugocool and others added 25 commits March 10, 2026 17:31
- Added a new implementation plan for aligning VS Code Slack bot debug configurations with the Graphiti+Neo4j stack.
- Created a new Docker Compose file to define the necessary services including `calendar-mcp`, `neo4j`, and `graphiti-mcp`.
- Introduced a script to manage the local debug infrastructure for the Slack bot.
- Developed a new module for shared durable constraint memory contract.
- Added VS Code tasks for starting the development server.
- Implemented unit tests for the Graphiti constraint memory client and the VS Code debug stack.
…nical routine constraints

Adds one-time migration script that sets frame_slot, is_startup_prefetch,
and aspect_id in the hints.aspect_classification JSON for existing PROFILE/
DATESPAN constraints so the scheduler treats them as protected daily anchors.
Ran against live DB — updated 45 rows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers PatcherContext, PatchConversation, TimeboxPatcher refactor,
and fateforger patch CLI. Refs #117.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PatcherContext/ErrorFeedback/PatchConversation, TimeboxPatcher refactor,
and fateforger patch REPL CLI. Refs #117.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tion for multi-turn retries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… minor cleanup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…v template

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants