Repository navigation
feat: Phase 2 local intelligence engine - #95
Merged
Merged
Conversation
alvarolorentedev
force-pushed
the
feat/local-intelligence-engine
branch
4 times, most recently
from
November 26, 2026 00:14
1ecd273 to
b40b3c0
Compare
alvarolorentedev
marked this pull request as ready for review
November 26, 2026 00:16
Adds the Phase 2 evidence-to-analysis pipeline, deterministic and real-model evaluation, a managed llama.cpp runtime with verified on-demand model downloads, custom OpenAI-compatible providers with explicit consent, and the intelligence settings/analysis UI with deterministic mock scenarios.
alvarolorentedev
force-pushed
the
feat/local-intelligence-engine
branch
from
November 26, 2026 00:16
b40b3c0 to
d74ef8e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 2 adds optional, local-first diagnostic intelligence to Barklarm 4.0:
Scope
Intelligence is disabled by default. Monitoring, notifications, tray, diagnostic evidence and the issue webhook are unchanged when intelligence is disabled, unavailable or failed. No automatic remediation, tools, shell execution, MCP, incident history or cloud backend is introduced.
Architecture
src/types/Intelligence.ts: analysis, provider, model and runtime contracts.src/core/intelligence/: assembler, prompt, endpoint policy, providers, validator, analysis lifecycle.src-tauri/src/intelligence/: runtime supervisor, model manifest/download, hardware, consent and credential storage.src/mainview/: settings, analysis panel and mock runtime.ADRs: 0009 analysis boundary, 0010 provider trust/consent, 0011 managed runtime, 0012 artifact supply chain, 0013 evaluation/model selection.
Model selection
Default: Qwen3-1.7B-Instruct Q4_K_M (Apache-2.0, 1,107,409,472 bytes, SHA-256
b139949c…), served by llama.cpp b12732 with thinking disabled.docs/evaluations/0001-model-selection.md.Verification
Executed in this workspace (macOS arm64, 16 GB, Bun 1.4.5, Rust 1.99):
GitHub Actions run
45727624900is green: Quality gate, Browser end-to-end, Rust native checks, Native sidecar and Production dependency audit.Coverage: 86.91% lines/statements, 86.05% branches, 87.09% functions. A separate native smoke launched the bundled sidecar with its libraries and an ephemeral bearer token and verified its health endpoint.
Platform support
Other platforms keep the traditional radiator and custom-provider option. See
docs/evaluations/0002-runtime-platform-matrix.md.Independent review
An independent agent review was executed against the committed diff. Its material findings were addressed:
Remaining native test gaps and unexecuted platforms are stated below rather than claimed as validated.
Security
Stateand evidence; it never changes operational status or the webhook.Residual risks and release blockers are recorded in
docs/engineering/SECURITY.mdand the runtime matrix: non-macOS managed execution, signed/notarized bundles, full interactive CSP validation on every target, and the small synthetic evaluation set.Screenshots
docs/media/intelligence-complete.pngdocs/media/intelligence-remote-consent.pngRollback
Disable intelligence, remove the downloaded model and delete the runtime artifact directory. Evidence and analysis are memory-only, so no data migration is required. Existing configurations load with intelligence disabled.
Definition of done
Implemented and locally validated on macOS arm64. Classified as implemented but not release-ready for all platforms until the remaining native smoke tests, signed/notarized bundles and broader evaluation are complete.