Commit graph

81 commits

Author SHA1 Message Date
林 駿甫 (Shunsuke Hayashi)
427b99f400 refactor: make mergegate gate-first 2026-04-10 15:03:49 +09:00
林 駿甫 (Shunsuke Hayashi)
29c72fee83 refactor: rename project surface to mergegate 2026-04-10 14:50:57 +09:00
林 駿甫 (Shunsuke Hayashi)
71ca903234 feat(cli): add full command reference to gate guide
Adds detailed reference for all 21 subcommands with arguments,
options, and usage examples. Agents can run `miyabi-gate gate guide`
to get both the workflow overview and per-command documentation.

Closes #113

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:50:48 +09:00
林 駿甫 (Shunsuke Hayashi)
602ccac22f feat(cli): add gate guide command for agent onboarding
Prints a complete workflow guide that any AI agent can read to
understand how to use Polaris: rules, step-by-step workflow,
context attachments, emergency commands, exit codes, and
quality checks.

Closes #111

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:48:01 +09:00
林 駿甫 (Shunsuke Hayashi)
9bf1b5e24c fix(core): address review findings F1-F4 + add 10 missing tests
F1: Add depth limit (max 5) to find_note_by_name and
    collect_obsidian_matches to prevent stack overflow on large vaults
F2: Fix bus_enqueue to use store_path parent instead of cwd
F3: Fix update_skill_md_from_patterns to preserve sections after
    the auto-generated marker instead of truncating them
F4: Fix extract_wikilinks to consume chars after | in [[Note|Display]]
    so subsequent links parse correctly

Tests added:
- extract_wikilinks: basic, display text, empty/broken
- find_note_by_name: depth limit enforcement
- resolve_wikilink: direct, nested, non-existent
- build_rejection_section: empty, sorted by count desc
- update_skill_md_from_patterns: append, replace preserving following sections

955 tests GREEN, clippy zero.

Closes #109

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:36:44 +09:00
林 駿甫 (Shunsuke Hayashi)
263adf87cd feat(protocol): expand Obsidian wikilinks in attach_context
When attaching Obsidian notes, extract [[wikilinks]] from the note
content and resolve them to actual vault files. Linked notes are
attached as "obsidian_wikilink" type, bounded by remaining_tokens.

Supports both [[Note]] and [[Note|Display]] syntax.

Closes #102

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:21:01 +09:00
林 駿甫 (Shunsuke Hayashi)
7976886bc5 test(core): add proptest property-based tests for lock and store
Adds proptest to dev-dependencies and 6 property-based tests:
- lock: acquire→release always clears, two tasks can't lock same file,
  wrong owner renew always fails
- store: CAS rejects stale version, upsert is idempotent,
  event replay is deterministic

945 tests all GREEN.

Closes #100

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:18:41 +09:00
林 駿甫 (Shunsuke Hayashi)
b058632481
Merge pull request #99 from Miyabi-G-K/feature/issue-96-theta-skill-update
feat(dream): θ6 auto-update SKILL.md from rejections
2026-04-10 10:16:25 +09:00
林 駿甫 (Shunsuke Hayashi)
61cdee2db8
Merge pull request #98 from Miyabi-G-K/feature/issue-97-dashboard-stats
feat(dashboard): completion stats with progress bar
2026-04-10 10:16:18 +09:00
林 駿甫 (Shunsuke Hayashi)
3ff1a09c33
Merge pull request #95 from Miyabi-G-K/feature/issue-93-bus-docking
feat(cli): Bus docking — auto-enqueue on register
2026-04-10 10:16:08 +09:00
林 駿甫 (Shunsuke Hayashi)
2733aa9552
Merge pull request #94 from Miyabi-G-K/feature/issue-91-obsidian-utf8-fix
fix(protocol): handle non-UTF-8 in Obsidian vault
2026-04-10 10:16:01 +09:00
林 駿甫 (Shunsuke Hayashi)
5c1852f25e
Merge pull request #90 from Miyabi-G-K/feature/issue-89-depth1-attach
feat(protocol): attach depth-1 impact files
2026-04-10 10:15:54 +09:00
林 駿甫 (Shunsuke Hayashi)
9a6e98b8ab feat(dream): auto-update SKILL.md from gate rejection patterns
θ6 self-improving: When dream detects gate rejections, automatically
appends/refreshes a "Common Rejection Patterns" section in
polaris-ops/SKILL.md with gate names, counts, and remedies.

This closes the feedback loop: agents learn from their own mistakes
without human intervention.

Closes #96

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:13:40 +09:00
林 駿甫 (Shunsuke Hayashi)
f929c5b6af feat(dashboard): add completion stats panel with progress bar
Adds a Completion Stats panel to the Polaris web dashboard showing:
- Completion percentage with large display
- Visual progress bar (green)
- Breakdown of done/active/pending/total tasks

Closes #97

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:12:14 +09:00
林 駿甫 (Shunsuke Hayashi)
d52ac2fe12 feat(cli): auto-enqueue to skill-bus on register
After successful task registration, automatically append a queued
entry to skill-runs.jsonl. This connects the Polaris gate workflow
to the skill-bus tracking system.

Use --no-bus to skip auto-enqueue when not needed.

Closes #93

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:10:18 +09:00
林 駿甫 (Shunsuke Hayashi)
6045f67647 fix(protocol): handle non-UTF-8 files in read_file_snippet
When reading Obsidian vault notes or source files, non-UTF-8 bytes
caused a hard error. Now gracefully breaks on invalid UTF-8 lines
and returns whatever was read so far.

Closes #91

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:07:45 +09:00
林 駿甫 (Shunsuke Hayashi)
5ac86dccad feat(protocol): attach GNI depth-1 impact files to context
When build_context_attachments runs, it now also includes files from
TaskImpact.depth1 as "impact_depth1" attachments. Files already
attached via locked_files are skipped to avoid duplication.

This improves context accuracy by giving agents visibility into
direct callers/importers that may be affected by their changes.

Closes #89

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:00:25 +09:00
林 駿甫 (Shunsuke Hayashi)
a470d60126 test(core): add comprehensive tests for lock.rs and store.rs
Day 1 improvement cycle: reinforce test coverage for deterministic
task protocol primitives.

lock.rs: +6 tests (acquire unknown task, wrong owner renew, release
noop, no-conflict check, multi-file lock/release, empty sweep)
store.rs: +6 tests (replay since_id, empty replay, upsert replace,
remove task, legacy file loading, lock release event rebuild,
lease_expiry calculation)

Closes #87

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 09:58:28 +09:00
林 駿甫 (Shunsuke Hayashi)
17ad33a96a [追加] Sprint 5: Issue自動作成 + git同期 + Telegram + Heartbeat + Obsidian検索 (#77-81) 2026-04-10 09:48:49 +09:00
林 駿甫 (Shunsuke Hayashi)
98239fc3f3 [追加] miyabi gate init: Git/GitHub チェック + .gitignore 自動更新 (#75) 2026-04-10 09:28:47 +09:00
林 駿甫 (Shunsuke Hayashi)
0c5dec9950 [追加] miyabi gate init: リポ初期化コマンド (#74) 2026-04-10 09:04:42 +09:00
林 駿甫 (Shunsuke Hayashi)
3744382d3d [追加] assign 後に実行プランを自動表示 (#73) 2026-04-10 08:53:40 +09:00
林 駿甫 (Shunsuke Hayashi)
3560b6e702 [整備] OpenSSL 依存を排除: rustls-tls + vendored-openssl で全ノード対応
- reqwest: rustls-tls に切り替え(OpenSSL 不要)
- git2: vendored-openssl で静的リンク
- 全 Mac ノード (mainmini, macmini2, mini3) にバイナリ配布済み
- mini3 の dylib not found エラーを解消

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 08:24:42 +09:00
林 駿甫 (Shunsuke Hayashi)
a965bd3b62 [追加] verify_merge + escape hatch (force_unlock, manual_complete) 2026-04-10 08:11:29 +09:00
林 駿甫 (Shunsuke Hayashi)
59be218b20 [整備] ライセンスを MIT → BSL 1.1 に変更
Licensor: 合同会社みやび (Miyabi G.K.)
非商用・教育目的のみ無料。商用利用は別途ライセンス。
4年後に Apache 2.0 に自動移行。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 07:50:40 +09:00
林 駿甫 (Shunsuke Hayashi)
0588d41799 [追加] Web ダッシュボード: miyabi gate serve (#63) 2026-04-10 07:42:21 +09:00
林 駿甫 (Shunsuke Hayashi)
70cd906776 [追加] ドリーミング: event log → 学び抽出 (#59) 2026-04-10 07:29:03 +09:00
林 駿甫 (Shunsuke Hayashi)
ec1d25887e [文書] Playbook v4: ビジョン全38要素をカバーする完全版
v3 から追加:
  Sprint 3: 記憶アタッチメント (#58) + ドリーミング (#59) + Web ダッシュボード (#63)
  Sprint 4: シータサイクル (#60) + Obsidian (#62)
  Sprint 2: Bus データパス統合 (#65) + ブランチ戦略 (#64)

新規 Issue:
  #64: 並列Codexブランチ戦略 (worktree + PR)
  #65: Bus データパス統合

ビジョン達成度推移:
  現在 32% → Sprint1後 38% → Sprint2後 47% → Sprint3後 72% → Sprint4後 93%

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 06:54:20 +09:00
林 駿甫 (Shunsuke Hayashi)
a1febb67eb [修正] GATE 0+5: Issue=0 拒否 + ブランチ名バリデーション (#52, #53) 2026-04-10 06:51:39 +09:00
林 駿甫 (Shunsuke Hayashi)
58c8bf71e1 [修正] exit code: GATE拒否=1, 入力エラー=2 に統一 (#56, #57) 2026-04-10 06:48:55 +09:00
林 駿甫 (Shunsuke Hayashi)
89d2ab3c12 [文書] DTP Playbook v3 完全版 — Sprint 1〜5 の全タスク網羅
Sprint 1 (今日): clippy修正 + Phase C + GNI確認
Sprint 2 (今週): OpenClawドッキング (JSON標準化/hooks/memory sync/サブエージェント)
Sprint 3 (来週): 運用基盤 (Heartbeat/git自動同期/Telegram/VOICEBOX/Maestro)
Sprint 4 (今月): 品質ゲート多層化 (rust-ai-pipeline/proptest/cargo-mutants)
Sprint 5 (来月): 移行+公開 (TS→Rust/OpenClawプラグイン/npm配布)

各Sprint: DAG依存/承認ゲート/ロールバックポイント定義済み

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 06:21:31 +09:00
林 駿甫 (Shunsuke Hayashi)
273c416344 feat: [日本語] DTP Phase B CLI 追加 2026-04-10 06:17:01 +09:00
林 駿甫 (Shunsuke Hayashi)
986d907e5b feat: [日本語] DTP Phase A 基盤追加 2026-04-10 01:35:17 +09:00
林 駿甫 (Shunsuke Hayashi)
dfdd52ec1d feat(collab): add miyabi collab subcommand for Collaborator canvas control
Add `miyabi collab` subcommand (Phase 3 of Miyabi canvas integration):
  miyabi collab list [--json] [--type TYPE] [--count]
  miyabi collab add <type> [--file PATH] [--pos x,y] [--size w,h] [--idempotent]
  miyabi collab rm <tile_id>
  miyabi collab move <tile_id> --pos x,y
  miyabi collab resize <tile_id> --size w,h
  miyabi collab viewport [--pan x,y] [--zoom 1.0]
  miyabi collab status

Delegates to ~/.local/bin/collab (collab CLI v0.2.0+).
Error handling includes installation hint on binary not found.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 10:06:15 +09:00
Shunsuke Hayashi
0e37360f8b feat: add OpenClaw integration module to miyabi-core
- Add openclaw.rs module for cluster communication
- Expand CLI with OpenClaw-related commands (264 lines)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 06:35:05 +09:00
Shunsuke Hayashi
6d5b55ad74 fix: TUIウィジェットの表示を修正
- diff表示の修正
- historyリストの修正
- markdown表示の修正

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 05:08:11 +09:00
Shunsuke Hayashi
c3c3400bb2 fix: Resolve clippy warnings in dag.rs and workflow.rs
- Replace ok_or_else with ok_or for non-lazy error construction
- Derive Default for StepCondition and FailurePolicy enums
- Allow clippy::only_used_in_recursion for visit_step method

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 01:46:46 +09:00
Shunsuke Hayashi
22672b2d65 test(config): Add comprehensive config module tests
Add 16 new tests for configuration functionality:
- Path/directory helpers (default_path, default_dir)
- API key retrieval methods
- Sub-config defaults (ApiConfig, UiConfig, SessionConfig, ToolConfig)
- Save/load operations and roundtrip
- Edge cases (invalid TOML, empty file, nested dirs)
- Debug and Clone trait implementations

Total miyabi-core tests: 387 (was 371)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 01:33:43 +09:00
Shunsuke Hayashi
810eb43128 test(retry): Add comprehensive retry module tests
Add 12 new tests for retry functionality:
- RetryConfig constructors (new, aggressive, conservative)
- calculate_delay exponential backoff and capping
- retry_with_backoff behavior (exhaustion, zero attempts, success/error)
- Config traits (Clone, Debug)

Total miyabi-core tests: 371 (was 359)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 01:04:05 +09:00
Shunsuke Hayashi
671b04e4f8 test(hooks): Add comprehensive hooks module tests
- Add 24 new tests for HookEvent, HookAction, Hook, HookContext
- Test HookManager registration, enable/disable, get_hooks
- Test HooksConfig save/load
- Test hook execution with Log, Notify actions
- Test conditional hook execution
- Test variable expansion in hook messages

Core tests: 359 passed (+24 new)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:56:37 +09:00
Shunsuke Hayashi
2b27a4a667 test(rules): Add comprehensive rules module tests
- Add 23 new tests for Rule, AgentPreferences, MiyabiRules
- Test validation logic (version, name, suggestion, severity)
- Test file matching and pattern matching
- Test RulesLoader file discovery and loading
- Test serialization and error handling

Core tests: 335 passed (+23 new)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:54:50 +09:00
Shunsuke Hayashi
f740f07c23 test: Add comprehensive cache and error_policy tests
Cache tests (18 new):
- Test CacheEntry creation and expiration
- Test TTLCache insert, remove, clear, stats
- Test custom TTL, concurrent access
- Test LLMCacheKey and ApiCacheKey creation
- Test cache factories and serialization

Error policy tests (18 new):
- Test FallbackStrategy variants and defaults
- Test CircuitState equality
- Test CircuitBreaker default, reset, counters
- Test circuit transitions and thresholds

Core tests: 312 passed (52 new this phase)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:45:42 +09:00
Shunsuke Hayashi
c84c9d6c25 test(mcp): Add comprehensive MCP integration tests
- Add 16 new tests for MCP server configuration, request/response handling
- Test McpServerConfig defaults and serialization
- Test McpConfig save/load and multiple servers
- Test McpRequest with params, McpResponse success/error
- Test McpError with data, McpTool deserialization
- Test McpManager creation and state checking

Core tests: 276 passed (16 new)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:43:16 +09:00
Shunsuke Hayashi
7738f10965 feat(streaming): Add real-time streaming support for Agent
- Add StreamingAgent with run_stream() and run_with_callback() methods
- Add AgentStreamEvent enum with 11 event types (Started, TextChunk, ToolDetected, etc.)
- Add StreamProcessor for handling API streaming events
- Add StreamingConfig for buffer_size and emit_chunks settings
- Add 10 comprehensive unit tests

Core tests: 260 passed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:40:03 +09:00
Shunsuke Hayashi
2ccf8267ac feat(orchestration): Add multi-agent orchestration module
- ParallelConfig for concurrency, timeout, fail-fast settings
- Orchestrator for parallel and sequential agent execution
- OrchestratorTask for task definition with optional system prompts
- ParallelResult with success tracking and metrics
- TaskResult for individual execution results

Features:
- Semaphore-based concurrency control
- Timeout per task execution
- Success rate and total token tracking
- Helper function for quick orchestrator creation

Total: 752 tests passing (9 new orchestration tests)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:34:44 +09:00
Shunsuke Hayashi
f6215765b3 test(session): Add comprehensive session tests
- Test session creation with custom ID
- Test system prompt builder pattern
- Test tags management
- Test preview truncation and empty preview
- Test storage default directory
- Test storage exists/load/delete operations
- Test metadata conversion and preview
- Test timestamp updates

Total: 23 session tests (13 new)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:31:37 +09:00
Shunsuke Hayashi
364dfd9da3 test: Add comprehensive Workflow and DAG tests
Workflow tests (14 new tests):
- Test StepCondition, RetryConfig, FailurePolicy defaults
- Test StepStatus and WorkflowStatus equality
- Test WorkflowContext with variables and results
- Test StepResult and WorkflowResult creation
- Test Workflow with output variables
- Test step and failure policy variants

DAG tests (23 new tests):
- Test TaskId creation and display
- Test Task with priority and estimated time
- Test TaskNode operations (add/remove dependencies)
- Test TaskLevel creation and management
- Test TaskGraph operations (count, parallelism, levels)
- Test TaskGraphBuilder with priority
- Test DAGError variants
- Test complex parallel graphs

Total: 730 tests passing (228 core, 498 TUI, 4 CLI)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:28:39 +09:00
Shunsuke Hayashi
5cfd656dbc test(agent): Add comprehensive agent integration tests
- Add approval_integration_tests module with 10 tests
- Add executor_registry_tests module with 5 tests
- Add agent_event_tests module with 2 tests
- Test ApprovalCallback implementations (AutoApproveAll, RejectHighRisk)
- Test ChannelApprover async communication
- Test RiskLevel ordering and approval requirements
- Test ExecutorRegistry tool registration and risk levels

Total: 17 new tests, all passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:24:40 +09:00
Shunsuke Hayashi
6ac4d539d4 feat(dag): Add DAG-based task graph for parallel execution
- Add TaskGraph with topological sort using Kahn's algorithm
- Add TaskLevel for grouping independent tasks for parallel execution
- Add TaskGraphBuilder for fluent API construction
- Support dependency tracking and cycle detection
- Include 7 comprehensive tests

Ported and simplified from miyabi-private/miyabi-dag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:20:16 +09:00
Shunsuke Hayashi
5935dae7dd feat(agent): Add approval callback system for tool execution
- Add ApprovalCallback trait with ApprovalDecision (Approved, Rejected, ModifyInput)
- Implement AutoApproveAll, RejectHighRisk, and ChannelApprover callbacks
- Integrate approval callback into Agent execution loop
- Support interactive approval via channel-based communication
- Include comprehensive tests for all approval scenarios

All 167 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:16:55 +09:00