Skip to content

feat: derive causal diagnostics roundtrip - #128

Merged
psimaker merged 2 commits into
mainfrom
agent/app-causal-roundtrip
Jul 15, 2026
Merged

feat: derive causal diagnostics roundtrip#128
psimaker merged 2 commits into
mainfrom
agent/app-causal-roundtrip

Conversation

@psimaker

@psimaker psimaker commented Jul 15, 2026

Copy link
Copy Markdown
Owner

What & why

Implement the owner-authorized M7 causal-roundtrip derivation of Decision 024 step 10. roundtrip confirmed is set in exactly one place — the download acceptance of the same active operation — after that acceptance has already validated the request, attestation, authorization, response signature, keys, epochs, homeserver/folder bindings, operation ID, nonces, digests, payloads, and TTL for one explicit tuple. No new message type, endpoint, helper, bridge, Relay, or wire change ships with this milestone.

The signed owner-device suite was not executed — owner-approved physical-device waiver (2026-07-15). It is replaced by fresh exact-head simulator and isolated Syncthing substitute evidence listed under Testing; no real-device, hardware-keychain, real-APNs, background-wake, or TestFlight-hardware behavior is claimed.

Evidence boundary

  • Upload: unchanged from the M5 boundary.
  • Download: unchanged from the M6 boundary.
  • Roundtrip: derives only from the same operation's accepted upload then accepted download for the exact validated chain. No timestamp, HTTP status, Relay observation, APNs, scan/index/idle state, capability reachability, cleanup result, tombstone, or foreign-operation artifact can set it. The claim is scoped causal propagation for one operation — never global sync health, future delivery, byte accounting, or a direct-peer claim.
  • Cleanup: evidence-orthogonal; no app cleanup workflow is added here.
  • Helper wire surface: byte-identical helper 2.0.2.
  • Decision 024 remains unchanged at blob f41f597d3ceca73da102e5e447382dfae07d2e08.

Component(s)

  • go (bridge / Syncthing) — untouched
  • ios (app / widget)
  • notify — untouched (E2E and guard tests re-run unchanged)
  • docs

Testing

  • M5/M6 runtime suites re-run with the derivation: the exact fresh chain ends roundtrip confirmed with all three evidence fields; stale, tampered, generation-changed, cancelled, restarted, and rate-limited scenarios keep roundtrip false
  • Cross-operation replay property: a valid response artifact from a completed operation republished at a second operation's exact path fails chain validation and ends as conflict without download or roundtrip evidence
  • Cross-language golden vectors with per-byte tamper rejection (unchanged, re-run)
  • Both isolated two-instance Syncthing E2E tests re-run in the no-network container at this head
  • cd notify && go test ./... -count=1 on macOS, plus go vet and gofmt
  • Complete iOS plan passed with zero failed/skipped
  • Release-configuration iOS Simulator build
  • Design-token lint, strings parity (884 keys), sync-proof privacy lint
  • Signed owner-device focused suite: not executed — owner-approved physical-device waiver; substitute evidence is the fresh simulator plan, focused suites, Release-configuration simulator build, and isolated two-instance Syncthing E2E above

Compatibility and rollback

Existing-user upgrade, app launch, Settings inspection, Relay/APNs activity, and ordinary/background sync create no key, pairing, trust, namespace, peer, share, artifact, rescan, or configuration change. Old or downgraded helpers yield capability unavailable without fallback. App/helper rollback preserves credentials, namespace authorization, opaque copies, backups, versions, conflicts, history, tombstones, mappings, and user data; retained copies never regain validity and cannot derive a late roundtrip. Forward recovery starts with a fresh capability and never resumes an old proof.

Security and privacy

The derivation adds no transport, storage, logging, telemetry, crash annotation, durable proof, Relay/APNs/StoreKit call, or global success flag. The user-facing copy in all four languages states the scoped claim explicitly: one operation's causal propagation, never global sync health.

psimaker added 2 commits July 15, 2026 11:58
Set roundtrip confirmed in exactly one place: the download acceptance
of the same active operation, which already validated the request,
attestation, authorization, response, keys, epochs, bindings, nonces,
digests, payloads, and TTL for one explicit tuple. No new message
type, endpoint, helper, bridge, or wire behavior is added.

Cover the cross-operation replay property: a valid response artifact
republished at a second operation's exact path fails chain validation
and ends as conflict without download or roundtrip evidence.
Record the M7 evidence boundary: the roundtrip field derives only from
the same operation's upload-then-download chain and claims scoped
causal propagation — never global sync health, future delivery, byte
accounting, or a direct peer. Real-device evidence remains explicitly
owner-waived; VaultSync 2.0 stays NO-GO until release and rollout.
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The PR defines same-operation causal roundtrip evidence, records it after validated upload and download acceptance, updates diagnostics UI/localizations, and adds failure plus cross-operation replay tests.

Causal roundtrip diagnostics

Layer / File(s) Summary
Roundtrip evidence contract
PRIVACY.md, docs/architecture.md, docs/m7-causal-roundtrip-readiness.md
Documents roundtrip confirmation as requiring accepted upload and download results from the same active operation, with replay, rollback, and verification constraints.
Runtime state and diagnostics presentation
ios/VaultSync/Services/DiagnosticsPairingController.swift, ios/VaultSync/Views/ControlledDiagnosticsView.swift, ios/VaultSync/*/Localizable.strings
Adds the roundtripConfirmed phase and evidence field, sets them after validated download acceptance, and updates diagnostics messaging, symbols, colors, and translations.
Failure and cross-operation validation
ios/VaultSyncTests/DiagnosticsControlledDownloadRuntimeTests.swift, ios/VaultSyncTests/DiagnosticsForegroundUploadRuntimeTests.swift
Asserts roundtrip remains unset for failure paths and rejects replaying a response artifact under a different operation identifier.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Poem

Upload knocks, download replies,
One operation earns its prize.
Replays fade at the guarded gate,
Failures keep the flag at zero state.
Roundtrip confirmed—precise and bright!

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
No Private Note Leakage ❓ Inconclusive pending evidence Need to inspect the changed Swift/docs files for any new logging, analytics, crash, or network code that could carry note contents or secrets.
✅ Passed checks (6 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Bounded Ios Background Work ✅ Passed PASS: this PR keeps the diagnostics work bounded, cancellation-aware, and cleaned up on disappear/scene-phase changes, with generic errors and no background-task API changes.
Bridge Contract Compatibility ✅ Passed Branch diff against origin/main touches docs/UI/tests only; go/bridge/* and SyncBridgeService.swift are unchanged, so gomobile types, JSON shapes, and empty-string returns remain intact.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise, conventional-commit style, and accurately summarizes the main change: deriving causal diagnostics roundtrip.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/app-causal-roundtrip

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@psimaker
psimaker marked this pull request as ready for review July 15, 2026 10:10
@psimaker
psimaker merged commit 948b6ec into main Jul 15, 2026
19 checks passed
@psimaker
psimaker deleted the agent/app-causal-roundtrip branch July 15, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant