<feed xmlns='http://www.w3.org/2005/Atom'>
<title>soryu/makima/src/llm/contract_tools.rs, branch master</title>
<subtitle>soryu-co/soryu mirror</subtitle>
<id>http://src.eirin.xyz/soryu/atom?h=master</id>
<link rel='self' href='http://src.eirin.xyz/soryu/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/'/>
<updated>2026-05-17T20:23:20+00:00</updated>
<entry>
<title>chore: remove LLM module + all dependent surfaces (#135)</title>
<updated>2026-05-17T20:23:20+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-05-17T20:23:20+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=0d996cf7590e3e52f424859c7d6f0e68640f119e'/>
<id>urn:sha1:0d996cf7590e3e52f424859c7d6f0e68640f119e</id>
<content type='text'>
Wholesale removal of the LLM integration layer. ~14,200 LOC deleted
across backend and frontend. All chat-driven UIs go with it.

## Backend
- Delete `src/llm/` (7,400 LOC): claude/groq clients, contract_tools,
  contract_evaluator, discuss_tools, mesh_tools, phase_guidance,
  task_output, templates, markdown round-trip, tools, transcript_analyzer.
- Delete handlers wholly dependent on LLM:
  - `chat.rs` (file-level LLM chat at /files/{id}/chat)
  - `mesh_chat.rs` (mesh &amp; task LLM chat + history)
  - `templates.rs` (/contract-types listing)
- Strip LLM uses from `mesh_daemon.rs`:
  - `compute_action_directive` (used phase_guidance::check_deliverables_met
    to nudge supervisors with "all tasks done" messages). The auto-PR
    path below still fires when all tasks finish, so no behaviour lost.
  - `crate::llm::markdown_to_body` → inline 1-line replacement that
    wraps markdown content in a single BodyElement::Markdown. The
    editor re-parses on display, so round-trip is preserved.
- Drop routes: /files/{id}/chat, /mesh/chat, /mesh/chat/history,
  /mesh/tasks/{id}/chat, /contract-types.
- Drop the matching openapi registrations.

## Frontend
- Delete components that were LLM-only:
  - `mesh/UnifiedMeshChatInput.tsx`
  - `listen/DiscussContractModal.tsx`
  - `listen/TranscriptAnalysisPanel.tsx`
  - `listen/ContractPickerModal.tsx`
  - `files/CliInput.tsx`
- Delete the entire /listen page (its primary value-add was
  voice → LLM analysis → contract creation; without LLM the page is
  just a transcript display with no obvious user purpose).
- Delete `hooks/useMeshChatHistory.ts` and `lib/listenApi.ts`
  (transcript-analysis API client to the already-Phase-5-removed
  listen handlers).
- Strip api.ts of LLM exports: LlmModel, ChatMessage/Request/Response,
  UserQuestion/Answer, chatWithFile, MeshChat* types &amp; functions,
  getMeshChatHistory, clearMeshChatHistory, chatWithMeshContext,
  ContractTypeTemplate, listContractTypes, chatWithContract,
  getContractChatHistory, clearContractChatHistory, discussContract,
  PhaseDefinition, DeliverableDefinition.
- mesh.tsx: drop UnifiedMeshChatInput render + the chatContext memo +
  handleTaskUpdatedFromCli (only consumer was the input).
- files.tsx: drop CliInput render + handleGenerateFromElement +
  handleBodyUpdate + handleClearFocus + suggestedPrompt state (all
  CliInput-only).
- NavStrip: drop the /listen link.
- main.tsx: drop the /listen route.

## Net diff: 37 files changed, 58 insertions, 14,281 deletions.

Co-authored-by: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;</content>
</entry>
<entry>
<title>Add new directive mechanism v3</title>
<updated>2026-02-09T00:11:51+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-02-09T00:11:51+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=8c23b3ab6f7fabca01b0468911bae073aa5ced32'/>
<id>urn:sha1:8c23b3ab6f7fabca01b0468911bae073aa5ced32</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add makima directives</title>
<updated>2026-02-05T01:42:59+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-02-05T01:42:59+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=6a0c912a3fbd8e9b3e87ef40e960803d819d966d'/>
<id>urn:sha1:6a0c912a3fbd8e9b3e87ef40e960803d819d966d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add completion phases</title>
<updated>2026-01-26T20:19:30+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-01-26T20:19:30+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=04e1e8f0dd85d19917ac5ba0b73cba65ebac8976'/>
<id>urn:sha1:04e1e8f0dd85d19917ac5ba0b73cba65ebac8976</id>
<content type='text'>
</content>
</entry>
<entry>
<title>feat: Simplify contract deliverables and add Templates UI</title>
<updated>2026-01-24T20:06:28+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-01-24T20:06:28+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=6364363d1418728351f252b799d397b756e1f985'/>
<id>urn:sha1:6364363d1418728351f252b799d397b756e1f985</id>
<content type='text'>
## Backend Changes

### Phase Deliverables Simplified
- **Simple contract type**:
  - Plan phase: Only 'Plan' deliverable (required)
  - Execute phase: Only 'PR' deliverable (required)

- **Specification contract type**:
  - Research phase: Only 'Research Notes' deliverable (required)
  - Specify phase: Only 'Requirements Document' deliverable (required)
  - Plan phase: Only 'Plan' deliverable (required)
  - Execute phase: Only 'PR' deliverable (required)
  - Review phase: Only 'Release Notes' deliverable (required)

### New 'execute' Contract Type
- Only has 'execute' phase (no plan or review phases)
- NO deliverables at all - executes tasks directly
- Added to ContractType enum with proper Display/FromStr implementations
- Added helper methods: `initial_phase()`, `terminal_phase()`

### API Updates
- Added `get_phase_deliverables_for_type()` for contract-type-aware deliverables
- Added `get_phase_checklist_for_type()` for contract-type-aware checklists
- Added `check_phase_completion_for_type()` for contract-type-aware completion checks
- Added `check_deliverables_met()` function for deliverable validation
- Added `should_auto_progress()` for autonomous contract progression
- Added new ContractToolRequest::CheckDeliverablesMet tool

## Frontend Changes (makima/frontend)

### Templates Page
- Add TemplateEditor component for editing phase deliverables
- Create Templates page with template card grid layout
- Add navigation link in NavStrip
- Implement three built-in templates: Simple, Specification, Execute
- Support for creating custom templates with configurable phases/deliverables
- Templates are persisted to localStorage

Co-Authored-By: Claude Opus 4.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Use formatting in question in output</title>
<updated>2026-01-19T00:14:29+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-01-18T23:42:27+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=b64eddc8c2f250cdcbacae18cce107bf4c86f9f4'/>
<id>urn:sha1:b64eddc8c2f250cdcbacae18cce107bf4c86f9f4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add phase guard toggle for contract phase confirmation (#2)</title>
<updated>2026-01-17T19:47:35+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-01-17T19:47:35+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=900472091e4d9b4000508b0d266d786ef41107bd'/>
<id>urn:sha1:900472091e4d9b4000508b0d266d786ef41107bd</id>
<content type='text'>
* Add phase_guard field to Contract model and database

This adds a new boolean field to control whether the supervisor should
wait for user confirmation before progressing to the next phase. When
enabled, users can review and potentially amend phase outputs (like
plans, requirements docs) before the contract continues.

Changes:
- Add migration for phase_guard column (defaults to false)
- Add phase_guard to Contract, CreateContractRequest, and
  UpdateContractRequest structs
- Update create_contract_for_owner and update_contract_for_owner
  repository functions to handle phase_guard
- Update all CreateContractRequest instantiations with phase_guard field

Co-Authored-By: Claude Opus 4.5 &lt;noreply@anthropic.com&gt;

* feat: Add phase_guard for contract phase transitions

Implement phase_guard logic in the advance_phase tool. When a contract
has phase_guard enabled, the phase transition now:

1. Asks for user confirmation before advancing
2. Allows users to request changes to phase deliverables
3. Passes feedback to the task without advancing if changes requested

Changes:
- Add phase_guard field to Contract model and CreateContractRequest
- Add PhaseTransitionRequest, PhaseFileInfo, PhaseTaskInfo structs
- Update ChangePhaseRequest with confirmed and feedback fields
- Update ContractToolRequest::AdvancePhase with confirmed/feedback
- Modify advance_phase handling in contract_chat.rs with phase_guard logic
- Update change_phase endpoint in contracts.rs with phase_guard support
- Add database migration for phase_guard column

When phase_guard=false: Phase advances immediately (current behavior)
When phase_guard=true: Returns pending_confirmation status with deliverables
If user provides feedback: Returns feedback to task, doesn't advance

Co-Authored-By: Claude Opus 4.5 &lt;noreply@anthropic.com&gt;

* feat(frontend): Add UI for phase transition confirmation requests

When phase_guard is enabled and a supervisor tries to advance the contract
phase, users now see a confirmation modal with:
- Current and proposed next phase visualization
- Phase deliverables checklist (if available)
- Summary of the phase work
- Options to "Approve &amp; Advance" or "Request Changes" with feedback

Components added:
- PhaseConfirmationModal: Full modal dialog for phase confirmations
- PhaseConfirmationInline: Inline variant for task output view
- PhaseConfirmationNotification: Global notification wrapper
- PhaseConfirmationToast: Alternative toast-style notification

Integration:
- Added phase_confirmation message type to TaskOutput renderer
- Extended PendingQuestion API type with phase confirmation data
- Integrated notification into main app layout

The UI uses the existing supervisor question infrastructure (polling via
/api/v1/mesh/questions) and responds with APPROVE or CHANGES_REQUESTED
prefixed feedback.

Co-Authored-By: Claude Opus 4.5 &lt;noreply@anthropic.com&gt;

* feat(frontend): Add Phase Guard toggle to AutopilotPanel

Added the phase_guard toggle to the AutopilotPanel component, which allows
users to enable/disable requiring confirmation before phase transitions.

Changes:
- Added phaseGuard and autonomousLoop fields to Contract interface in api.ts
- Added phaseGuard field to UpdateContractRequest in api.ts
- Added Phase Guard toggle UI in AutopilotPanel with similar styling to master
- Toggle shows an 'active' badge when enabled
- Connected toggle to contract update API

The toggle appears below the autopilot control buttons and allows users to
require confirmation before the supervisor advances to the next phase.

Co-Authored-By: Claude Opus 4.5 &lt;noreply@anthropic.com&gt;

---------

Co-authored-by: Claude Opus 4.5 &lt;noreply@anthropic.com&gt;</content>
</entry>
<entry>
<title>feat(contract-tools): add transcript analysis tools for contract chat</title>
<updated>2026-01-15T01:30:02+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-01-14T21:43:36+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=eae8e698e89d7e5c8dc5bcdb2dcef61f25295515'/>
<id>urn:sha1:eae8e698e89d7e5c8dc5bcdb2dcef61f25295515</id>
<content type='text'>
Adds two new tools to contract_tools:
- analyze_transcript: Analyze a file's transcript and return structured results
- create_contract_from_transcript: Create a new contract from transcript analysis

These tools enable voice-to-contract workflows directly from the contract chat interface.

Co-Authored-By: Claude Opus 4.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title> Contract system</title>
<updated>2026-01-15T00:21:16+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-01-11T05:52:14+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=87044a747b47bd83249d61a45842c7f7b2eae56d'/>
<id>urn:sha1:87044a747b47bd83249d61a45842c7f7b2eae56d</id>
<content type='text'>
</content>
</entry>
</feed>
