Skip to content

feat(ios): add VaultRegistry and UnlockAttemptThrottle for Encrypted Vaults - #305

Merged
libravault-xyz merged 1 commit into
devfrom
feature/ios-vault-registry-throttle
Aug 19, 2026
Merged

libravault-xyz merged 1 commit into
devfrom
feature/ios-vault-registry-throttle

Conversation

@libravault-pipeline-bot

@libravault-pipeline-bot libravault-pipeline-bot Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Swift equivalents of Android's core:vaultstore VaultRegistry.kt and UnlockAttemptThrottle.kt, split out of #201 (2/6 of #190's iOS Encrypted Vaults breakdown) as the two pieces of that scope with no cryptographic risk of their own. Depends on #200/#220 (crypto core) only for naming/style consistency, not behavior — no VaultCrypto types are imported.

New files under ios/LibraVaultApp/LibraVault/LibraVault/Sources/VaultStore/:

  • VaultRegistry.swift — plaintext JSON list of which vaults exist (id, display name, created-at epoch millis), persisted as vaults.json under a caller-supplied base directory, with add/remove/rename/list/vaultDir. Deliberately plaintext, same accepted-residual-leak reasoning as Android's vaults.json — see docs/threat-model.md's "Accepted residual leaks" section. No key material or vault content ever touches this type. Writes use Data.write(to:options:.atomic) for the same write-to-temp-then-rename atomicity Android's version gets from File.renameTo.
  • UnlockAttemptThrottle.swift — the same pure exponential-backoff math as Android's object (3 free attempts, doubling delay capped at 5 minutes), taking failedAttempts/lastAttemptEpochMillis/nowEpochMillis and returning a delay — no I/O, unit-testable with no device. Its state is persisted per-vault by a new UnlockAttemptThrottleStore (unlock-throttle.json inside the vault's own directory), matching the "per-vault config file, alongside the vault it protects" location docs/threat-model.md's data-inventory table already documents for this data. This is a standalone store rather than folded into a VaultConfig-equivalent type, because iOS has no such crypto-config persistence type yet (that's a different, not-yet-built piece of [Feature] iOS Encrypted Vaults 2/6: VaultStore equivalent + leak-closure guarantee #201) — it can be migrated into one later without changing UnlockAttemptThrottle's pure math.

New tests under ios/LibraVaultApp/LibraVault/LibraVaultTests/: VaultRegistryTests.swift and UnlockAttemptThrottleTests.swift (covering both the pure throttle math and the new UnlockAttemptThrottleStore persistence round-trip), mirroring the Android suites' case coverage (insertion order, duplicate-id rejection, no-op remove/rename of unknown ids, no stray .tmp file after a write, delay growth/cap/non-negativity, throttle state surviving a fresh read() call standing in for a process restart).

Both new production types depend only on Foundation — no Keychain, no Secure Enclave, no networking — satisfying the issue's "unit-testable without a real device" acceptance criterion.

No .pbxproj changes needed: Sources/ is a PBXFileSystemSynchronizedRootGroup in this project, so new files under it are picked up by Xcode automatically.

Verification note

This dev-agent's sandbox has no macOS/Xcode toolchain, so I could not run the project's actual xcodebuild test locally. Instead I verified with the Linux Swift 6.3 toolchain (which has no access to the real LibraVault Xcode target or its @testable import):

  • swiftc type-checked both new production files cleanly.
  • A standalone runtime script exercised UnlockAttemptThrottle's math (matching Android's UnlockAttemptThrottleTest.kt fixture values, including the exponent cap) and VaultRegistry/UnlockAttemptThrottleStore's file round-trips end-to-end, asserting on real behavior rather than just compiling.
  • The actual committed test files ran green (20/20) inside a throwaway local SwiftPM package built around copies of the same sources. Before trusting that green run, I deliberately broke the backoff math (min(base, max) instead of min(base << exponent, max)) and re-ran — testDelayIncreasesWithMoreConsecutiveFailures went red as expected, confirming the test can actually fail, per AGENTS.md's "prove a new test can fail" rule.

None of this substitutes for CI's "iOS App Build & Test" job (xcodebuild against the real Xcode project on macos-26), which is the authoritative signal for this PR and the one I could not reproduce locally. Flagging this explicitly rather than claiming full local verification.

Risk / sensitive-path note

Issue #301 states this change "lands under Sources/VaultStore/**, which #300 just made a forced-human-merge path." At the time this PR was opened, #300 was still open/unimplemented, so this diff initially classified as risk:low. #300 has since merged to dev (346f61a, 2026-08-19T05:21:09Z), adding ios/LibraVaultApp/LibraVault/LibraVault/Sources/VaultStore/** to agent-policy.yml's sensitive_paths — a glob every file in this diff matches. QA caught that this branch was still based on the pre-#300 commit, so classify_pr_risk.py was evaluating a stale copy of the policy and had applied risk:low.

Fixed by rebasing this branch onto current dev (clean rebase, no conflicts — the four new files here don't overlap #300's one-line policy change or #296). The diff itself is unchanged: still exactly the 4 new files under Sources/VaultStore/**, 358 insertions, 0 deletions. With the branch now current, classify_pr_risk.py will re-run against the real policy on this push and should apply risk:high, forcing human merge as #300 intends. Flagging this explicitly so the principal review agent doesn't have to rediscover it from the diff alone.

Acceptance criteria (from #301)

  • Vault registry lists vaults (id, display name, created-at) without exposing any vault content or key material
  • Registry survives app restart (backed by a file, not just in-memory state)
  • Failed-PIN throttle backs off correctly (mirrors Android's UnlockAttemptThrottleTest.kt cases) and persists across app restart
  • Both are unit-testable without a real device (no Secure Enclave dependency)

Closes #301

@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@github-actions github-actions Bot added the risk:low Principal review classified this PR as low risk label Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@claude

claude Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

QA verification — PR #305 vs issue #301

Acceptance criteria (from #301)

  • PASS — Vault registry lists vaults (id, display name, created-at) without exposing vault content or key material. VaultRegistryEntry/VaultRegistry (VaultRegistry.swift) only ever handles id/displayName/createdAtEpochMillis; no VaultCrypto import, no key material referenced anywhere in the diff.
  • PASS — Registry survives app restart. Backed by vaults.json via Data(contentsOf:)/Data.write(to:options:.atomic), not in-memory state; verified by round-trip tests below.
  • PASS — Failed-PIN throttle backs off correctly and persists across restart. UnlockAttemptThrottle.remainingDelayMillis is byte-for-byte the same math as Android's core/vaultstore/UnlockAttemptThrottle.kt (FREE_ATTEMPTS=3, BASE_DELAY_MILLIS=1_000, MAX_DELAY_MILLIS=5*60*1_000, same shift-and-cap and same overflow guard coerceAtMost(20)/min(_, 20)), and UnlockAttemptThrottleTests.swift's 6 cases mirror UnlockAttemptThrottleTest.kt's 6 cases 1:1 by name and assertion. UnlockAttemptThrottleStore persists to unlock-throttle.json per vault dir; round-trip and "second reader instance" (simulated restart) tests pass.
  • PASS — Both unit-testable without a real device. Both production files import only Foundation (verified by reading both files in full — no Keychain/Secure Enclave/networking).

Tests run

No macOS/Xcode toolchain is available in this sandbox either (same limitation the PR description flags), so I did not run this repo's xcodebuild CI job. Instead I copied the four changed files as-is (unmodified) into a throwaway SwiftPM package on Linux Swift 6.3.3 and ran the actual committed test files directly:

Executed 20 tests, with 0 failures (0 unexpected) in 0.319 seconds

All 20 tests in VaultRegistryTests, UnlockAttemptThrottleTests, and UnlockAttemptThrottleStoreTests pass.

Confirmed the tests aren't vacuous (AGENTS.md "prove a new test can fail" / this repo's Pocket-TTS mock-past-the-bug history) by breaking two things and re-running:

  • Reverted the exponential shift to min(baseDelayMillis, maxDelayMillis) → testDelayIncreasesWithMoreConsecutiveFailures correctly went red (2 failures).
  • Disabled the duplicate-id guard in VaultRegistry.add → 7 of 9 VaultRegistryTests correctly went red (duplicate-id rejection cascades into several other tests via shared setup, as expected).

Both breaks were reverted after confirming red, no repo files were touched (git status clean, verification lived entirely under /tmp).

The diff is iOS-only (4 new files under ios/...); no JVM/Kotlin files changed, so ./gradlew testDebugUnitTest is not applicable here.

Regressions / other checks

  • Diff is exactly the 4 files claimed (358 insertions, 0 deletions) — no other files touched.
  • No naming collisions: VaultRegistryEntry/VaultRegistry/UnlockAttemptThrottle/UnlockAttemptThrottleStore are unique in the iOS tree.
  • Confirmed Sources/ is registered as a PBXFileSystemSynchronizedRootGroup in project.pbxproj, so the "no .pbxproj change needed" claim checks out — new files really are picked up automatically.

AGENTS.md conventions — violation found

Tests exist for non-trivial changes (pass), Conventional Commits format (pass), no hardcoded versions (pass, N/A). But: "Keep dev clean — rebase feature branches onto dev before opening a PR" is not satisfied, and in this case it's load-bearing, not cosmetic:

Fix: rebase this branch onto current dev (no conflicts expected — the four new files don't overlap anything #300 or the other new dev commit touch) and re-push so classify_pr_risk.py re-runs and applies the correct risk:high label.

The two production files and their tests are solid on their own merits — this is a process gap, not a code defect — but per AGENTS.md ("flag violations even if functionally the change works") and given the safety intent it defeats if unaddressed, I can't pass this as-is.

QA verdict: FAIL

@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:in-progress Dev agent is actively implementing label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor
QA failed its first round — routing back to the dev agent for one automated retry.

@github-actions
github-actions Bot force-pushed the feature/ios-vault-registry-throttle branch from d930fc3 to 60e21a9 Compare August 19, 2026 05:31
@libravault-pipeline-bot
libravault-pipeline-bot Bot force-pushed the feature/ios-vault-registry-throttle branch from 60e21a9 to 02ac244 Compare August 19, 2026 05:41
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@github-actions

Copy link
Copy Markdown
Contributor

Dev agent — addressed QA round 1 feedback

QA's only finding was a process gap, not a code defect: this branch was still based on the pre-#300 commit of dev, so classify_pr_risk.py was evaluating a stale copy of .github/agent-policy.yml (missing #300's new Sources/VaultStore/** sensitive-path entry) and had applied risk:low.

Fixed:

  • Rebased the branch onto current dev (clean, no conflicts — confirmed via git rebase origin/dev). The diff is unchanged: the same 4 new files, 358 insertions, 0 deletions.
  • Updated the PR description's "Risk / sensitive-path note" to reflect that chore(agent-policy): mark iOS Sources/VaultStore as a sensitive path #300 has landed and this should now classify risk:high.
  • Re-pushed and confirmed all CI is green: JVM Tests, iOS App Build & Test (Simulator), iOS UI Tests (informational), Build Android App all SUCCESS.

Note for anyone reading the Actions history: the first re-push (via the default GITHUB_TOKEN-backed git identity) landed in action_required and never ran — this repo requires the pipeline App's identity to trigger workflow runs without manual approval. Re-pushed the same commit via the app-token remote and CI ran normally from there; the stuck action_required runs are cosmetic leftovers in the Actions tab.

Production code and tests are unchanged from the original submission — only the base commit and PR description moved.

@github-actions github-actions Bot added risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge and removed risk:low Principal review classified this PR as low risk status:in-progress Dev agent is actively implementing labels Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-info Dev/QA agent needs more detail before proceeding label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR's branch is stale relative to dev — specifically, .github/workflows/qa-agent.yml differs between this branch and dev. GitHub Actions refuses to mint the OIDC token claude-code-action needs when a pull_request-triggered, id-token: write workflow's own file doesn't byte-match the base branch (its own anti-tampering check), so the QA agent step was skipped rather than silently no-opping (see issue #254 for the full diagnosis). Rebase/merge dev into this branch and re-add status:needs-qa to retry.

Copy link
Copy Markdown
Collaborator

Automated pipeline health check: Diagnosed the stale-branch comment above — not self-healing it, flagging for a human instead.

This is the documented #254 stale-branch/OIDC pattern (.github/workflows/qa-agent.yml differs from dev on this branch), which this routine can normally auto-rebase-and-repush. Not here: the branch's 4 changed files are all under ios/LibraVaultApp/LibraVault/LibraVault/Sources/VaultStore/**, which is explicitly listed in .github/agent-policy.yml's sensitive_paths (added by PR #300, merged 2026-08-19T05:21:09Z) — the same sensitive-path addition this PR's own QA round flagged. This routine's rules exclude any PR touching a sensitive path from the automated-rebase self-heal, specifically so a sensitive-path PR always gets a human rebase rather than an unattended one.

Net: a human needs to rebase this branch onto current dev and re-add status:needs-qa. Worth noting while you're there — the previous QA-round rebase (05:59:22Z comment) already flagged this PR should reclassify to risk:high once #300 landed, which it now has; expect classify_pr_risk.py to apply risk:high on the next clean run.


Generated by Claude Code

…Vaults

Swift equivalents of Android's core:vaultstore VaultRegistry.kt and
UnlockAttemptThrottle.kt, split out of #201/#190 as the two pieces of
that scope with no cryptographic risk of their own.

- VaultRegistry: plaintext JSON list of which vaults exist (id, display
  name, created-at), backed by a file under a caller-supplied base
  directory. Mirrors the Android type's atomic write-to-temp-then-rename
  and accepted-residual-leak reasoning (docs/threat-model.md).
- UnlockAttemptThrottle: same pure exponential-backoff math as Android's
  object, unit-testable with no I/O. Its state (failedAttempts,
  lastAttemptEpochMillis) is persisted per-vault by the new
  UnlockAttemptThrottleStore, matching the "per-vault config file"
  location docs/threat-model.md already documents for this data - kept
  as its own small file rather than folded into a VaultConfig type,
  since iOS has no such crypto-config persistence yet.

Both types depend only on Foundation - no Keystore/Secure Enclave, no
networking - and are exercised by new XCTest suites mirroring Android's
VaultRegistryTest.kt/UnlockAttemptThrottleTest.kt coverage, including a
persistence round-trip test for the throttle store.

No Xcode/macOS toolchain is available in the dev-agent's sandbox, so the
new files were verified with the Linux Swift toolchain instead: a
type-check compile, a standalone runtime sanity script exercising both
types end-to-end, and the actual test files running green under a
throwaway SwiftPM package (20/20 passed), with one assertion deliberately
broken first to confirm it fails red. CI's "iOS App Build & Test" job
(xcodebuild against the real Xcode project) is the authoritative run.

Closes #301
@libravault-xyz
libravault-xyz force-pushed the feature/ios-vault-registry-throttle branch from 02ac244 to ed2e83a Compare August 19, 2026 08:52
@libravault-xyz libravault-xyz added status:needs-qa PR open, awaiting qa-agent verification and removed status:needs-info Dev/QA agent needs more detail before proceeding labels Aug 19, 2026
@libravault-xyz

Copy link
Copy Markdown
Collaborator

Human rebase (via Claude Code), per the pipeline health check's ask above. Rebased onto current dev (clean, no conflicts — same 4 files, 358 insertions, 0 deletions, unchanged). .github/workflows/qa-agent.yml now byte-matches dev, so the OIDC anti-tamper check that skipped QA last time shouldn't trip again. Force-pushed and re-added status:needs-qa to retry.

@claude

claude Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

QA verification — PR #305 vs issue #301

Investigation method note: No macOS/Xcode toolchain is available in this
environment (same constraint the PR author flagged), so I could not run
xcodebuild test against the real Xcode target. I instead independently
verified with the Linux Swift 6.3 toolchain by building the two new
production files (VaultRegistry.swift, UnlockAttemptThrottle.swift) plus
the two actual committed test files (VaultRegistryTests.swift,
UnlockAttemptThrottleTests.swift) into a standalone SwiftPM package (no
mocks, no rewriting — the exact files from this PR). This is independent
re-verification of the PR author's own claimed local check, not a repeat of
it.

Acceptance criteria (from #301)

  • Vault registry lists vaults (id, display name, created-at) without exposing vault content or key material — VaultRegistryEntry carries only id/displayName/createdAtEpochMillis; no key material or vault content type is referenced anywhere in VaultRegistry.swift. Verified by reading the source and its tests.
  • Registry survives app restart (file-backed) — VaultRegistry.list/add/remove/rename all read/write vaults.json under baseDir via Data.write(to:options:.atomic); testWriteSurvivesAcrossASecondReaderInstance-equivalent coverage exists (testAddThenListRoundTrips, testRemoveDropsOnlyTheMatchingId, etc., each via a fresh list() call reading only from disk).
  • Failed-PIN throttle backs off correctly (mirrors Android's UnlockAttemptThrottleTest.kt) and persists across restart — UnlockAttemptThrottle.swift's backoff math (freeAttempts=3, baseDelayMillis=1_000, maxDelayMillis=300_000, min(base << exponent, max)) is byte-for-byte identical to core/vaultstore/UnlockAttemptThrottle.kt. All 6 Kotlin test cases have a matching Swift test with matching inputs/assertions. UnlockAttemptThrottleStore provides the restart-persistence piece (file-backed, same atomic-write pattern), with its own round-trip tests (testWriteThenReadRoundTrips, testWriteSurvivesAcrossASecondReaderInstance, testLatestWriteWinsOnOverwrite).
  • Both unit-testable without a real device (no Secure Enclave dependency) — both files import Foundation only; no Keychain/Security/CryptoKit imports. Confirmed by reading the full source of both files.

What I ran

Built the exact committed files (2 production + 2 test files, byte-identical copies from the working tree — nothing rewritten) into a throwaway SwiftPM package and ran swift test:

Test Suite 'All tests' passed at 2026-08-19 08:55:57
	 Executed 20 tests, with 0 failures (0 unexpected) in 0.319 seconds

All 20 tests (6 UnlockAttemptThrottleTests + 5 UnlockAttemptThrottleStoreTests + 9 VaultRegistryTests) pass.

Confirmed the tests can actually fail (AGENTS.md "prove a new test can fail" rule), independently of the PR author's own claimed check: mutated UnlockAttemptThrottle.swift's backoff line from min(baseDelayMillis << exponent, maxDelayMillis) to min(baseDelayMillis, maxDelayMillis) (removes the exponential growth) and re-ran:

error: UnlockAttemptThrottleTests.testDelayIncreasesWithMoreConsecutiveFailures :
  XCTAssertGreaterThan failed: ("1000") is not greater than ("1000")
Executed 20 tests, with 2 failures (0 unexpected)

Went red as expected, then reverted. The test suite genuinely exercises the real backoff math, not a mock.

Regression / related-area check

  • No symbol collisions with the other files already in Sources/VaultStore/ (HardwareKeyWrap.swift, SecureEnclaveHardwareKeyWrap.swift, VaultManifest.swift) — checked all top-level type declarations across the directory.
  • Test case coverage is a 1:1 match against core/vaultstore/src/test/kotlin/.../VaultRegistryTest.kt and UnlockAttemptThrottleTest.kt (same case names, same inputs), plus extra persistence-round-trip cases for UnlockAttemptThrottleStore, which has no direct Android analogue in this PR's scope.

Risk-classification note (verified, not just trusted)

The PR body claims this branch was rebased onto dev post-#300 (which added Sources/VaultStore/** to agent-policy.yml's sensitive_paths), so risk:high should legitimately apply. Verified independently:

  • git merge-base --is-ancestor origin/dev HEAD → true (branch is current with dev, includes commit 346f61a "mark iOS Sources/VaultStore as a sensitive path (chore(agent-policy): mark iOS Sources/VaultStore as a sensitive path #300)").
  • .github/agent-policy.yml line 41 lists ios/LibraVaultApp/LibraVault/LibraVault/Sources/VaultStore/**, which matches all 4 changed files.
  • PR already carries risk:high. Confirmed correct, not just asserted.

AGENTS.md conventions

  • Tests committed alongside the new behaviour (required for non-trivial changes): yes.
  • Real filesystem checks via temp dirs, no mocked I/O: yes (FileManager.default.temporaryDirectory + real read/write in both test files).
  • Conventional commit message (feat(ios): …), single commit for a cohesive add-with-tests change: yes.
  • "Prove a new test can fail": independently re-confirmed above, not just taken on the PR author's word.

No gaps found against the issue's acceptance criteria or the repo's testing conventions.

QA verdict: PASS

@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-review QA passed, awaiting principal-review-agent label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@github-actions

Copy link
Copy Markdown
Contributor

Principal review — PR #305

Verdict: human-merge (risk:high is correct — routing per policy, not due to any blocking defect found)

Risk label sanity check

Commits landed after risk:high was last set (rebase onto current dev at 08:52 UTC, label applied 05:59 UTC on the pre-rebase push), so I re-ran .github/scripts/classify_pr_risk.py origin/dev origin/feature/ios-vault-registry-throttle myself rather than trusting the label as-is. It reproduces risk:high: ios/.../Sources/VaultStore/UnlockAttemptThrottle.swift matches sensitive_paths pattern ios/LibraVaultApp/LibraVault/LibraVault/Sources/VaultStore/** (added by #300). Branch is cleanly rebased — git merge-base origin/dev origin/feature/ios-vault-registry-throttle equals origin/dev's HEAD.

Ground-truth verification (not taking the PR/QA claims at face value)

  • Math parity: read UnlockAttemptThrottle.swift against core/vaultstore/UnlockAttemptThrottle.kt side by side — freeAttempts=3, baseDelayMillis=1_000, maxDelayMillis=300_000, same min(base << exponent, max) shift-and-cap, same min(exponent, 20) overflow guard. Genuinely identical, not just claimed identical.
  • CI: watched run 32234758980 (iOS App Build & Test) to completion myself rather than trusting "CI is green" secondhand. Confirmed in the raw logs that xcodebuild compiled VaultRegistryTests.swift/UnlockAttemptThrottleTests.swift into the real LibraVaultTests target (@testable import LibraVault) and both suites passed on-device-simulator, not just in the dev/QA agents' throwaway Linux SwiftPM sandboxes. JVM Tests (32234759066) and Build Android App also green.
  • Scope: diff is exactly the 4 files claimed (358 insertions), no other sensitive paths touched, no networking introduced, no status:blocked on this PR or issue [Feature] iOS Encrypted Vaults 2a/2d: VaultRegistry + UnlockAttemptThrottle #301.

Findings

No CONFIRMED blocking defects. One minor, non-blocking observation for whoever builds the first caller on top of these types:

  • VaultRegistry.list and UnlockAttemptThrottleStore.read both swallow JSON-decode failures via try? … ?? default (empty list / .initial state), whereas the Android counterparts (VaultRegistry.list, VaultConfig.read) throw on a malformed file. A corrupted vaults.json would silently present as "no vaults" rather than a surfaced error. This matches an existing convention already used elsewhere in the iOS codebase (Vault.swift, ReadingDataPersistence.swift), so it's not a novel deviation this PR introduced — just worth knowing about since neither type has a caller wired up yet, and the doc comments' "mirrors Android" claim is slightly stronger than the actual behavior on the corruption path.

The two production types and their tests are solid: no crypto/Keychain/networking imports, atomic writes, tests mirror the Kotlin suite 1:1 and were confirmed non-vacuous by the QA agent's break-and-reverify pass. Routing to human-merge is purely the sensitive_paths policy match, working as intended after #300.

@github-actions github-actions Bot removed the status:needs-review QA passed, awaiting principal-review-agent label Aug 19, 2026
@github-actions github-actions Bot added the status:needs-human-merge Principal review done, requires human merge decision label Aug 19, 2026
@libravault-xyz
libravault-xyz merged commit 016e2d9 into dev Aug 19, 2026
14 checks passed
@libravault-xyz
libravault-xyz deleted the feature/ios-vault-registry-throttle branch August 19, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge status:needs-human-merge Principal review done, requires human merge decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] iOS Encrypted Vaults 2a/2d: VaultRegistry + UnlockAttemptThrottle

1 participant