Skip to content

feat: phase 10 — LlmBridge, ProposedCommand, parser, AI safety floor#9

Merged
macaris64 merged 2 commits intomainfrom
phase-10-llm-bridge
Apr 18, 2026
Merged

feat: phase 10 — LlmBridge, ProposedCommand, parser, AI safety floor#9
macaris64 merged 2 commits intomainfrom
phase-10-llm-bridge

Conversation

@macaris64
Copy link
Copy Markdown
Owner

Implements all Phase 10 features completing Milestone M3 (LLM bridge):

  • parser.rs: POSIX shell tokenizer + code-fence stripper (parse_command_responseVec<String>)
  • proposed.rs: ProposedCommand + CommandSource::AiGenerated; apply_ai_safety_floor raises AllowConfirm for all AI output; ProposedCommand::evaluate_safety integrates with SafetyPolicyEngine
  • bridge.rs: generic LlmBridge<C: LlmClient> orchestrates context → composer → client → parser → ProposedCommand; translate_nl (NL session mode) and assist_on_127 (exit-127 mode); graceful degradation: LlmError::Http propagated for caller fallback
  • phase10_integration.rs: 23 integration tests (+ 6 mockito-backed Ollama tests under --features ollama); live-daemon tests #[ignore]
  • phase10.rs example: runnable demo of all Phase 10 features
  • README.md: updated status (M3 complete, 506 tests, 96%+ coverage)
  • LLM_GUIDE.md: installation, configuration, API usage, troubleshooting
  • PLAN.md: roadmap through Phase 20 (M4 TUI, M5 remote LLM, M6 plugins)

CI: fmt ✓ · clippy -D warnings ✓ · 506 tests · 96.48% coverage

macaris64 and others added 2 commits April 19, 2026 00:24
Implements all Phase 10 features completing Milestone M3 (LLM bridge):

- `parser.rs`: POSIX shell tokenizer + code-fence stripper
  (`parse_command_response` → `Vec<String>`)
- `proposed.rs`: `ProposedCommand` + `CommandSource::AiGenerated`;
  `apply_ai_safety_floor` raises `Allow` → `Confirm` for all AI output;
  `ProposedCommand::evaluate_safety` integrates with `SafetyPolicyEngine`
- `bridge.rs`: generic `LlmBridge<C: LlmClient>` orchestrates
  context → composer → client → parser → `ProposedCommand`;
  `translate_nl` (NL session mode) and `assist_on_127` (exit-127 mode);
  graceful degradation: `LlmError::Http` propagated for caller fallback
- `phase10_integration.rs`: 23 integration tests (+ 6 mockito-backed
  Ollama tests under `--features ollama`); live-daemon tests `#[ignore]`
- `phase10.rs` example: runnable demo of all Phase 10 features
- `README.md`: updated status (M3 complete, 506 tests, 96%+ coverage)
- `LLM_GUIDE.md`: installation, configuration, API usage, troubleshooting
- `PLAN.md`: roadmap through Phase 20 (M4 TUI, M5 remote LLM, M6 plugins)

CI: fmt ✓ · clippy -D warnings ✓ · 506 tests · 96.48% coverage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dead code lint (-D dead_code) in CI flagged the helper function.
It was never called — removed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@macaris64 macaris64 merged commit 054db1f into main Apr 18, 2026
4 checks passed
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.

1 participant