v0.5.0: config + security defaults (final epic — gaps #9 + #10) - #11
Merged
Conversation
…ctVisionModel) (TDD)
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.
v0.5.0 — Config + Security Defaults (FINAL epic)
Closes PRD gaps #9 (security posture) + #10 (workflow-fit defaults). Completes the 5-epic roadmap (4/5 → 5/5). All 10 PRD gaps closed.
SPEC-5 + PLAN-5 (resolved 7 implementation unknowns against pi's verified extension API).
What ships
Gap #9 — Security posture:
lib/audit.ts): every delegation (success, cache hit, fallback, failure) appended to~/.pi/agent/vision-audit.logas one JSONL line (ts/provider/model/image_path/source_hash/cached/fallback/ok/error_code/latency_ms/local_only). Privacy stance: never logs image bytes or the full prompt —source_hashis a one-way fingerprint; data:URL/base64image_pathtruncated. Default ON (opt-out security posture). One entry per delegation via thedelegate.tschokepoint (batch = N entries)./vision audit <clear|show|path|on|off>.config.localOnly): image bytes never leave the machine. Structural guarantee — the network-call code path is never entered on a cache miss (gate atdelegate.ts:317, beforecallWithRetryAndFallback:335). Cache hits still work (cache is local). Paste auto mode short-circuits to hint (noautoDelegateTimeoutMsburned). Every event audited withlocal_only: true(greppable proof)./vision local-only [on|off].Gap #10 — Workflow-fit defaults:
lib/defaults.ts): atsession_start, when provider+model are both unset (fresh config), detects frommodels.json— prefersOllamaprovider's vision models (AGENTS.md "Ollama Cloud primary") + first non-Ollama vision model as fallback (frontier escalation). Persists once (user sees + can override;/vision clearre-triggers). Verified the registry is populated beforesession_startfires (agent-session.js:1737,getAvailable()synchronous).markerStyleis a superset).Config (4 new fields → 22 total)
auditLog(default true),auditLogPath(default undefined),localOnly(default false),autoDetectVisionModel(default true). Forward-compat: a v0.4.0 config loads with the 4 new fields defaulted.Key design: unified network path (PLAN-5 §1.6)
Refactored
delegateToVisionModel's two cache branches into a single network path — behavior-preserving (T47 + T55 assert v0.4.0 semantics intact) + gives one insertion point for the local-only gate + the audit entry.Tests
Constraints
lib/audit.ts+lib/defaults.tsstateless pure (noglobalThisneeded).EVAL
Real-pi EVAL (Ghostty + tmux) deferred to RECTOR after merge +
/reload(fresh session after/vision clear→ auto-detect;/vision local-only on→ new image errors, cached returns;/vision audit show→ JSONL tail).