feat: unified owner model, .avault/ dir, fleet commands #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "kn/unified-owner-model"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
--signer-npubwith--owner-npub(single owner concept for IT fleet + individual operators).avault/directory:config.json,nsec.enc,secrets.vault,secrets.centralsecrets.central: metadata-only manifest encrypted TO owner (no secret values)NOSTR_NSECenv →~/.profile→ NIP-46fleet-auditandfleet-recovercommands for owner-side operationsTest plan
pytest scripts/test_avault.py -v— all 59 tests passavault init --owner-npub <npub>creates.avault/with 4 filesavault set foo --key BAR --value bazupdates bothsecrets.vaultandsecrets.centralavault fleet-audit --owner-nsec <nsec> --repo .outputs JSON metadataReview: PR #15 — Unified owner model, .avault/ dir, fleet commands
Verdict: Approve with minor notes. Clean, well-scoped refactor. 59 tests passing. The three changes (owner model, directory layout, fleet commands) are logically coherent and each one enables the next.
What's good
--signer-npub→--owner-npub— better mental model. "Signer" was a NIP-46 implementation detail; "owner" is the actual relationship. Applied consistently throughout..avault/directory — everything in one place instead of 3 loose files in workspace root. Clean naming:config.json,secrets.vault,nsec.enc,secrets.central.secrets.centralis a clever design — metadata-only manifest (secret names, key names, timestamps) encrypted TO the owner. Owner can audit what secrets an agent holds without ever seeing the values. Written automatically on everysave_vault().NOSTR_NSECenv →~/.profile→ NIP-46) — pragmatic. Most agents will just use env/profile; NIP-46 is the "proper" path for remote signing.fleet-auditandfleet-recover— exactly what you need for managing multiple agents. Audit sees metadata only; recover gets the nsec (and optionally full vault with--full). Both take--reposo they work across workspaces.save_vaultwrites-central tests. Mock patterns are clean.Issues
fleet-recoverprints nsec to stdout — by design (it's the point), but worth a prominent warning in the help text or a--yesconfirmation flag. Accidentally piping this to a log file would be bad.--owner-nsecon CLI — fleet commands take the owner's nsec as a command-line argument. This shows up in shell history andpsoutput. Consider reading from stdin or a file descriptor instead:Not a blocker, but worth a follow-up issue.
save_vaultalways callsload_config()whenowner_pkis None — disk read on every vault save. Minor for CLI usage, but the daemon already cachesself.owner_pkand passes it explicitly, so this fallback path is fine in practice._build_central_manifestincludesnote— notes might contain sensitive context (e.g., "shared with contractor X"). Probably fine since central is still encrypted, but worth being aware that notes leak to the owner-side manifest.Nit
cmd_init:save_central_manifest(new_vault() if not VAULT_FILE.exists() else load_vault(keys) or new_vault(), keys, owner_pubkey)— dense one-liner. Vault was just created 3 lines above, soVAULT_FILEalways exists at this point. Could simplify.Bottom line: Ship it. The owner model + central manifest + fleet commands add real operational value for managing agent fleets. File a follow-up for the nsec-on-CLI concern.
- Fix CI: use python-${{ matrix.python-version }} runner (not ubuntu-latest) - fleet-recover: add stderr warning about sensitive output - fleet commands: support '-' for stdin nsec (avoids shell history exposure) - Simplify dense one-liner in cmd_init Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Addressed in
e6d9839:--owner-nsecargs now accept-to read from stdin, avoiding shell history/process list exposure.Also fixed CI:
runs-on: python-${{ matrix.python-version }}matching Forgejo runner labels (wasubuntu-latest).