[feature] key vault: env names, pb key run, and MCP rules that make an agent look here first - #25
Merged
Merged
Conversation
…E_CASE, with a shared filter
…d MCP rules that make an agent look here first
✅ SonarQube Quality Gate passed — pathorsAI_patchbay0 open issues on this PR. |
…unction stays under Sonar's complexity ceiling
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.
Why
The vault holds ~65 keys, yet an agent working on this machine never looked in patchbay when a task needed an env var or API key — it asked the user, wrote a placeholder, or said "missing". Two causes:
get_keyis gated and there was no way to use a key without reading it.cf-gh-actions-deploy), with no structured link to the variable name code reads (CLOUDFLARE_API_TOKEN). That link lived as prose inside purposes.What
KeyEntry.env— the environment variable a key is exposed as, validatedUPPER_SNAKE_CASE(refusals spell the corrected name). Optional; two entries may share one. Oldkeys.jsonparses unchanged. The manifest'sKeyRecordcarries it too.<PROVIDER>_<THING>_<KIND>.pb key run <id>... [--as NAME=id] -- <cmd>— inject keys into one child process; the value goes keychain → child, never stdout/log/argv/model context.pb key edit <id>— metadata only, for backfillingenvon existing entries.pb key list --provider/--env/--grep+ ENV column.store_key.env,list_keysfilters,update_key(metadata, ungated),resolve_env_vars(give it the names code reads; answers which the machine can supply and the exactpb key run/pb env runcommand). Two new instruction rules: LOOK HERE BEFORE ASKING FOR A CREDENTIAL and NAME THE VARIABLE.envfield in the add form and an env column.Verification
Locally:
cargo fmt --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --locked(core 649, cli 85, mcp 51),bun run build, tauri-crate clippy — all clean.