Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d76a624
docs(22): capture phase context
FSM1 Mar 25, 2026
b0eec83
docs(22): research phase domain
FSM1 Mar 25, 2026
e0ce3c6
docs(22): add validation strategy
FSM1 Mar 25, 2026
8818032
docs(22): create phase plan
FSM1 Mar 25, 2026
107823d
docs(22): update validation strategy with correct plan paths
FSM1 Mar 25, 2026
8da4fc9
test(22-01): add failing tests for perf instrumentation module
FSM1 Mar 25, 2026
36f835b
feat(22-01): implement perf.ts with environment-gated Performance API…
FSM1 Mar 25, 2026
6f458d7
test(22-03): add failing tests for threshold checking module
FSM1 Mar 25, 2026
d4dacae
test(22-02): add Playwright journey timing spec for 3 user journeys
FSM1 Mar 25, 2026
5a86234
feat(22-03): implement threshold checking module
FSM1 Mar 25, 2026
01d1104
docs(22-02): add journey timing baselines template for 3 user journeys
FSM1 Mar 25, 2026
868f610
feat(22-03): integrate threshold checks into all 5 load test scenarios
FSM1 Mar 25, 2026
1fc6cf6
feat(22-01): instrument 10 sdk-core functions with Performance API wr…
FSM1 Mar 25, 2026
0f60e0a
docs(22-02): complete journey timing baselines plan
FSM1 Mar 25, 2026
7cbed45
docs(22-03): create comprehensive capacity model document
FSM1 Mar 25, 2026
ee8621d
docs(22-01): complete SDK performance instrumentation plan
FSM1 Mar 25, 2026
17ecf67
docs(22-03): complete thresholds and capacity model plan
FSM1 Mar 25, 2026
afb70e3
docs(phase-22): complete phase execution
FSM1 Mar 25, 2026
b7fb166
docs(phase-22): evolve PROJECT.md after phase completion
FSM1 Mar 25, 2026
94fb2cb
refactor(22): clean up phase 22 code after review
FSM1 Mar 25, 2026
ad41d8e
docs(22): populate journey timing baselines from staging run
FSM1 Mar 25, 2026
128e8f2
fix(22): address PR review comments
FSM1 Mar 25, 2026
7f0bcf8
fix(22): address second round of PR review comments
FSM1 Mar 25, 2026
664f758
fix(22): change raw data code fence from json to text
FSM1 Mar 25, 2026
e730262
fix(22): fix misleading JSDoc on expectThresholdsPassed
FSM1 Mar 25, 2026
0d65774
merge: integrate main (Phase 21 completion) into phase 22 branch
FSM1 Mar 25, 2026
b778925
feat(22): instrument BYO pinFn path with ipfs:upload:byo perf marker
FSM1 Mar 25, 2026
fd80a77
refactor(22): rename ipfs:upload marker to ipfs:upload:cipherbox
FSM1 Mar 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .planning/PROJECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ See `.planning/REQUIREMENTS.md` for full requirements.

---

Last updated: 2026-03-25 after Phase 21 BYO-IPFS Node Support completed
Last updated: 2026-03-25 after Phase 22 Performance Baselines Completion completed
16 changes: 8 additions & 8 deletions .planning/REQUIREMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ Requirements for IPFS infrastructure milestone. Each maps to roadmap phases.
- [x] **PERF-02**: API endpoint p50/p95/p99 baselines defined per critical route
- [x] **PERF-03**: Kubo Prometheus endpoint scraped for node health metrics (peers, bandwidth, datastore)
- [x] **PERF-04**: TEE republish batch duration histogram added
- [ ] **PERF-05**: Client-side timing instrumentation for encrypt/decrypt, upload/download, IPNS operations
- [ ] **PERF-06**: End-to-end user journey timing captured (login-to-vault, upload-to-visible, share-to-accessible)
- [ ] **PERF-07**: k6 load testing scripts simulating concurrent users (upload, download, publish, resolve)
- [ ] **PERF-08**: Capacity thresholds documented with scaling recommendations
- [x] **PERF-05**: Client-side timing instrumentation for encrypt/decrypt, upload/download, IPNS operations
- [x] **PERF-06**: End-to-end user journey timing captured (login-to-vault, upload-to-visible, share-to-accessible)
- [x] **PERF-07**: Vitest-based SDK load harness simulating concurrent users (upload, download, publish, resolve)
- [x] **PERF-08**: Capacity thresholds documented with scaling recommendations
- [x] **PERF-09**: Upload operations optimized via concurrent SDK pin orchestration (Promise.allSettled) and Kubo pebbleds datastore, with before/after baselines documented

### SDK Extraction (Phase 19.1)
Expand Down Expand Up @@ -131,10 +131,10 @@ Which phases cover which requirements. Updated during roadmap creation.
| PERF-02 | Phase 18 | Complete |
| PERF-03 | Phase 18 | Complete |
| PERF-04 | Phase 18 | Complete |
| PERF-05 | Phase 22 | Pending |
| PERF-06 | Phase 22 | Pending |
| PERF-07 | Phase 22 | Pending |
| PERF-08 | Phase 22 | Pending |
| PERF-05 | Phase 22 | Complete |
| PERF-06 | Phase 22 | Complete |
| PERF-07 | Phase 22 | Complete |
| PERF-08 | Phase 22 | Complete |
| PERF-09 | Phase 19.2 | Complete |
| SDK-01 | Phase 19.1 | Complete |
| SDK-02 | Phase 19.1 | Complete |
Expand Down
31 changes: 19 additions & 12 deletions .planning/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Decimal phases appear between their surrounding integers in numeric order.
- [x] **Phase 19.2: IPFS Upload Performance Optimization** - Optimize Kubo pinning path (concurrent pins, worker tuning, pin batching) to reduce upload latency (INSERTED) (completed 2026-03-23)
- [x] **Phase 20: Vault Migration** - Move rootFolderKey to IPFS vault blob v2 format, making the server store zero crypto material (gap closure in progress) (completed 2026-03-24)
- [x] **Phase 21: BYO-IPFS Node Support** - User-configurable IPFS pinning endpoint with dual-pin strategy, Settings UI, and connection testing (gap closure in progress) (completed 2026-03-25)
- [ ] **Phase 22: Performance Baselines Completion** - Client-side timing instrumentation, end-to-end journey timing, k6 load testing, and capacity documentation
- [x] **Phase 22: Performance Baselines Completion** - Client-side timing instrumentation, end-to-end journey timing, Vitest-based load testing, and capacity documentation (completed 2026-03-25)
- [x] **Phase 23: Rust SDK Extraction** - Extract five Rust crates (crypto, core, api-client, fuse, sdk) mirroring the TypeScript SDK hierarchy, replace duplicated logic in desktop FUSE code, enable unit testing at same granularity as TypeScript (completed 2026-03-24)

## Phase Details
Expand Down Expand Up @@ -166,7 +166,14 @@ Plans:
2. End-to-end user journey timings are captured for login-to-vault, upload-to-visible, and share-to-accessible workflows
3. k6 load test scripts simulate concurrent users performing upload, download, publish, and resolve operations with documented pass/fail thresholds
4. Capacity thresholds are documented with scaling recommendations (max concurrent users, storage growth projections, IPNS publish throughput limits)
**Plans**: TBD

**Plans:** 3/3 plans complete

Plans:

- [x] 22-01-PLAN.md -- SDK Performance API instrumentation (perf.ts module + instrument 11 sdk-core functions)
- [x] 22-02-PLAN.md -- Playwright journey timing tests (login-to-vault, upload-to-visible, share-to-accessible)
- [x] 22-03-PLAN.md -- Load test thresholds + capacity model document (thresholds.ts, update scenarios, docs/CAPACITY.md)

### Phase 23: Rust SDK Extraction

Expand Down Expand Up @@ -199,16 +206,16 @@ Plans:
**Execution Order:**
Phases execute in numeric order: 18 -> 19 -> 19.1 -> 19.2 -> 20 -> 21 -> 22

| Phase | Milestone | Plans Complete | Status | Completed |
| ----------------------------------------- | --------- | -------------- | ----------- | ---------- |
| 18. Performance Instrumentation | v1.1 | 2/2 | Complete | 2026-03-07 |
| 19. IPNS Resolution Improvement | v1.1 | 2/2 | Complete | 2026-03-07 |
| 19.1 Extract Core Crypto SDK | v1.1 | 6/6 | Complete | 2026-03-20 |
| 19.2 IPFS Upload Performance Optimization | v1.1 | 4/4 | Complete | 2026-03-23 |
| 20. Vault Migration | v1.1 | 6/6 | Complete | 2026-03-24 |
| 21. BYO-IPFS Node Support | v1.1 | 11/11 | Complete | 2026-03-25 |
| 22. Performance Baselines Complete | v1.1 | 0/? | Not started | - |
| 23. Rust SDK Extraction | v1.1 | 8/8 | Complete | 2026-03-24 |
| Phase | Milestone | Plans Complete | Status | Completed |
| ----------------------------------------- | --------- | -------------- | -------- | ---------- |
| 18. Performance Instrumentation | v1.1 | 2/2 | Complete | 2026-03-07 |
| 19. IPNS Resolution Improvement | v1.1 | 2/2 | Complete | 2026-03-07 |
| 19.1 Extract Core Crypto SDK | v1.1 | 6/6 | Complete | 2026-03-20 |
| 19.2 IPFS Upload Performance Optimization | v1.1 | 4/4 | Complete | 2026-03-23 |
| 20. Vault Migration | v1.1 | 6/6 | Complete | 2026-03-24 |
| 21. BYO-IPFS Node Support | v1.1 | 11/11 | Complete | 2026-03-25 |
| 22. Performance Baselines Complete | v1.1 | 3/3 | Complete | 2026-03-25 |
| 23. Rust SDK Extraction | v1.1 | 8/8 | Complete | 2026-03-24 |

---

Expand Down
21 changes: 13 additions & 8 deletions .planning/STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ gsd_state_version: 1.0
milestone: v1.1
milestone_name: milestone
status: unknown
last_updated: '2026-03-25T01:34:07.674Z'
last_updated: '2026-03-25T01:50:49.360Z'
progress:
total_phases: 8
completed_phases: 7
total_plans: 39
completed_plans: 39
completed_phases: 8
total_plans: 42
completed_plans: 42
---

# Project State
Expand All @@ -18,12 +18,12 @@ progress:
See: .planning/PROJECT.md (updated 2026-03-07)

**Core value:** Zero-knowledge privacy -- files encrypted client-side, server never sees plaintext
**Current focus:** Phase 21byo-ipfs-node-support
**Current focus:** Phase 22performance-baselines-completion (complete)

## Current Position

Phase: 21 (byo-ipfs-node-support) — EXECUTING
Plan: 4 of 4
Phase: 22 (performance-baselines-completion) — COMPLETE
Plan: 3 of 3 (COMPLETE)

## Performance Metrics

Expand Down Expand Up @@ -70,6 +70,9 @@ Plan: 4 of 4
| 21 | 10 | 5min | 2 | 7 |
| 21 | 09 | 9min | 3 | 17 |
| 21 | 11 | 12min | 2 | 3 |
| 22 | 02 | 4min | 2 | 2 |
| 22 | 01 | 8min | 2 | 7 |
| 22 | 03 | 8min | 2 | 8 |

## Accumulated Context

Expand Down Expand Up @@ -139,6 +142,8 @@ Recent for v1.1:
- pinWithMode treats Pinata like Kubo: direct upload bypasses CipherBox relay entirely
- Connection test probe order updated: Kubo -> Pinata -> PSA; pinata.cloud URLs skip Kubo probe
- BYO Pinata baselines: pin p50=2.0s (+47% vs local Kubo), tail latency p99 13.5% better, 98% CipherBox API load reduction per file
- perf.ts PERF_ENABLED evaluated once at module load (zero overhead in production); **CIPHERBOX_PERF** global for opt-in production debugging

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The state summary references a CIPHERBOX_PERF global flag, but the actual opt-in flag used by sdk-core perf gating is globalThis.__CIPHERBOX_PERF__ (double-underscore). This mismatch will mislead anyone trying to enable perf marks in production/debug builds; please update the flag name here to match the implementation.

Suggested change
- perf.ts PERF_ENABLED evaluated once at module load (zero overhead in production); **CIPHERBOX_PERF** global for opt-in production debugging
- perf.ts PERF_ENABLED evaluated once at module load (zero overhead in production); `globalThis.__CIPHERBOX_PERF__` global for opt-in production debugging

Copilot uses AI. Check for mistakes.
- Load test thresholds set at 2-3x observed baselines; spike test most generous (15s/15%); vitest expect() for CI failure on breach

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line says load-test thresholds use vitest expect() to fail CI on breach, but the scenarios now call expectThresholdsPassed(...), which logs violations and throws an Error (no vitest expect() involved). Please update the text to reflect the actual enforcement mechanism so the state doc stays accurate.

Suggested change
- Load test thresholds set at 2-3x observed baselines; spike test most generous (15s/15%); vitest expect() for CI failure on breach
- Load test thresholds set at 2-3x observed baselines; spike test most generous (15s/15%); enforced via expectThresholdsPassed(...) which logs violations and throws on breach to fail CI

Copilot uses AI. Check for mistakes.

### Roadmap Evolution

Expand All @@ -164,4 +169,4 @@ All M2 blockers resolved. See `.planning/milestones/m2/m2-v1.0-production-MILEST

---

Last updated: 2026-03-25 after completing Phase 21 plan 11 (BYO performance baselines with Pinata); gap closure 4/4 complete, Phase 21 fully complete
Last updated: 2026-03-25 after completing Phase 22 (performance baselines completion)
78 changes: 78 additions & 0 deletions .planning/baselines/22-journey-baselines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Performance Baselines - Phase 22 (Journey Timing)

> End-to-end user journey timing captured via Playwright with real browser rendering.
> Timings include network, crypto, IPFS operations, and browser paint.

## Capture Information

| Field | Value |
| ---------------- | ------------------------------------------------------------ |
| **Capture Date** | 2026-03-25 |
| **Environment** | Staging (api-staging.cipherbox.cc, app-staging.cipherbox.cc) |
| **Browser** | Chromium (Playwright managed, headless) |
| **Auth Method** | Mock wallet (EIP-1193 via @johanneskares/wallet-mock) |
| **Test File** | `tests/web-e2e/tests/journey-timing.spec.ts` |
| **API Version** | v0.27.0 (staging-cipher-box-v0.27.0-rc-1) |
| **VPS** | 4 vCPU, 8GB RAM (Hostinger) |

## Journey 1: Login-to-Vault

Measures wall-clock time from clicking the wallet login button through vault metadata loading and file list rendering.

| Phase | Duration |
| --------------- | -------- |
| **Wallet Auth** | 23,483ms |
| **Vault Load** | 86ms |
| **Total** | 23,569ms |

Includes: Core Kit initialization wait, mock wallet connect, SIWE signature, backend JWT exchange, vault metadata IPNS resolve, file list React render.

**Note:** Wallet auth dominates at 99.6% of total time. This is Web3Auth Core Kit MPC initialization + Sapphire Devnet DKG key generation for a brand-new identity. Repeat logins (existing identity) are expected to be significantly faster (5-10s).

## Journey 2: Upload-to-Visible

Measures wall-clock time from file input selection through the file appearing in the file list UI.

| Metric | Value |
| ------------------ | ------- |
| **File Size** | 100KB |
| **Total Duration** | 1,355ms |

Includes: AES-256-GCM encryption, IPFS ciphertext upload (pin), IPFS metadata upload (pin), IPNS file publish, folder metadata update, IPNS folder publish, React state update, file list re-render.

## Journey 3: Share-to-Accessible

Measures wall-clock time from Alice initiating a share through Bob seeing the shared item in the Shared section.

| Phase | Duration |
| -------------------------- | -------- |
| **Share Create (Alice)** | 2,236ms |
| **Recipient Access (Bob)** | 803ms |
| **Total** | 3,039ms |

Includes: ECIES key wrapping for recipient, share key API call, share dialog UI interaction, Bob's navigation to Shared section, share list API fetch, shared item rendering.

## Raw Data

```text
JOURNEY_TIMING: {"journey":"login-to-vault","totalMs":23569,"phases":{"walletAuthMs":23483,"vaultLoadMs":86}}
JOURNEY_TIMING: {"journey":"upload-to-visible","totalMs":1355,"fileSizeBytes":102400}
JOURNEY_TIMING: {"journey":"share-to-accessible","totalMs":3039,"phases":{"shareCreateMs":2236,"recipientAccessMs":803}}
JOURNEY_TIMING: {"summary":true,"capturedAt":"2026-03-25T02:58:23.753Z","journeys":[{"journey":"login-to-vault","totalMs":23569,"phases":{"walletAuthMs":23483,"vaultLoadMs":86}},{"journey":"upload-to-visible","totalMs":1355,"fileSizeBytes":102400},{"journey":"share-to-accessible","totalMs":3039,"phases":{"shareCreateMs":2236,"recipientAccessMs":803}}]}
```

## How to Recapture

Run the journey timing tests against staging:

```bash
cd tests/web-e2e && npx playwright test journey-timing.spec.ts --config /tmp/pw-staging.config.ts
```

Or against localhost with API + frontend running:

```bash
cd tests/web-e2e && pnpm exec playwright test tests/journey-timing.spec.ts
```

The test outputs structured JSON on each line prefixed with `JOURNEY_TIMING:`. The final summary line contains all journey results in a single JSON object.
Loading
Loading