Repository navigation
test(client): #46 regression + complete passwordless migration (#52) - #6
Conversation
…52, #49) - #52: use-passwordless.test.tsx pins the rollback-logout() failure swallow — a rejecting compensating logout() must keep the stage:"bridge" sentinel as the surfaced error (never the rollback error) and must not navigate. Mutation-verified (removing the .catch => red). - #46 boundary invariant: auth-service.test.ts asserts every stock-`api` auth call stays inside the ALB allow-list (collab-token/logout); session/registration ops reach the platform surface (/bff/*, /auth/*). - F1 (broad remediation): remove the now-dead password-lifecycle UI (change/forgot/reset- password + verify-token). Passwordless (issue #4) leaves no user password, and these Docmost /api/auth/* routes are ALB-blocked (403) in prod. `setupWorkspace` (operator first-run bring-up) is kept. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Review-coupling note: paired with parent PR cccvu/wiki-v2#132 — review together. The client tests changed here are executed and gated by the parent's new |
⚡ Performance ReviewReviewer: Performance Reviewer Summary: This is a test + CI + dead-code-removal PR; production hot paths are untouched, and I confirmed that. No N+1s, no unbounded loops, no blocking I/O on any request path, no async misuse. The one perf-lens observation is CI wall-clock: the new Findings[Minor] — Async misuse / CI duplication —
|
🎨 Frontend / UI / UX ReviewReviewer: Frontend / UI / UX Reviewer Summary: F1 cleanly removes the dead password-lifecycle UI. Crucially there is no dangling dead link — nothing in the app navigates to Findings2. Is it consistent with the rest of the app?[Minor] — Dead route constants left behind —
|
🐛 Correctness Review — Bug HunterReviewer role: Correctness Reviewer Verdict✅ Approve I tried to break the four things this PR pair rests on — the pg-callsites AST invariant, the REDIS SummaryParent docmost#132 adds a TypeScript-AST invariant that every Findings🟡 Minor (optional, Level 2) — [wiki-v2] pg-callsites scan misses namespace/default/
|
🧪 Test Review — QA Engineer's EyeReviewer role: Test Reviewer
Verdict✅ Approve Adequately and durably tested to merge. The load-bearing regression paths for both incidents (#44 DB-URL driver split, #46 login/BFF routing + rollback) are now guarded by tests that actually go red when the behavior breaks — I traced the mutations by hand. The new SummaryTwo coupled PRs completing the passwordless migration and adding regression guards. Parent adds Findings🟡 Minor — [PARENT] pg-callsite scan is blind to default/namespace
|
| Behavior / branch | Repo | Covered? | Test that guards it |
|---|---|---|---|
Every pg Pool/Client (named-import site) built via toPgConnection |
PARENT | ✅ | pg-callsites.spec.ts — raw new Pool({connectionString}) & variable-indirection both flagged; direct + spread forms both accepted |
| Scan fails-closed when it matches nothing (no vacuous pass) | PARENT | ✅ | pg-callsites.spec.ts:117-120 (files.length>0 && sites.length>0) |
pg Pool/Client via default/namespace import + new pg.Pool() |
PARENT | ❌ | none — see 🟡 L3 finding |
REDIS_URL accepts redis:// / rediss://, rejects foreign scheme |
PARENT | ✅ | db-url-contract.spec.ts:91-103 |
| REDIS_URL flags any query param (cross-consumer drift) | PARENT | ✅ | db-url-contract.spec.ts:105-109 |
redis kind does not bleed requireTls into redis; unset ok |
PARENT | ✅ | :111-118 |
redis kind does not disturb postgres sslmode/requireTls/forbidden logic |
PARENT | ✅ | postgres suite intact :6-88; kind discriminator asserted :83-86 |
Gate 7 (runCli) excludes REDIS_URL — absent & broken redis still pass |
PARENT | ✅ | :155-163 |
main.ts boot-lint calls lintDbUrl on cfg.redis.url |
PARENT | covered indirectly by lintDbUrl unit tests; the one array-entry wiring line is not asserted (same as the pre-existing DOCMOST/PLATFORM entries) — thin, low value |
|
| CI: fork client Vitest suite actually runs and gates | PARENT | ✅ | docmost-client in ci-ok.needs + assert loop; vitest run, no continue-on-error/passWithNoTests; skipped/cancelled ⇒ fail-closed |
| Passwordless: BFF bridge runs after verify, before navigate | FORK | ✅ | use-passwordless.test.tsx:35-51 |
| Bridge failure → rollback logout + no navigate | FORK | ✅ | :53-63 |
Rollback logout() itself rejects → bridge sentinel still surfaced, no navigate |
FORK | ✅ | :71-94 — mutation-proof: removing .catch(()=>undefined) makes caught.message = "rollback logout failed" ≠ "session-bridge-failed" → red (traced by hand) |
logout clears both sessions even if platform leg rejects (allSettled) |
FORK | ✅ | auth-service.test.ts:43-49 |
Session/registration ops routed to platform, not ALB-blocked /api/auth/* (for the 3 invoked ops) |
FORK | ✅ | :65-82 (see 🟡 scoping note) |
A newly-added stock-api op toward a blocked path |
FORK | not auto-covered — see 🟡 L2 finding | |
| Dead password-lifecycle code cannot be called | FORK | ✅ | strongest guard = deletion; no dangling imports (verified tree-wide) |
What I checked
- Behavior coverage — each new branch/path has a test that would fail if it regressed (mapped above; the one hole is the default/namespace-import scan case)
- Edge cases and boundaries — redis unset/foreign-scheme/query-param; postgres sslmode absent/disable/require/verify-full; rollback-failure branch
- Failure modes — bridge failure, rollback-logout also failing, platform-logout rejection under
allSettled, broken/absent REDIS_URL at the gate - Assertions are meaningful — traced mutations:
.catch(()=>undefined)removal reddens; re-routing an op onto stockapireddens; rawnew Poolflagged - Tests aren't brittle — all new tests deterministic (no time/random/network/order); noted the pg-scan's documented white-box tripwire
- Regression resistance — feat(authz): bounded append/prepend idempotency at the commit boundary (#429) #44 (driver split) and perf: lazy-load posthog-js (#406) and date-fns locales (#408) #46 (routing + rollback) both re-break red; dead UI guarded by deletion
- CI gating —
docmost-clientgenuinely gates (needs + loop, no escape, fail-closed on skip/cancel); confirmed theplatformjob'spnpm exec jestpicks up both newsrc/**/*.spec.tsandtypescriptis a declared dep so the AST scan runs
Open questions for the author
- [PARENT] pg-scan import styles — was the named-import-only scope of
pg-callsites.spec.tsintentional, given the docstring's "any present or future site" claim? (See 🟡 L3.) A one-line docstring narrowing or a namespace-import branch resolves it. - [FORK] auth-service boundary scope — is limiting the "allow-list" loop to the 3 manually-invoked ops (excluding
getCollabToken/setupWorkspaceand any future op) the intended contract? (See 🟡 L2.) - [PARENT] Confirm the
main.tsREDIS boot-lint entry (['REDIS_URL', cfg.redis.url]) is deliberately left to indirect coverage vialintDbUrlunit tests (consistent with the existing DOCMOST/PLATFORM entries) rather than a boot-suite assertion — I treated it as an accepted, pre-existing pattern, not a new gap.
🏛️ Architecture ReviewReviewer: Architecture Reviewer Summary: Both diffs are structurally clean and seam-consistent. The F1 removal respects the upstream-minimal boundary (every touched upstream file carries a documented Findings[Minor] — Code organization / Maintainability — FORK
|
🚀 DevOps / Operations / Reliability ReviewReviewer role: DevOps / Operations / Reliability Reviewer Verdict✅ Approve Safe to deploy and operate. This is a CI-gating + regression-guard change plus deletion of already-broken (ALB-403'd) dead UI — no runtime service behavior changes, no migration, no new secret/SSM read, no new crash path. The one operational-graph nit ( Blast radiusParent docmost#132: CI topology (a new required gate) + a deploy-adjacent boot-lint (REDIS_URL, log-only) + a fitness-check shell fix + a submodule pointer bump. The CI change gates every PR and every push:main (and therefore, transitively, every deploy). Fork #6: pure frontend deletion (dead password routes/forms/services/types) + two regression tests; no server, schema, or contract surface. The highest-leverage seam is the parent's SummaryThe parent adds a Findings🟡 Minor (optional, Level 2) — New required gate
|
🔒 Security ReviewSecurity Reviewer: Security Reviewer — Claude (independent Security lens, coupled two-PR review)
Verdict🟡 Approve with comments. Both diffs are sound and the security-critical behavior fails closed: the passwordless rollback never navigates into an authenticated view, Summary
Task-scale: BLOCKING 0 · OPTIONAL 5 · L3PLUS 1 · MAXSEV 3. Findings[MEDIUM] Passwordless invariant is network-gated, not removed — server-side Docmost password endpoints persist (guard-exempt, session-minting)
[LOW]
|
…iew) Round-1 review (Architecture L3; Frontend/Correctness/Testing) flagged the F1 password-UI removal as incomplete: two orphaned route constants and their only consumers survived as a self-contained dead subsystem. - app-route.ts: remove the dead AUTH.FORGOT_PASSWORD / AUTH.PASSWORD_RESET constants - api-client.ts: drop their (now inert) redirectToLogin() exemptPaths entries - use-auth.ts: correct the stale ownership comment (no longer owns forgot/reset/verify-token) No behavior change: the routes were already unrouted (App.tsx) and their pages/forms/handlers deleted in F1 — these were unreachable leftovers. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Round 1 addressed — thanks to all seven lensesSeven independent reviewers (Architecture, Correctness, DevOps/Reliability, Frontend/UX, Performance, Security, Testing) reviewed this PR coupled with its sibling (parent New HEADs: parent Fixed in-PR
Deferred (all Level ≤2, non-blocking) → issue docmost#138Test/CI/type-model polish: make Raised as scoping — NOT fixed here → issue docmost#139 (Security, Level 3)Security F-1: the client password UI is gone, but the Docmost server still exposes Re-review of the new HEADs is going out to all seven lenses now. |
⚡ Performance Re-Review (Round 1)Reviewer: Performance Reviewer Summary: Re-reviewed the incremental changes since my Round-0 pass. The scanner hardening + meta-guard, the Prior findings — status
New changes verified this round
Checklist coverage
VERDICT: Approve | BLOCKING: 0 | OPTIONAL: 0 (1 deferred → docmost#138) | L3PLUS: 0 | MAXSEV: 2 | SHA: parent=0d63b37 fork=c4be329 | LENS: Performance |
🎨 Frontend / UI / UX Re-review — Round 1Reviewer: Frontend / UI / UX Reviewer Summary: Re-checked my round-0 Level-2 note. The orphaned Prior finding — status[Minor / L2] Dead route constants —
|
🏛️ Architecture Re-Review (round 1) — Architecture lensReviewer: Architecture Reviewer Summary: The incomplete-cleanup finding (the one L3+ from round 1) is closed cleanly and at zero new boundary cost. The two parent hardening changes strengthen the fitness function and the CI gate without introducing any structural concern. No new architecture findings. Round-1 findings — status✅ RESOLVED — [was Minor / Level 3] — Incomplete dead-code removal — FORK
|
🔒 Security Re-Review (Round 1) — Security lensSecurity Reviewer: Security Reviewer — Claude (independent Security lens, coupled two-PR re-review) Verdict✅ Approve. Every round-1 finding in my lane is resolved or properly tracked, and I confirmed the fixes made nothing worse in the Security lane. Zero merge-blocking, zero new findings. Prior findings — dispositionF-1 (Medium/L3) — server-side password endpoints persist → ✅ TRACKED as docmost#139
F-2 (Low) — pg-scan fail-open blind spots → ✅ RESOLVED (materially hardened)
F-3 (Low) — routing-boundary test is a call-log assertion → ✅ TRACKED as docmost#138
F-4 (Info) — dead route constants → ✅ RESOLVED (+ a bonus tightening)
F-5 (Info) — plaintext Redis — unchanged; remains correct/deferred (rediss:// hardening).Did the fixes introduce anything worse? — No
Checklist coverage (delta only)
Notes
SHA confirmation — parent |
🚀 DevOps / Operations / Reliability Re-review — Round 1Reviewer role: DevOps / Operations / Reliability Reviewer Verdict✅ Approve — my one Level-2 finding is resolved, the re-pin is correct, and the round-1 changes introduce no new operational risk in my lane. 0 blocking, 0 new optional. Prior findings — disposition✅ RESOLVED (was 🟡 L2) —
|
🐛 Correctness Re-Review (round 1) — Bug HunterReviewer role: Correctness Reviewer Verdict✅ Approve All three of my round-1 findings are resolved, and I could not construct a case that breaks the hardened scanner or the fork cleanup. No merge-blocking finding; no new finding. Round-1 findings — status#1 (was 🟡 L2) — pg-callsites missed namespace/default/
#2 (was 🟡 L1) — orphaned #3 (was 🔵/L1) — stale Fresh hunt — what the fixes could have broken (my lane)
FindingsNone. Deferrals to docmost#138 (Level ≤2 indirection false-positive, now documented+accepted in the spec header) and docmost#139 (security scoping) are the right call and out of the correctness-blocking set. VERDICT: Approve | BLOCKING: 0 | OPTIONAL: 0 | L3PLUS: 0 | MAXSEV: 0 | SHA: parent=0d63b37 fork=c4be3299 | LENS: Correctness |
🧪 Test Review — QA Engineer's Eye — RE-REVIEW (Round 2)Reviewer role: Test Reviewer
Verdict✅ Approve — 0 merge-blocking. The two headline asks are confirmed resolved: (1) the round-1 L3 — the pg-scan being blind to default/namespace/ Prior findings — dispositions✅ RESOLVED — [PARENT] pg-scan blind to default/namespace
|
| Behavior / branch | Repo | Covered? | Guard |
|---|---|---|---|
Default/namespace/require pg import + member new pg.Pool() |
PARENT | ✅ NEW | meta-guard fixtures 3–8 + whole-tree scan (empirically verified detected+flagged) |
Override-after-spread ({...toPgConnection(u), ssl:false}) |
PARENT | ✅ NEW | meta-guard fixtures 9–10 + CONNECTION_OVERRIDE_KEYS |
Meta-guard drives the same scanSource as the tree walk |
PARENT | ✅ | scanFile wraps scanSource; fixtures assert count>0 AND flagged (non-vacuous) |
| 4 real pg sites still compliant (no false positive) | PARENT | ✅ | verified: spread+max and bare-call both detected + not flagged |
Multi-hop alias (const Q = P; new Q()) |
PARENT | ❌ fail-open | undetected + mislabeled in docstring — see Level-2 DOCS finding |
| Dead password symbols unreachable / no dangling refs | FORK | ✅ | deletion + clean tree-wide grep at c4be329 |
| Round-1 #46/#52 regression tests intact after cleanup | FORK | ✅ | cleanup commit touched 0 test files |
What I checked (round 2)
- Round-1 L3 fix — empirically replayed the scanner AST against
[email protected]; all default/namespace/require + member-new bypasses now detected AND flagged - Meta-guard non-vacuity — bypass fixtures assert detection + flagging; compliant fixtures assert detection + pass; shares the gating
scanSource - No new false positives — 4 live pg sites verified compliant under the hardened
argIsCompliant - Fork F1 cleanup complete — constants + exemptPaths removed, comment fixed, no dangling refs, round-1 tests untouched
- Deferred item is genuinely ≤ Level 2 (no L3+ consequence nameable)
- New commits hunted for test-lens regressions — one docstring-accuracy nit found (above), nothing behavioral
Note outside my lens
- The DevOps change (
docmost-clientadded to theimagejob'sneeds) is a reliability/gating matter for the DevOps reviewer. From the testing angle it only strengthens gating (the image build now waits on the client suite) — no test-lens concern.
✅ Seven-lens review GREEN at HEAD — ready for human merge (do not auto-merge)Round 1 of the coupled Final verdict — all seven lenses Approve at HEAD (0 blocking, 0 non-blocking Level 3+)
Rounds used: 1 of 5. Stopped because no merge-blocking and no non-blocking Level-3+ finding remains (R = 0). The two round-1 Level-3 findings were fixed and re-verified:
Follow-ups (all non-blocking, tracked)
For the human merge (per repo norm — reviewers don't merge)
|
What & why
Fork-side client changes for the #46/#44 regression + recurrence work (parent PR: cccvu/wiki-v2). Two parts:
1. Regression tests (issues #52 / #46)
logout()failure swallow (use-passwordless.test.tsx): the compensatinglogout().catch(() => undefined)incompleteSignInwas untested. New case rejects bothopenDocmostSessionandlogoutand assertscompleteSignInstill rejects with thestage:"bridge"sentinel (never the rollback error) and does not navigate. Mutation-proven: deleting the.catch(() => undefined)turns exactly this test red (the other rollback test stays green).auth-service.test.ts): generalizes the per-op routing checks — every call landing on the stockapi(/api-prefixed) instance must stay inside the ALB allow-list (/auth/logout,/auth/collab-token), and the session/registration ops must reach the platform surface (/bff/*,/auth/*). Catches a re-route of a load-bearing op onto an ALB-blocked/api/auth/*path (the perf: lazy-load posthog-js (#406) and date-fns locales (#408) #46 Layer-1 bug).2. Complete the passwordless migration — remove dead password-lifecycle UI (broad remediation of the #46 bug class)
change/forgot/reset-password+verify-tokenstill POSTed to Docmost's ALB-blocked/api/auth/*(403 in prod) and, with the platform passwordless (issue #4), are conceptually dead (no user password). Removed the routes, orphaned pages/forms, theuse-authhandlers, the service fns, the verify-token query, and the dead types.setupWorkspace(operator first-run bring-up) is kept. Each removal is documented in the parent'sUPSTREAM_MODIFICATIONS.md(§42–§49), consistent with the earlier login-page removal (§32/§33); the upstream-boundary check is green.Tests
pnpm --filter client test→ 13 files / 103 passed (2 new).tsc --noEmitclean.Notes
docmost-clientCI job that runs this suite on every PR.wiki-v2. Merge this first, then the parent bumps its submodule pointer to the merged SHA.🤖 Generated with Claude Code