| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Redesigns the chain system with a directive-first architecture where
Directive is the top-level entity (the "why/what") and Chains are
generated execution plans (the "how") that can be dynamically modified.
Backend:
- Add database migration for directive system tables
- Add Directive, DirectiveChain, ChainStep, DirectiveEvent models
- Add DirectiveVerifier and DirectiveApproval models
- Add orchestration module with engine, planner, and verifier
- Add comprehensive API handlers for directives
- Add daemon CLI commands for directive management
- Add directive skill documentation
- Integrate contract completion with directive engine
- Add SSE endpoint for real-time directive events
Frontend:
- Add directives route with split-view layout
- Add 6-tab detail view (Overview, Chain, Events, Evaluations, Approvals, Verifiers)
- Add React Flow DAG visualization for chain steps
- Add SSE subscription hook for real-time event updates
- Add useDirectives and useDirectiveEventSubscription hooks
- Add directive types and API functions
Fixes:
- Fix test failures in ws/protocol, task_output, completion_gate, patch
- Fix word boundary matching in looks_like_task()
- Fix parse_last() to find actual last completion gate
- Fix create_export_patch when merge-base equals HEAD
- Clean up clippy warnings in new code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Update CreateChainModal to include repository input fields
- Add repository suggestions from history using getRepositorySuggestions
- Support both remote (URL) and local (path) repositories
- First repository added becomes primary automatically
- Pass repositories to CreateChainRequest
Also includes backend changes:
- Copy chain repositories to contracts when created from definitions
- Add created_at field to ChainContractDetail
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Chains can now have multiple repositories attached, with one marked as
primary. Repositories are used by contracts created from chain definitions.
Backend changes:
- Add chain_repositories table migration
- Add ChainRepository model with CRUD operations
- Add API endpoints for listing, adding, deleting repositories
- Add endpoint to set a repository as primary
- Update Chain and ChainEditorData models to use repositories
- Update chain parser to support repositories in YAML format
- Remove deprecated repository_url/local_path from Chain
Frontend changes:
- Add ChainRepository interface and API functions
- Add repository section to ChainEditor showing attached repos
- Add modal for adding new repositories (remote or local)
- Support setting primary repository and removing repositories
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
| |
- Install @xyflow/react for smooth node-based UI
- Create custom DefinitionNode and ContractNode components
- Use React Flow's built-in drag-and-drop, edge drawing, pan/zoom
- Removes laggy custom implementation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
- Fix drag lag by disabling CSS transitions during drag
- Add canvas right-click context menu to create definitions at position
- Auto-find free grid space for new definitions to avoid overlap
- Fix startChain API to send empty JSON body (backend expects JSON)
- Add PlusIcon for context menu
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
| |
- Add drag-and-drop to reposition definition nodes
- Add edge drawing from connector dot to create dependencies
- Add right-click context menu with delete and dependency management
- Show visual hints in footer for available interactions
- Update node positions and dependencies via API on change
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Chains no longer spawn a supervisor task. Checkpoint contracts will be
automatically run as part of the DAG execution when dependencies complete.
- Remove supervisor task creation from start_chain handler
- Remove chain supervisor CLI commands
- Remove supervisor_task_id from StartChainResponse
- Remove withSupervisor option from frontend
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Also remove all other TTS models
|
| | |
|
| | |
|
| |\
| |
| | |
feat: Implement Phase 3 - Supervisor Resilience and State Management
|
| | |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Add SupervisorStatusResponse for status endpoint
- Add SupervisorHeartbeatEntry and history response types
- Add SupervisorSyncResponse for sync endpoint
- Add HeartbeatHistoryQuery for pagination
- Resolve merge conflict keeping both API types and unit tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Implement REST API endpoints for querying supervisor status:
- GET /api/v1/contracts/{id}/supervisor/status
Returns current supervisor status including task_id, state, phase,
current_activity, progress, last_heartbeat, and pending_task_ids
- GET /api/v1/contracts/{id}/supervisor/heartbeats?limit=10
Returns paginated supervisor activity history from history_events
- POST /api/v1/contracts/{id}/supervisor/sync
Triggers a sync to refresh the supervisor's last_activity timestamp
New types added:
- SupervisorStatusResponse - Status endpoint response
- SupervisorHeartbeatEntry - Individual heartbeat history entry
- SupervisorHeartbeatHistoryResponse - Heartbeat history with pagination
- SupervisorSyncResponse - Sync endpoint response
- HeartbeatHistoryQuery - Query params for heartbeats endpoint
Repository helpers:
- get_supervisor_status() - Combined info from supervisor_states and tasks
- get_supervisor_activity_history() - Activity timeline from history_events
- count_supervisor_activity_history() - Total count for pagination
- sync_supervisor_state() - Refresh last_activity timestamp
Error handling:
- 404 for contract not found (CONTRACT_NOT_FOUND)
- 404 for no supervisor (SUPERVISOR_NOT_FOUND)
- Proper fallback when supervisor_state record doesn't exist but task does
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Restoration
Task 3.3: Supervisor State Persistence
- Add migration 20260201000001_enhanced_supervisor_state.sql with new columns:
- state (supervisor state enum)
- current_activity (description)
- progress (0-100)
- error_message (for failed states)
- spawned_task_ids (tasks created by supervisor)
- pending_questions (questions awaiting user response)
- restoration_count, last_restored_at, restoration_source (restoration tracking)
- Update SupervisorState model with new fields
- Add PendingQuestion struct for tracking unanswered questions
- Add SupervisorRestorationContext for returning restoration info
- Add StateValidationResult and StateRecoveryAction for state validation
State persistence functions in repository.rs:
- update_supervisor_detailed_state() - Update state, activity, progress
- add_supervisor_spawned_task() - Track spawned tasks
- add_supervisor_pending_question() - Track pending questions
- remove_supervisor_pending_question() - Clear answered questions
- save_supervisor_state_full() - Full state save (UPSERT)
- mark_supervisor_restored() - Increment restoration count
- get_supervisors_with_pending_questions() - Find supervisors with pending questions
- get_supervisor_state_for_restoration() - Load state for restoration
- validate_spawned_tasks() - Validate task consistency
- update_supervisor_phase() - Update on phase change
- update_supervisor_heartbeat_state() - Lightweight heartbeat update
State save points:
- On task spawn (save_state_on_task_spawn)
- On question asked (save_state_on_question_asked)
- On question answered (clear_pending_question)
- On phase change (save_state_on_phase_change)
- On heartbeat (update_supervisor_heartbeat_state)
Task 3.4: Supervisor Restoration Protocol
- Add restoration detection when supervisor starts with existing state
- Implement validate_supervisor_state() for state consistency checks
- Implement restore_supervisor() with validation and context generation
- Add redeliver_pending_questions() for re-delivering questions after crash
- Add generate_restoration_context_message() for Claude context injection
- Update resume_supervisor endpoint to return RestorationInfo
- Re-deliver pending questions when supervisor resumes
Restoration flow:
1. Daemon restarts or task reassigned
2. Load supervisor state from supervisor_states
3. If NOT FOUND: Start fresh, log warning
4. If FOUND: Validate state consistency
5. If INVALID: Start from last checkpoint
6. If VALID: Restore conversation history
7. Check for pending questions - re-deliver to user
8. Check for waiting tasks - resume waiting state
9. Send restoration context to Claude
10. Resume execution from last state
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Heartbeat Infrastructure
Task 3.1: Enhanced Supervisor State Enum
- Add SupervisorStateEnum with states: Initializing, Idle, Working, WaitingForUser,
WaitingForTasks, Blocked, Completed, Failed, Interrupted
- Implement Display, FromStr, Default, and serde serialization
- Add SupervisorHeartbeatRecord and SupervisorHeartbeatRequest structs
Task 3.2: Heartbeat Infrastructure
- Create supervisor_heartbeats migration with proper indexes and constraints
- Add heartbeat storage functions to repository.rs:
- create_supervisor_heartbeat
- get_latest_supervisor_heartbeat
- get_supervisor_heartbeats
- get_contract_supervisor_heartbeats
- cleanup_old_heartbeats (24 hour TTL support)
- find_stale_supervisors (for dead supervisor detection)
- Add SupervisorHeartbeat message to protocol.rs with enhanced fields
- Update mesh_daemon.rs to process and store supervisor heartbeats
- Add unit tests for SupervisorStateEnum and heartbeat serialization
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
Previously the supervisor would implement only the first phase of a
multi-phase plan and then create a PR. This change updates the supervisor
system prompt to explicitly instruct it to:
1. Read and parse plan documents for multiple implementation phases
2. Execute phases sequentially
3. Track completion of each phase
4. Only create PR after ALL phases are complete
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add docs/contract-management-spec.md with full system design
- Add docs/plans/implementation-plan.md with 5-phase rollout plan
- Add validate_deliverable() function and use in mark_deliverable_complete
- Add PhaseChangeResult enum and change_contract_phase_with_version() with FOR UPDATE locking
- Enforce phase_guard at API level for all callers
This addresses critical issues in contract management:
- Deliverable validation to prevent marking non-existent deliverables complete
- Version conflict detection for phase changes with row locking
- Phase guard enforcement at API level (applies to all callers including supervisors)
- Comprehensive specification and implementation plan for future phases
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous code used `.unwrap_or_default()` which could produce
`Some(Value::Null)` if JSON serialization failed, leading to
inconsistent handling when the database returned NULL and sqlx
attempted to decode with the `#[sqlx(json)]` attribute on an Option type.
Changed to use `.ok()` which properly returns `None` when serialization
fails, ensuring consistent NULL handling between the application and
database layer.
Fixes: "Failed to create template: error occurred while decoding column
'deliverables': unexpected null; try decoding as an Option"
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When local_only=true on a contract, all completion actions are skipped.
This adds a new option auto_merge_local that, when enabled along with
local_only, will automatically merge completed task changes to the
master/main branch locally (without pushing or creating PRs).
Changes:
- Add auto_merge_local column to contracts table (migration)
- Add auto_merge_local field to Contract model and summary
- Update CreateContractRequest and UpdateContractRequest structs
- Update contract repository create/update functions
- Add auto_merge_local to WebSocket protocol StartTask command
- Pass auto_merge_local through spawn_task and run_task functions
- Modify task manager completion logic: if local_only=true AND
auto_merge_local=true, execute 'merge' completion action locally
- Update all server handlers to retrieve and pass auto_merge_local
- Add TypeScript types to frontend components
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The HuggingFace model uses different tensor name prefixes:
- talker.model.text_embedding instead of model.embed_tokens
- talker.codec_head instead of lm_head
- talker.code_predictor.model.codec_embedding instead of code_embeddings
- talker.code_predictor.lm_head instead of output_heads
Also removed input_proj which doesn't exist in the HF model.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Red Team toggle was implemented in the frontend but not visible because
the backend API's ContractSummary response struct was missing the
red_team_enabled field. The frontend relies on this field to:
1. Show the red team badge in the contract list view
2. Show the red team badge and tab in the contract detail view
Changes:
- Add red_team_enabled field to ContractSummary struct in models.rs
- Update list_contracts_for_owner SQL query to include red_team_enabled
- Update get_contract_summary_for_owner SQL query to include red_team_enabled
- Update all fallback ContractSummary constructions in contracts.rs handler
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add comprehensive Red Team system specification
Defines the adversarial review feature for contracts that monitors work tasks
in real-time to catch quality issues, plan deviations, and standards violations.
Key components specified:
- Contract configuration (red_team_enabled, red_team_prompt)
- Red team task lifecycle and spawning logic
- makima red-team notify CLI command for supervisor alerts
- Task output subscription for real-time monitoring
- Database schema changes (contracts, tasks, notifications table)
- API endpoints for notification and status
- System prompt template for red team behavior
- Security considerations and access control
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Task completion checkpoint
* Task completion checkpoint
* Task completion checkpoint
* feat: fetch from origin for local repos before creating worktrees
When a supervisor creates worktrees from a local repository that tracks
a remote origin, it may use stale data. This change ensures that for
local repositories with an origin remote configured, we explicitly
fetch from origin before creating worktrees.
Changes:
- Check if 'origin' remote exists using `git remote get-url origin`
- If origin exists, fetch from it with `git fetch origin`
- Log appropriately whether it's a remote-backed or local-only repository
- Keep the behavior non-fatal (don't fail if fetch fails, just log)
- Keep existing `git fetch --all --prune` as fallback for other remotes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add comprehensive Red Team system specification
Defines the adversarial review feature for contracts that monitors work tasks
in real-time to catch quality issues, plan deviations, and standards violations.
Key components specified:
- Contract configuration (red_team_enabled, red_team_prompt)
- Red team task lifecycle and spawning logic
- makima red-team notify CLI command for supervisor alerts
- Task output subscription for real-time monitoring
- Database schema changes (contracts, tasks, notifications table)
- API endpoints for notification and status
- System prompt template for red team behavior
- Security considerations and access control
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Task completion checkpoint
* Task completion checkpoint
* Task completion checkpoint
* Fix new contract dialog not fitting on screen
Added viewport-relative constraints to the create contract modal:
- max-height: 90vh to limit dialog height to 90% of viewport
- overflow-y: auto to enable scrolling when content overflows
- padding on the backdrop container for edge margins on small screens
This ensures the dialog is accessible on all screen sizes while
maintaining scrollability for longer content.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* chore: fix unused import warnings in qwen3-tts module
- Remove unused import 'IndexOp' in model.rs
- Remove unused import 'DType' in speech_tokenizer.rs
- Add #[allow(dead_code)] to codebook_dim field in RvqCodebook
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add voice loading and selection for TTS cloning
Add voice reference audio loading so the TTS speak handler can perform
voice cloning using reference WAV files from the voices/ directory.
- Add voice.rs module: loads manifest.json and reference.wav for a given
voice_id, decodes via symphonia, resamples to 24kHz for the TTS engine
- Update speak.rs: resolve voice_id from the speak request (default
"makima"), load reference audio, pass it to engine.generate()
- Add voices/makima/README.md with instructions for obtaining reference
audio (extraction from YouTube, recording, ffmpeg conversion)
- Graceful fallback: if reference audio is missing, TTS proceeds without
voice cloning using the model's default voice
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add inference cancellation support for TTS generation
Add cooperative cancellation via Arc<AtomicBool> cancel flag that
threads through TtsEngine::generate -> Qwen3Tts -> GenerationContext.
The autoregressive loop and streaming decoder check the flag each
iteration and break early when set. The speak WebSocket handler
creates a per-session flag, passes it to generate, and sets it on
Cancel/Stop/Close messages.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add Qwen3-TTS model download to build process
Fix TTS engine failure due to missing tokenizer by downloading
Qwen3-TTS models during Docker build:
- Download model.safetensors, config.json, tokenizer.json, and
tokenizer_config.json from Qwen/Qwen3-TTS-12Hz-0.6B-Base
- Download speech tokenizer from Qwen/Qwen3-TTS-Tokenizer-12Hz
- Add QWEN3_TTS_DIR environment variable to Dockerfile
- Script supports both env var override and default path
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: use correct hf command for Qwen3-TTS download
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- Add redTeamEnabled and redTeamPrompt state to contracts page
- Add "Enable Red Team Monitoring" checkbox with description
- Add conditional "Custom Review Criteria" textarea when enabled
- Include redTeamEnabled/redTeamPrompt in CreateContractRequest
- Reset red team fields when canceling contract creation
- Add redTeamEnabled to ContractSummary and Contract types
- Add redTeamEnabled/redTeamPrompt to CreateContractRequest type
- Add Red Team badge (🔍) to ContractList for enabled contracts
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
| | |
|