feat(vault): offline vault list/add/remove + update verb (M1b)#213
Merged
Conversation
a0c008a to
f70ce9a
Compare
df6344c to
ad5dfa3
Compare
- vault list [--json], vault add --local / --git <remote> [--path] [--interval], vault remove (drops the index db, leaves markdown on disk) - update verb: --check reports the verdict; otherwise npm-installs the latest when the registry says we're behind (installer injected for testability) - couchdb-default `vault add` (no flag) is deferred to the provisioning slice (needs the V4 couch call + live API) - it errors with clear guidance for now - vault-registry.ts holds the pure add/remove/index-path/format logic - offline e2e tier (@p0): add -> list -> remove round-trips with no network - 109 unit tests + 2 e2e green; verified the built binary end to end
ad5dfa3 to
099f25b
Compare
Contributor
|
🎉 PR Validation ✅ PASSED Commit: Checks:
Ready to merge! ✨ 🔗 View workflow run |
vreshch
added a commit
that referenced
this pull request
Jul 5, 2026
E2E hardening for **M1** - covers every M1 acceptance criterion with end-to-end tests. **Stacked on #213** (base = `feature/m1b-vault-commands`); lands after #212 -> #213. Adds `e2e/m1-requirements.test.ts` (@p0), driving the built `dist/cli.js` against a per-test temp config dir. All offline except `update --check` (which the verb tolerates on any network state). ## Coverage (9 tests) | Requirement | Test | |---|---| | `vault add --git` writes a valid entry (interval + `$schema`) | ✓ | | `--git` requires a remote value | ✓ | | duplicate name rejected | ✓ | | allowlist-failing name rejected | ✓ | | **empty `vaults.json` still carries the `$schema` link** | ✓ | | `remove` keeps markdown on disk, drops the index db | ✓ | | `vaults.yaml` accepted; JSON wins when both exist | ✓ | | malformed / unknown-type config fails loudly | ✓ | | `update --check` reports a verdict, exits 0, never installs | ✓ | ## Verify - `npx playwright test m1-requirements vault-offline` -> **11 passed** locally (9 new + 2 from #213), 3.1s. - `type-check:e2e` + `format:check` green. Stack merge order: **#212 -> #213 -> this**. CI runs once the stack rebases onto master.
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.
The offline command block for M1 - Config + registry. Second of two PRs. Stacked on #212 (base =
feature/m1-config-schema) - review/merge #212 first, then this retargets to master.What (all offline - no network, no auth)
vault list [--json]- name / type / path, one line each (remote shown for git, server for couchdb); friendly hint when empty.vault add <name>---local(a folder that never syncs) or--git <remote>(--interval, default 5m);--path(default~/vaults/<name>, created if missing). Writes a valid entry, provisions nothing.vault remove <name>- unregisters + drops~/.agentage/index/<name>.db; markdown stays on disk.update [--check]---checkreports the verdict; otherwisenpm i -g @agentage/cli@latestwhen the registry says we're behind (installer injected for tests). Passive check already ridesstatus.vault-registry.tsholds the pure add/remove/index-path/format logic; commands take injectedDeps.Deferred (not in this PR)
vault add(the account path) -vault addwith no flag errors with guidance. It needsPOST /vaultsprovisioning + the V4 couch-channel call, so it lands in the provisioning slice.vaults.schema.jsonon the landing (separate landing-repo PR).Verify
npm run verifygreen: type-check (src + e2e), eslint, prettier, 109 unit tests, build.--local/--git, list +--json, duplicate -> exit 1, no-flag -> "needs provisioning" exit 1, remove leaves files,vaults.jsonwritten valid with$schemafirst + git sync defaults filled.npx playwright test vault-offline, 2 passed): add -> list -> remove with no network.Verify (for you)
Open the diff; optionally
npm run build && node dist/cli.js vault add demo --local --path /tmp/demo && node dist/cli.js vault list.