Repository navigation
feat: -x, --cmd widget, init, templates, --each, max_input, safer config; fixes from audit - #6
Merged
Merged
Conversation
added 13 commits
November 24, 2026 19:12
…te, process-group kill; add -x and agent/write/run settings; local-model docs
…device-level only
…; .priniarc holds behaviour only
added 16 commits
November 24, 2026 20:09
… words, keywords, ranking)
…use race on the history key
…ivate providers, [DONE] ends a stream, safe file reads, shared shell spawn, fewer git spawns
…otation is crash-safe; tests
…tory cap, docs for the audit fixes
…(taskkill /T); informational Windows CI job
added 2 commits
November 24, 2026 20:57
…fuses Homebrew, cargo and dev builds
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.
Fixes (from a code audit)
history agentno longer panics on] ... [; dangling symlinks refused for--write;run_commandkills the whole process group on timeout.Safer agent
--run/-xask[y/N]on the terminal before any command that is not a read-only pipeline (ls,find,cat,git log, ...).-yskips the question; with no terminal such commands are refused.Config
.priniarcholds behaviour only. Providers,provider, model names,keychainand history limits are device-level (global config only).run,write,agentand the prompts needprinia trustin a repo file; turning them off never does.prinia configshowsdirectory,env,globalordefault.agent,write,run,max_input,private,tag.tags = ["private", "work"]under[providers.NAME]; a.priniarcsaystag = "work"and the device picks the provider that has it (no fallback;-pmust match).privateis a tag:private = trueon a provider, or as a setting to require it.prinia inittags the local modelprivate.New
-x(agent + run),--no-agent,-y.--cmdandprinia shell zsh: a ctrl-g widget that turns a request into an editable command. Bound in emacs and both vi modes;PRINIA_WIDGET_KEYtakes one or several keys.prinia init: finds Ollama, picks a model for the machine's memory, offers to pull it, writes the config.-t NAME: saved instructions from.prinia/templates/.--each/-j N: one call per stdin line, parallel, ordered.Tiered
-ccontext: newest turns verbatim, older turns that match the new question in full (context_relevant), then one line per older question (context_older), then opt-in model summaries of older blocks (context_summary, derived from history, dropped on any delete, made by the call's own provider).prinia contextshows what-cwould send;--summarizebuilds the summaries now.max_input: long stdin is processed in parts and combined.README: local-model setup.
history askfinds matching turns across the whole history (time words like "last week", keywords, ranking) and cites turn ids.Fix: parallel first use of a fresh history could create two keys or fail with a UNIQUE error; the key is now created under a write lock, with a 5 s busy timeout.
Second audit (all 14 findings fixed)
--runauto-approve list no longer includesgit,uniq,hostname, or flags that write or run programs.privateprovider are never sent to a non-private provider (-c,history ask,history agent).max_inputused to defeat the env guard).[DONE]counts as a complete stream;read_filerefuses FIFOs and files over 10 MB.prinia trustprints each file and asks first.key rotateis crash-safe (pending wrapping, finished on next open).ask()split into helpers; oneRequest::plain; one shell spawn helper; fewergitspawns.max_input, trust, private turns, dropped streams, key-rotation crash,init, FIFO.Docs
docs/configuration.md: the settings table lists every new setting (context_relevant,context_older,context_summary,context_blocks,max_input,private,tag,agent,run/write,agent_steps); provider fieldstagsandprivate; env varsPRINIA_WIDGET_KEYandPRINIA_OLLAMA_URL.docs/usage.md: flag and command reference covers-t,--each/-j,--cmd,-a/-x,--write/--run/-y/--no-agent,init,trust,context,shell zsh.docs/agent.md: no longer saysrun = trueruns commands without asking.-xwith-y,prinia context); details live indocs/.Self-update
prinia updatedownloads the installer from the latest release and runs it into the folder the current binary lives in (the checksum logic stays inscripts/install.sh, no new dependency).prinia update --checkonly compares versions.docs/install.md#updating, the README and the usage reference. Tested against a local release server: version check, in-place install, installer failure, already current, and the refusals.Windows
--runapproval prompt opens the console on Windows (CONIN$/CONOUT$); Unix keeps/dev/tty. With no terminal the answer is still no.taskkill /T /F); Unix keeps the process-group kill.key.rsdid not compile (an import used only undercfg(unix)); a test deleted a folder with the database still open; the cleared test environment lackedSystemRoot, so Windows could not open sockets (os error 10106).Test (windows-latest): clippy and the full test suite, part ofrequired-checks-passed. It is green.docs/install.mdsay Windows is tested in CI only. Not tested by hand: the approval prompt on a real console, the Credential Manager key store.Not done
Testing
cargo test --locked(26 unit, 33 integration), clippy-D warnings, fmt clean. CI is green on macOS, Linux and Windows (all required), plus shellcheck, actionlint and zizmor.Manual, against a local Ollama (
qwen2.5:14b):-x,--cmd,--each,max_input,init,history ask,-c.prinia updateis tested against a local fake release server, not a real release.Manual, in a real pseudo-terminal: the zsh widget in emacs, vi-insert and vi-command mode (text replaced, nothing runs until Enter) and the
--run[y/N]prompt (nruns nothing,yruns the command).Windows: clippy and the test suite in CI (required). Not run:
prinia updateagainst a real release (none exists yet), the Anthropic path against the real API, Windows by hand, a hosted private provider.