Skip to content

test(client): #46 regression + complete passwordless migration (#52) - #6

Merged
PMQ9 merged 2 commits into
wiki-v2from
test/issues-46-52-client-regression
Sep 2, 2026
Merged

PMQ9 merged 2 commits into
wiki-v2from
test/issues-46-52-client-regression

Conversation

@PMQ9

@PMQ9 PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown

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)

2. Complete the passwordless migration — remove dead password-lifecycle UI (broad remediation of the #46 bug class)

change/forgot/reset-password + verify-token still 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, the use-auth handlers, 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's UPSTREAM_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 --noEmit clean.

Notes

  • Client tests previously ran in no pipeline; the parent PR adds a gating docmost-client CI job that runs this suite on every PR.
  • Base branch should be wiki-v2. Merge this first, then the parent bumps its submodule pointer to the merged SHA.

🤖 Generated with Claude Code

…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]>
@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

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 docmost-client CI job (this fork has no test CI of its own), and the F1 removals are documented in the parent's UPSTREAM_MODIFICATIONS.md §42–§49. Merge this into wiki-v2 first; the parent then re-points its submodule pointer to the merged SHA before its own merge.

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

⚡ Performance Review

Reviewer: Performance Reviewer
Model: Claude Opus 4.8
PR / Diff: cccvu/wiki-v2 docmost#132 (4c86541) + cccvu/docmost #6 (7c4f7c7) — reviewed together (coupled: parent gitlink == fork head)
Verdict: Merge OK, minor notes (one Level-2 CI-cost note; no production perf impact)

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 docmost-client job re-does the same checkout + pnpm install + workspace-deps build as the existing docmost-authz job — acceptable (they run in parallel, cache is keyed correctly), but consolidatable if CI minutes matter. Nothing blocks merge.


Findings

[Minor] — Async misuse / CI duplication — .github/workflows/ci.yml (docmost-client job) — cccvu/wiki-v2 docmost#132

Label: optional · Priority Level 2 (CI-cost hardening)
What: The new docmost-client job duplicates, on its own ephemeral runner, the three most expensive steps the existing docmost-authz job already performs: actions/checkout with submodules: true, pnpm install --frozen-lockfile in docmost/, and pnpm --filter @docmost/editor-ext --filter @docmost/base-formula run build. Only the final step differs (pnpm --filter client test vs. the server build + jest src/authz).
Why it costs: Every PR now pays a second fork install + workspace-deps build (order of ~1–3 min of runner time, plus a whole extra CodeBuild runner). It does not add serial wall-clock — the jobs fan out in parallel and ci-ok waits on both — so the cost is a duplicate runner and duplicated install/build work, not a longer critical path. This is a reasonable trade for independent pass/fail signal and parallelism; I flag it only because the duplication is exact.
Fix (optional): If CI minutes/runners are the constraint, fold the client test into docmost-authz (it already has the checkout + install + editor-ext/base-formula build in place) by appending a pnpm --filter client test step there, and drop docmost-client from the job list + the ci-ok loop. Trade-off: you lose the separated green/red signal and the client tests no longer run in parallel with the server build. Keeping them split is defensible — this is a note, not a required change.

Cache keying is correct — not a finding, called out because it's the thing that most often goes wrong here: both jobs use actions/setup-node with cache: pnpm + cache-dependency-path: docmost/pnpm-lock.yaml, so the pnpm store is keyed on the fork lockfile hash and is warm across runs — it is NOT a cold install every run.


Confirmed clean (checked, no finding)

  • services/platform/src/db/pg-callsites.spec.ts AST scan (parent Add Page References Easily docmost/docmost#132) — bounded, one-time, acceptable. The walker reads + ts.createSourceFile-parses every non-.d.ts/.spec.ts .ts file under services/platform/src. Measured: 151 files, ~600 KB total, max dir depth 5, and it correctly continues past node_modules. SRC_ROOT resolves to services/platform/src only (no accidental repo-wide walk), and there is no dist//build/ output under src to double-scan. The parse + forEachChild visit is O(source bytes) and runs once at spec-load (describe body), not per test case. node.getText(...)/regex-slice run only on matched new Pool/Client(...) sites (a handful), not every node. Cost is low-hundreds-of-ms worst case — it will not balloon the platform suite. As the source tree grows this scales linearly in file count, which is fine and expected; no action.
  • REDIS kind branch (db-url-contract.js / main.ts, parent Add Page References Easily docmost/docmost#132) — boot-only, O(1), no hot-path cost. lintDbUrl runs once per URL at process bootstrap (3 URLs in main.ts) and once in runCli (deploy gate). The added kind === 'redis' branch does a single schemes.includes(url.protocol) check instead of the sslmode checks — no loop, no I/O, not per-request. Confirmed the lint is not wired into any request handler.
  • F1 dead-code removal (fork test(client): #46 regression + complete passwordless migration (#52) #6) — no runtime cost; marginally less. The removed change-password / forgot-password / password-reset forms, pages, services, types, queries, and the two App.tsx routes are pure deletions of unreachable UI. No production hot path is touched; if anything the client bundle shrinks slightly (fewer components + one fewer lazy route pair). No N+1, no loop, no I/O introduced.
  • Fork test additions (test(client): #46 regression + complete passwordless migration (#52) #6) — test-only. The new use-passwordless rollback test and the auth-service allow-list boundary test add a couple of jsdom cases; negligible suite-time delta, no production code path.

Checklist coverage

  • N+1 queries: – no DB/query code in the diff (tests + CI + dead-code removal)
  • Unnecessary / repeated DB calls: ✅ none introduced
  • Expensive loops: ✅ the AST walker loop is bounded (151 files) and one-time; no quadratic work
  • Memory allocations: ✅ AST scan holds only file paths + a small Site[]; no large materialization
  • Async misuse: ✅ production code untouched; ⚠️ CI job duplicates install/build (parallel, cache-keyed — Level 2 optional)
  • Blocking I/O: ✅ the only sync I/O (fs.readFileSync in the spec) is in a test, not a request handler
  • Caching opportunities: ✅ pnpm cache is correctly keyed on docmost/pnpm-lock.yaml; nothing else to memoize

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🎨 Frontend / UI / UX Review

Reviewer: Frontend / UI / UX Reviewer
Model: Claude Opus 4.8
PR / Diff: cccvu/docmost PR #6 (fork, base wiki-v2), HEAD 7c4f7c7 — reviewed jointly with parent cccvu/wiki-v2 PR docmost#132 (4c86541)
Visual check: attempted — not run. Deletion-only diff (removes already-dead, prod-403 password forms); no dev server stood up. The one remaining renderable surface (account-settings.tsx) was verified statically — its layout is a trivial section removal.
Design system: Mantine (@mantine/core + @mantine/form) as used across the fork's features/auth and features/user; app-route.ts route constants; api-client 401 redirect list.
Verdict: Merge OK, one minor cleanup note.

Summary: F1 cleanly removes the dead password-lifecycle UI. Crucially there is no dangling dead link — nothing in the app navigates to /forgot-password or /password-reset (login/passwordless pages carry no "Forgot password?" affordance), and account-settings.tsx re-renders with correct divider structure. One purely-cosmetic residue: the route constants survive app-route.ts and are still referenced by the api-client exempt list, but they point at routes that no longer exist. Nothing user-facing breaks.


Findings

2. Is it consistent with the rest of the app?

[Minor] — Dead route constants left behind — docmost/apps/client/src/lib/app-route.ts:11-12 (+ lib/api-client.ts:78-79)

What: App.tsx correctly drops the /forgot-password and /password-reset <Route>s and their page imports, and the pages/forms/services/types/query are all deleted. But APP_ROUTE.AUTH.FORGOT_PASSWORD and APP_ROUTE.AUTH.PASSWORD_RESET remain defined in app-route.ts, and their only remaining consumers are the two exemptPaths entries in redirectToLogin() (api-client.ts:78-79). Those exempt entries now guard paths that can never render — a no-op branch. This is dead code, not a dead link: I grepped the whole client and found no <Link>, navigate(...), or menu item pointing at either constant, so no user can click through to a removed page.
Who it hurts: Nobody at runtime — purely the next dev, who has to figure out why two exempt paths reference non-existent routes. Given this PR's whole purpose is removing dead password UI, finishing the job avoids leaving a fresh loose end.
Fix: Optional. Delete FORGOT_PASSWORD / PASSWORD_RESET from app-route.ts and drop lines 78-79 from redirectToLogin()'s exemptPaths. (Leave ee/audit/lib/audit-event-labels.ts "user.password_reset" alone — that's an audit-event label, unrelated to this UI.)
Priority Level: 2 (Low / polish). Optional — not merge-blocking.


Checklist coverage

  • State & data correctness: ✅ (removed forms only; no state paths altered)
  • State coverage (loading / empty / error / disabled / focus): ✅ (no new async surface; account-settings.tsx sections unchanged)
  • Design-system adherence (tokens, variants, no one-offs): ⚠️ (dead route constants — Minor, above)
  • Shared-primitive blast radius (callers checked): ✅ (grepped all removed symbols — changePassword/forgotPassword/passwordReset/verifyUserToken/useVerifyUserTokenQuery/IChangePassword/IForgotPassword/IPasswordReset/IVerifyUserToken — zero remaining references)
  • Bundle & load cost: ✅ (net deletion — routes/forms/query removed, small bundle win)
  • Runtime & rendering cost (CLS, thrash, waterfalls): – (n/a)
  • Accessibility (semantics, keyboard, focus, contrast, ARIA): ✅ (no interactive controls added; removed forms carried their own a11y, no shared a11y affordance lost)
  • Responsive & interaction UX (320→1440px, touch, error copy): ✅ (account-settings.tsx divider structure clean — one <Divider my="lg"> between NameForm / ChangeEmail / MFA / SessionList, no orphaned or trailing divider, no empty section)

Notes verified (no finding)

  • account-settings.tsx renders cleanly: <ChangePassword /> and exactly one adjacent <Divider> removed; the remaining four sections keep a valid single-divider-between-sections layout. No leading/trailing/double divider.
  • No live control removed by mistake: logout (real sign-out) is untouched in use-auth.ts and still consumed by the passwordless flow; ChangeEmail, AccountMfaSection, SessionList, AccountAvatar, AccountNameForm all retained. setupWorkspace (operator first-run) intentionally kept.
  • App.tsx route table: no route left pointing at a deleted component; both removed imports gone; no unreachable-but-registered route introduced.

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🐛 Correctness Review — Bug Hunter

Reviewer role: Correctness Reviewer
Model: Claude Opus 4.8
PR / change: COUPLED — cccvu/wiki-v2 docmost#132 (4c86541) + cccvu/docmost #6 (7c4f7c7, base wiki-v2). Closes #49 (#44 DB-URL driver-split) and #52 (#46 login/BFF-session).
Date: 2026-09-02
Lens: Correctness (independent pass — diffs fetched fresh, real source traced, not inheriting sibling verdicts)

Verdict

✅ Approve

I tried to break the four things this PR pair rests on — the pg-callsites AST invariant, the REDIS kind discriminator, the rollback-logout test, and the F1 removals — and they all hold. No merge-blocking finding in either repo. Three optional cleanups only (all Level ≤2, none a behavior bug).

Summary

Parent docmost#132 adds a TypeScript-AST invariant that every pg Pool/Client is built via toPgConnection(...) (#49), extends the DB-URL driver contract with a redis-kind REDIS_URL profile (branch on profile.kind so the three Postgres profiles are untouched and Gate 7 skips redis), a boot-lint line, a new gating docmost-client Vitest CI job, and a SIGPIPE fix in the upstream-boundary check. Fork #6 removes the dead password-lifecycle UI (forgot/reset/change-password pages, forms, service fns, types, query, routes) and adds two regression tests (rollback-logout swallow #52; ALB routing-boundary #46). I traced all of the above against the checked-out source at both PR heads. Result: clean on correctness — 0 critical/major, 3 minor/question-level optionals.

Findings

🟡 Minor (optional, Level 2) — [wiki-v2] pg-callsites scan misses namespace/default/require pg imports (false-negative vector; docstring over-claims completeness)

  • Category: Edge case / completeness gap in a guard
  • Location: services/platform/src/db/pg-callsites.spec.ts:67-83 (import scan) and :88 (new-expression check)
  • Problem: pgCtorNames is populated only from ts.isImportDeclaration nodes whose namedBindings are ts.isNamedImports (named/aliased imports). And the new check requires ts.isNewExpression(node) && ts.isIdentifier(node.expression). So three future bypass shapes are invisible to the walker: (a) import pg from 'pg'; new pg.Pool({connectionString}) (default import + pg.Pool is a PropertyAccessExpression, not an identifier); (b) import * as pg from 'pg' (namespace import, no namedBindings); (c) const { Pool } = require('pg') (a require call, not an ImportDeclaration). Each would construct a raw pool that never reaches the scan, so it reads as zero sites and passes.
  • Trigger: A future contributor adds a pg pool via a namespace/default/require import — exactly the "brand-new pg construction" the docstring says it guards.
  • Consequence: None today — all four real sites (role-relay.service.ts:59, docmost-db.ts:26, database.module.ts:17, migrate.ts:34) use named imports with an inline toPgConnection(...) arg and are correctly seen + compliant, so the test passes and is not vacuous (the sites.length > 0 guard holds). The gap is latent: the docstring's claim "a bypass at any present or future site fails CI" over-states coverage, and Gate 7 (deploy-time) is the only backstop for these shapes.
  • Suggested fix: Optional. Either narrow the docstring's completeness claim to "named/aliased pg imports," or extend the walker to also recognize import * as pg/default imports (match new <ns>.Pool/Client(...) where <ns> binds to 'pg') and require('pg') destructuring. Not blocking given the Gate-7 backstop and no current trigger.

🟡 Minor (optional, Level 1, DOCS/cleanliness) — [docmost] Orphaned FORGOT_PASSWORD / PASSWORD_RESET route constants + exempt-path entries survive the removal

  • Category: Regression / incomplete cleanup (inert)
  • Location: apps/client/src/lib/app-route.ts:11-12 (constants) and apps/client/src/lib/api-client.ts:78-79 (redirectToLogin() exemptPaths)
  • Problem: F1 unrouted /forgot-password and /password-reset (App.tsx) and deleted their pages/forms, but APP_ROUTE.AUTH.FORGOT_PASSWORD/PASSWORD_RESET are still defined and still referenced in the api-client.ts 401-redirect exempt list. Those two paths now render nothing (no route maps to them).
  • Trigger: N/A for correctness — the constants still exist so nothing dangles and nothing fails to build; a 401 on those now-unreachable paths simply skips the login redirect.
  • Consequence: Inert dead config. No wrong result, no crash. Purely a "half-removed" tidiness gap versus the F1 goal.
  • Suggested fix: Optional — drop the two APP_ROUTE.AUTH.* constants and their two exemptPaths entries when convenient (or fold into the fix(#486): service-bridge last-admin + self-raise guard; page-restriction self-dealing guards (wiki-v2#486) #52/fix(#455): revoke the relayed fork session on account disable (fork half) #49 follow-up issue). api-client.ts is upstream-owned, so if touched, note it in UPSTREAM_MODIFICATIONS.md.

🔵 Question / Minor (optional, Level 1, DOCS) — [docmost] Stale use-auth.ts header comment

  • Category: Documentation drift
  • Location: apps/client/src/features/auth/hooks/use-auth.ts:22-25
  • Problem: The comment still reads "useAuth still owns logout, setup, invitation, forgot/reset (Docmost-side), and verify-token." This PR removed the forgot/reset/verify-token handlers from this exact file.
  • Consequence: Misleading comment only; the code itself is correct (the three handlers and their imports are cleanly gone; logout/setupWorkspace/invitationSignup remain and all imports are still used).
  • Suggested fix: Trim the comment to "logout, setup, invitation."

What I checked and considered fine

[wiki-v2 docmost#132]

  • REDIS kind discriminator leaves all 3 PG profiles byte-for-byte unchanged. The else branch of lintDbUrl (db-url-contract.js:140-152) is character-identical to the pre-change sslmode + requireTls logic; only the added if (profile.kind === 'redis') diverts redis. Traced all three PG profiles — sslmode value check and requireTls force still fire exactly as before.
  • runCli excludes redis so Gate 7 is untouched. gatedParams = ...filter(kind !== 'redis') — the three Postgres URLs are still gated fail-closed-on-unset; the two new spec cases confirm an absent/broken REDIS_URL returns exit 0.
  • Redis scheme/param validation is sound. url.protocol yields 'redis:'/'rediss:' (trailing colon, lowercased) which match schemes exactly — no off-by-one; allowedParams: [] flags any query param (with the new || '(none)' message guard); requireTls is deliberately NOT applied to redis, so no accidental TLS forcing. A redis://host:6379/1 db-index path passes (path isn't a query param).
  • main.ts boot-lint can't crash boot. cfg.redis.url is an established config field (already consumed by validate-production-config.ts:78); the added tuple is log-only.
  • pg-callsites correctly binds to the pg import, not a same-named local. pgCtorNames is seeded only from from 'pg' named imports, and (el.propertyName ?? el.name).text correctly uses the original export name for the Pool/Client test while adding the local (aliased) name — so import { Pool as PgPool } works and a local class Pool {} in a non-pg-importing file yields an early return [] (no false positive). All four real sites: compliant. Both toPgConnection(x) bare and { ...toPgConnection(x) } spread accepted; pg-connection.ts allowlisted; .d.ts/.spec.ts/node_modules skipped; vacuous-pass guard present.
  • check-upstream-boundary.sh SIGPIPE fix — grep -qxF "$f" <<<"$ALLOWED" is semantically equivalent to the old printf | grep -qxF (whole-line fixed-string match) minus the pipefail/SIGPIPE race; here-string's trailing newline keeps the last allow-list entry matchable.
  • CI docmost-client wiring is consistent — added to both the needs: list and the ci-ok assert-loop for job in ... set.

[docmost #6]

  • Rollback-logout test reproduces the exact failure and asserts the right sentinel. Against use-passwordless.ts:57-62: openDocmostSession rejects → inner catch → await logout().catch(() => undefined) swallows the rollback rejection → throw Object.assign(new Error("session-bridge-failed"), { stage: "bridge" }). The test asserts caught.message === "session-bridge-failed", caught.stage === "bridge" (the bridge sentinel wins, not the rollback error), logout called once, navigate not called. The mutation claim (delete the .catch → rollback error propagates → red) is correct.
  • F1 removals are complete and consistent. Grepped the whole apps/client/src tree: no surviving reference to forgotPassword/passwordReset/verifyUserToken/changePassword, the I*Password*/IVerifyUserToken types, useVerifyUserTokenQuery, or the deleted component/page paths. use-auth.ts, auth-query.tsx (UseQueryResult/isAxiosError both still used), auth-service.ts, auth.types.ts, and account-settings.tsx (divider balance intact, Divider/ChangeEmail/MFA/SessionList unchanged) all keep only live imports — no dangling import, no orphaned route in App.tsx, no half-removed settings section.
  • auth-service routing-boundary test (perf: lazy-load posthog-js (#406) and date-fns locales (#408) #46) is internally sound and non-vacuous — logout() puts /auth/logout on api.post (in the ALB allow-list); the loop over api.post.mock.calls is non-empty; the two platformApi.post assertions (/bff/docmost/session, /auth/register) are concrete.

Open questions for the author

  • None blocking. The pg-callsites namespace/default/require gap (finding 1) is the only judgment call: acceptable as-is if you treat Gate 7 as the real backstop and this scan as a fast-feedback layer — in which case just soften the docstring's "any present or future site" wording so it doesn't over-promise.

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🧪 Test Review — QA Engineer's Eye

Reviewer role: Test Reviewer
Model: Claude Opus 4.8
PR / change: Coupled pair — cccvu/wiki-v2 docmost#132 (4c86541) + cccvu/docmost #6 (7c4f7c7) — #49 pg-callsite invariant, REDIS driver-contract, the new gating docmost-client CI job, and the #52/#46 client regression tests + dead password-UI removal.
Date: 2026-09-02

This review was posted to both PRs. Findings are labelled [PARENT] (cccvu/wiki-v2 docmost#132) or [FORK] (cccvu/docmost #6). Each finding carries merge-blocking/optional, a Priority Level (1–5), and DOCS: where doc/comment-only.

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 docmost-client CI job is a real hard gate (in ci-ok's needs and its assert loop, vitest run not watch, no continue-on-error/passWithNoTests escape) — it is NOT the "runs-but-doesn't-gate" trap the lint job represents. All findings below are optional hardening; none block.

Summary

Two coupled PRs completing the passwordless migration and adding regression guards. Parent adds pg-callsites.spec.ts (an AST scan asserting every pg Pool/Client is built via toPgConnection), extends the DB-URL contract with a redis-kind profile (+ 8 new tests), wires the fork's client Vitest suite into CI as the gating docmost-client job, and fixes a pipefail/SIGPIPE false-positive in the boundary check. Fork adds a rollback-logout failure case to use-passwordless.test.tsx, a routing boundary invariant to auth-service.test.ts, and deletes the dead password-lifecycle UI. I mapped every new behavior to a test and mentally broke the production code to confirm the assertions bite. A regression of either incident would be caught by this suite. The four optional findings are test-depth/scoping/cleanup gaps, not false confidence.

Findings

🟡 Minor — [PARENT] pg-callsite scan is blind to default/namespace pg imports

  • optional · Priority Level 3
  • Category: Regression risk / test-depth gap
  • Location: services/platform/src/db/pg-callsites.spec.ts:74-90 (import detection) + :113-121 (new detection)
  • Gap: The scan's docstring claims "a bypass at any present or future site fails CI." It only detects named imports (ts.isNamedImports) and bare-identifier construction (ts.isIdentifier(node.expression)). A future bypass written as import pg from 'pg'; new pg.Pool({ connectionString: url }) or import * as pg from 'pg'; new pg.Pool(...) produces an empty pgCtorNames set (import clause is a default/namespace binding, not NamedImports) and a PropertyAccessExpression callee — so the file yields zero sites and the bypass ships green.
  • Why it slips through: The anti-vacuous guard (sites.length > 0) still passes because the other four compliant sites populate it. All four current sites use named imports, so the hole is latent, not live.
  • Regression risk: Someone copies the ESM-default idiom from pg's README, constructs a pool from a raw connectionString, evades toPgConnection, and the guard the PR is built around stays green. Bounded backstop: deploy Gate 7 (runCli) fails-closed if a driver-hostile URL actually reaches pg at runtime, so the runtime blast radius is limited — this is a guard-completeness gap, not an open outage.
  • Suggested test: Also collect default (node.importClause.name) and namespace (ts.isNamespaceImport) bindings for 'pg', and detect new <ns>.Pool/Client(...) (ts.isPropertyAccessExpression callee). At minimum, add a fixture string exercising new pg.Pool({connectionString}) through the scanner to pin the intended coverage, or narrow the docstring's "any future site" claim to "any named-import site."

🟡 Minor — [PARENT] pg-callsite scan is white-box on call syntax (brittleness tripwire)

  • optional · Priority Level 2
  • Category: Brittle test
  • Location: services/platform/src/db/pg-callsites.spec.ts:64-72 (argIsCompliant)
  • Gap: Compliance is decided syntactically — the argument must literally be toPgConnection(...) or an object literal spreading it. A legitimate future refactor const cfg = toPgConnection(url); new Pool(cfg); is behavior-identical but reddens CI.
  • Why it slips through: N/A — the risk is a false positive on correct code, not a missed bug. The author documents and accepts this in the file's "Limitation" block, so it's an informed tradeoff.
  • Regression risk: A refactor is blocked by a red guard until the code is re-inlined or the allowlist grown — annoyance, not defect.
  • Suggested test: No change required; the documented tradeoff is reasonable. Optionally track same-scope variable bindings assigned toPgConnection(...) if this bites later.

🟡 Minor — [FORK] auth-service.test.ts "boundary invariant" is a 3-op assertion, not a module-wide scan

  • optional · Priority Level 2
  • Category: Test-depth / coverage completeness
  • Location: apps/client/src/features/auth/services/auth-service.test.ts:65-82
  • Gap: The comment says it asserts "EVERY call made on the stock api instance stays inside the ALB allow-list," but the loop only sees calls produced by the three ops it manually invokes (openDocmostSession, logout, requestAccess). It does not enumerate the module's exports, and does not exercise getCollabToken (→ /auth/collab-token, allow-listed) or setupWorkspace (→ /auth/setup, not in ALB_ALLOWLISTED — intentionally, operator-gated). A newly added stock-api op that routes to a blocked /api/auth/* path would not turn this red unless someone also adds it to this test's call list.
  • Why it slips through: openDocmostSession/requestAccess make zero api.post calls (they use platformApi), so the loop effectively validates the single logout → /auth/logout call plus the two positive platform-surface assertions. It genuinely catches re-routing the 3 load-bearing perf: lazy-load posthog-js (#406) and date-fns locales (#408) #46 ops (I verified: routing openDocmostSession onto api.post("/bff/docmost/session") reddens both the loop and the platformApi assertion), but it is not the module-wide net the "EVERY call" wording implies.
  • Regression risk: A future 5th auth op added straight onto stock api toward a blocked path re-opens the perf: lazy-load posthog-js (#406) and date-fns locales (#408) #46 class without a red test.
  • Suggested test: Iterate the auth-service module's exported functions (or spy globally on api.post) so any op's routing is checked, or soften the comment to name the 3-op scope. Cheap add: invoke getCollabToken() in the loop (proves the allow-listed collab path) so the set isn't asserted purely against logout.

🟡 Minor — [FORK] DOCS: Removal left orphaned route constants + a dead redirect-exempt reference

  • optional · Priority Level 1
  • Category: Test design / cleanup (adjacent to the testing lane)
  • Location: apps/client/src/lib/app-route.ts:11-12 (FORGOT_PASSWORD/PASSWORD_RESET) consumed at apps/client/src/lib/api-client.ts:78-79 (redirectToLogin exemptPaths)
  • Gap: The routes are unrouted in App.tsx and the pages/forms deleted, but the two APP_ROUTE.AUTH.* constants and their entries in redirectToLogin's exemptPaths survive. They're harmless dead entries (the paths now 404 via the catch-all; the exempt match never fires), and untested either way — so not a regression risk, just incomplete cleanup of the removal.
  • Why it slips through: No test exercises redirectToLogin's exempt list; the leftover constants compile and never resolve to a live route.
  • Regression risk: None functional — purely stale code that a reader could mistake for a still-live route.
  • Suggested test: No test needed; drop the two constants and the two exemptPaths entries to complete the removal (or leave a one-line note that they're intentionally retained).

Coverage map — behaviors vs. tests

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 ⚠️ wiring untested 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 ⚠️ weak 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 stock api reddens; raw new Pool flagged
  • 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-client genuinely gates (needs + loop, no escape, fail-closed on skip/cancel); confirmed the platform job's pnpm exec jest picks up both new src/**/*.spec.ts and typescript is a declared dep so the AST scan runs

Open questions for the author

  1. [PARENT] pg-scan import styles — was the named-import-only scope of pg-callsites.spec.ts intentional, given the docstring's "any present or future site" claim? (See 🟡 L3.) A one-line docstring narrowing or a namespace-import branch resolves it.
  2. [FORK] auth-service boundary scope — is limiting the "allow-list" loop to the 3 manually-invoked ops (excluding getCollabToken/setupWorkspace and any future op) the intended contract? (See 🟡 L2.)
  3. [PARENT] Confirm the main.ts REDIS boot-lint entry (['REDIS_URL', cfg.redis.url]) is deliberately left to indirect coverage via lintDbUrl unit 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.

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🏛️ Architecture Review

Reviewer: Architecture Reviewer
Model: Claude Opus 4.8
PR / Diff: COUPLED — cccvu/wiki-v2 docmost#132 (parent, 4c86541) + cccvu/docmost #6 (fork, 7c4f7c7). Reviewed together; parent submodule gitlink == fork head.
Verdict: Merge OK — minor notes. No Critical/Major structural concerns in either repo.

Summary: Both diffs are structurally clean and seam-consistent. The F1 removal respects the upstream-minimal boundary (every touched upstream file carries a documented ### N. seam header), the REDIS extension of DRIVER_PROFILES is a sound discriminated-union rather than an overload, the pg-callsites AST fitness test is correctly layered, and the parent docmost-client CI job is the right structural home for the fork's testless submodule. One real (non-blocking) finding: the dead-code removal is incomplete — two orphaned route constants and their consumers survive in already-documented seams.


Findings

[Minor] — Code organization / Maintainability — FORK docmost apps/client/src/lib/app-route.ts:11-12 + apps/client/src/lib/api-client.ts:78-79 — optional, Level 3

What: The PR's stated goal (UPSTREAM_MODIFICATIONS §42–49: "complete the passwordless migration — remove dead password-lifecycle UI") is executed everywhere except the route table and the 401 interceptor. App.tsx unroutes /forgot-password + /password-reset and the pages/forms/services/types/handlers are all deleted, but two remnants of the same dead subsystem remain:

  • app-route.ts still defines AUTH.FORGOT_PASSWORD: "/forgot-password" and AUTH.PASSWORD_RESET: "/password-reset" — constants for routes that no longer exist.
  • api-client.ts redirectToLogin() exemptPaths still lists APP_ROUTE.AUTH.FORGOT_PASSWORD and APP_ROUTE.AUTH.PASSWORD_RESET — dead exemptions for unreachable paths.

They form a small self-contained dead subsystem (constants → the only consumer), so nothing else breaks — but the whole subsystem is now unreachable.

Why it costs: Dead constants that still look live mislead the next reader and the next upstream-merger: a future dev can wire APP_ROUTE.AUTH.FORGOT_PASSWORD believing the route is real (it 403s at the ALB), and the two exemptPaths entries are never-matched dead branches in the auth-redirect logic. It also undercuts the migration's own invariant — auth-service.test.ts guards routing, but nothing catches these orphaned constants, so the "no dead password code" claim isn't actually complete. Cheap to finish: both files are already documented seams (api-client.ts = §7, app-route.ts is already in the ALLOWED list), so removing the four lines adds zero new boundary-doc burden.

Fix: Delete FORGOT_PASSWORD / PASSWORD_RESET from app-route.ts's AUTH block and their two entries from api-client.ts's exemptPaths; refresh the two already-present seam notes in UPSTREAM_MODIFICATIONS.md. (Alternatively, keep as a same-day follow-up — but it belongs to this PR's thesis.)


[Minor] — Abstraction boundary — PARENT wiki-v2 services/platform/src/db/db-url-contract.d.ts:12-22 — optional, Level 2

What: DriverProfile models a two-variant type (kind: 'postgres' | 'redis') as one interface with optional fields (sslmodeValues? postgres-only, schemes? redis-only) rather than a true TS discriminated union (type DriverProfile = PostgresProfile | RedisProfile). The type therefore permits illegal states — a kind: 'redis' profile that also carries sslmodeValues, or a postgres profile with schemes — that the compiler won't reject. lintDbUrl branches on kind so no runtime bug is possible today.

Why it costs: The type no longer makes illegal states unrepresentable; correctness relies on authors hand-keeping the optional fields consistent with kind (the .spec.ts asserts kind values as the backstop). For a future third kind, the optional-field approach accretes more ?-fields that only apply to one variant.

Fix: Consider a discriminated union in the .d.ts ({ kind: 'postgres'; sslmodeValues } | { kind: 'redis'; schemes }). Trade-off / why it's only Level 2: the set is 4 hand-authored, closed profiles in a deliberately zero-dependency .js + hand-written .d.ts; a full union buys little on a closed set and the kind branch already reads the right field. Extending the shared contract here (rather than a parallel Redis module) is the right call — the guarded concern (cross-container dual-consumer query-param drift, the #42 class) genuinely applies to Redis, and a separate module would duplicate allowedParams/forbidden/note/the lint loop. This is a refinement, not a redesign.


[Nit] — Code organization / naming — PARENT wiki-v2 services/platform/src/db/db-url-contract.js — optional, Level 2

What: db-url-contract.js / lintDbUrl / DRIVER_PROFILES now also validate Redis, which isn't a "DB". A reader hunting for "where is REDIS_URL validated?" is unlikely to open a file named db-url-contract. REDIS_URL validation is also split across two modules — secrets-contract.js checkUrl (shape / prod-endpoint / fail-closed, via validate-production-config.ts) and db-url-contract.js lintDbUrl (scheme + params, boot-log) — plus the plaintext warning in validate-production-config.ts.

Why it costs: Minor discoverability tax; no single home for "how is REDIS_URL checked."

Fix: None required. The split mirrors the pre-existing pattern (PLATFORM_DATABASE_URL and DOCMOST_DATABASE_URL already live in both modules), so REDIS joining both is consistent, not newly-introduced drift; and the code comments already own the mismatch ("three Postgres + Redis"). A future broad rename (connection-url-contract) would touch 3 call sites + tests + the #42 incident references, so it isn't worth it now. Noted only for the record.


[Nit] — DOCS — PARENT wiki-v2 UPSTREAM_MODIFICATIONS.md §6 — optional, Level 1

What: The primary §6 (App.tsx) "On upstream bump" checklist enumerates the routes to re-apply (index, /request-access, /login, /login/verify) but doesn't mention not re-adding /forgot-password + /password-reset. That "these routes are unrouted" instruction lives only in the §42–49 prose and the per-page "delete again" notes.

Why it costs: On an upstream merge that restructures App.tsx, a merger reading §6's own bump list could reintroduce the two routes without a prompt to re-remove them.

Fix: Add one line to §6's bump note ("do not re-route /forgot-password /password-reset — removed in §42–49"). Trivial.


What I verified as sound (no finding)

  • Boundary integrity (FORK, F1): all 12 non-excluded upstream files the fork PR touches (App.tsx, use-auth.ts, auth-query.tsx, auth-service.ts, auth-service.test.ts, auth.types.ts, change-password.tsx, forgot-password{-form}.tsx, password-reset{-form}.tsx, account-settings.tsx) carry a ### N. seam header — exactly what check-upstream-boundary.sh keys on. use-passwordless.test.tsx is correctly under the excluded features/public/ prefix. §42–49 docs match the diff (deletes, the one <Divider> in §44, the use-auth handler drops).
  • Remove vs. guard (FORK): removing the dead UI (not guarding it) is the correct seam-consistent move per the §32/33 precedent (login-form.tsx was deleted, not guarded, when passwordless landed). The code is both conceptually dead (no password) and ALB-403-broken; the routing-invariant in auth-service.test.ts prevents re-introduction. Right pattern.
  • pg-callsites.spec.ts layer (PARENT): correctly placed in services/platform/src/db/ beside pg-connection.ts/db-url-contract.spec.ts; mirrors the existing in-repo AST-fitness pattern (test/admin-authz-fitness.spec.ts, test/content-validation.spec.ts) and the feat(service-bridge): Phase C reverse-coupling endpoints + mode-aware hardening + HttpAuthzClient rename #13 Layer-C scan. Matches all 4 real toPgConnection sites (2 direct-arg, 2 spread) via argIsCompliant; has a vacuous-pass guard.
  • REDIS boot-lint vs Gate 7 (PARENT): excluding redis-kind from runCli/Gate 7 is a coherent boundary decision — Gate 7 reads only the SSM-exported Postgres URLs; gating REDIS there would fail-closed (buildspec doesn't export it) and need a co-shipped IAM grant. Boot-lint (log-only, main.ts) is the right posture for a defense-in-depth drift check.
  • CI topology (PARENT): a parent job running the submodule's client tests is the correct structural home — the fork has no test CI (release.yml is build-on-tag), the parent already hosts the runners + docmost-authz + pep-pdp-roundtrip, and the parent must re-test at the pinned gitlink SHA anyway to prevent a "bump to a red commit." Consistent with docmost-authz; the two-repo pipeline coupling is inherent to submodule-vendoring, not a defect.
  • SIGPIPE fix: the grep -q | pipe → here-string change is a correctness fix, not a structural one; sound.

Checklist coverage

  • Separation of concerns: ✅ clean (deletions + fitness tests; no mixed responsibilities introduced)
  • Layering: ✅ clean (no wrong-way deps; platform validation stays in services/, out of the AGPL tree)
  • Responsibilities: ✅ clean (validation lives in the config/db layer; routing invariant beside the module it guards)
  • Coupling: ✅ clean (CI↔submodule coupling is inherent + correct; no new cross-module coupling)
  • Abstraction boundaries: ⚠️ Level-2 note (DriverProfile optional-field union vs true discriminated union)
  • API / contract design: ✅ clean (kind discriminator is the right extension point; REDIS contract shape is coherent)
  • Code organization: ⚠️ Level-3 note (incomplete dead-code removal: orphaned route constants + exemptPaths) + Level-2 naming note
  • Maintainability & change cost: ✅ good (seam-documented, re-merge cost bounded, fitness tests lock the invariants)

VERDICT: Approve | BLOCKING: 0 | OPTIONAL: 4 | L3PLUS: 1 | MAXSEV: 3 | SHA: parent=4c86541 fork=7c4f7c7 | LENS: Architecture

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🚀 DevOps / Operations / Reliability Review

Reviewer role: DevOps / Operations / Reliability Reviewer
Model: Claude Opus 4.8
PR / change: Coupled pair — cccvu/wiki-v2 docmost#132 (4c86541) + cccvu/docmost #6 (7c4f7c7) — close #49 (DB-URL driver-split regression guard) & #52/#46 (login/BFF-session regression guards), remove dead password-lifecycle UI, add the gating docmost-client CI job.
Date: 2026-09-02

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 (image job doesn't list the new required gate) has zero deploy consequence because the deploy gate keys on the whole-run conclusion. I verified the gates are real and green, not just wired.

Blast radius

Parent 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 docmost-client job — it is the only thing that executes the fork's client Vitest suite (the fork has no test CI of its own), so it is where I concentrated.

Summary

The parent adds a docmost-client job that checks out the fork submodule at the pinned gitlink, installs the fork's pinned toolchain, builds the workspace deps the client imports, and runs pnpm --filter client test; it wires that job into the ci-ok aggregate (the single required status). It adds a REDIS_URL entry to the zero-dep DB-URL driver contract — boot-linted (log-only) but deliberately excluded from deploy Gate 7 (runCli) so it can't fail-close a deploy. It fixes a set -o pipefail+printf|grep -q SIGPIPE false-positive in the upstream-boundary check via a here-string, and bumps the submodule to exactly the fork PR head. The fork removes the passwordless-dead password-lifecycle UI and adds an ALB-allow-list routing invariant test + a rollback-logout swallow test. Result: operationally sound. 0 critical, 0 major, 3 minor (all optional, all Level ≤2, none Level 3+). I executed the client suite (13 files/103 tests green), the two new parent specs (27 green), and the boundary check (5/5 deterministic green) at the pinned SHAs.

Findings

🟡 Minor (optional, Level 2) — New required gate docmost-client is missing from the image job's needs

  • Area: Deployment / CI
  • Location: [PARENT] .github/workflows/ci.yml:317-325 (the image job needs: list)
  • Problem: The change correctly adds docmost-client to ci-ok.needs (line 637) and to the ci-ok assert loop (line 653), but does not add it to the image (build-once → ECR) job's needs, which enumerates all eight other required gates (authz-model … infra-config). The image job's own comment claims "images build only after tests pass."
  • Production scenario: A client-test regression lands on main. docmost-client fails, but the eight gates image lists all pass, so image still builds and pushes ccc-wiki-docmost:<sha> (which bundles the fork client) to ECR.
  • Consequence: No deploy consequence — I traced it: Gate 5 in buildspec-deploy.yml:159-172 requires the whole ci.yml push run to be "completed success" and dies otherwise, and a failed docmost-client makes the run conclusion failure, so the tag deploy is refused regardless. The only real cost is a wasted image build in ECR and a weakened "images build only after tests pass" invariant. This is the same "a new gate wasn't wired into every place that enumerates gates" class this PR exists to prevent.
  • Suggested fix: Add - docmost-client to the image.needs list (line ~323) so the ECR build depends on the full required-gate set, matching ci-ok.

🟡 Minor (optional, Level 2) — Merge-sequence guidance for the coupled gitlink

  • Area: Deployment / release ordering
  • Location: [PARENT] docmost gitlink → 7c4f7c7; [FORK] #6 head 7c4f7c7
  • Problem: The parent pins the submodule at exactly the fork PR head (verified: gitlink 7c4f7c7067e0… == fork headRefOid), and every submodules: true job (incl. the new docmost-client) tests that exact SHA. Both merge orders end green, so this is guidance, not a defect.
  • Production scenario: If parent Add Page References Easily docmost/docmost#132 merges first and the fork PR test(client): #46 regression + complete passwordless migration (#52) #6 branch is then deleted before merging, the pinned 7c4f7c7 could become an orphaned commit; a fresh clone / cold CI runner doing git submodule update could fail to fetch it → red main build.
  • Consequence: Low-probability broken main submodule fetch — requires the unusual action of deleting the unmerged PR branch while main pins its head (GitHub normally retains PR-head commits, which mitigates this).
  • Suggested fix: Merge fork test(client): #46 regression + complete passwordless migration (#52) #6 first, then parent Add Page References Easily docmost/docmost#132 (optionally re-point the gitlink to the post-merge wiki-v2 tip so the pinned SHA is an ancestor of the branch, not a dangling PR head). Don't delete the fork PR branch until the parent has merged.

🔵 Note (optional, Level 1) — editor-ext / base-formula are built twice across fork jobs

  • Area: Operations / CI cost
  • Location: [PARENT] .github/workflows/ci.yml:267-269 (docmost-client) duplicates the workspace-dep build already done by docmost-authz:227
  • Problem/consequence: Both fork jobs run a full pnpm install --frozen-lockfile + pnpm --filter @docmost/editor-ext --filter @docmost/base-formula run build. The pnpm store is shared via the cache: pnpm / cache-dependency-path: docmost/pnpm-lock.yaml setup, so install is mostly re-linking, but the dep build is redundant. Marginal added wall-clock on every PR.
  • Suggested fix (optional): Fine to leave as-is — independent jobs give parallelism + isolated failure attribution, a reasonable tradeoff. If CI time becomes a concern, cache the built dist/ between the two jobs.

What I checked and considered fine

Infrastructure

  • docmost-client uses the fork's pinned toolchain — pnpm 10.4.0 (matches the fork packageManager: [email protected]), node 22, cache-dependency-path: docmost/pnpm-lock.yaml — identical to the existing docmost-authz job.
  • submodules: true (NOT --recursive — EE stays uninitialized), checks out the exact gitlink SHA (7c4f7c7).
  • Runner label job-docmost-client is unique across the file and free-form; the CodeBuild project label carries ${{ github.run_id }}-${{ github.run_attempt }} → no cross-run collision.
  • No new secret / SSM read: buildspec-deploy.yml has no REDIS reference; REDIS_URL reaches both containers as a non-secret local.redis_url = "redis://<elasticache>:6379" in ecs.tf:51,111,175. The CLAUDE.md "new deploy-gate SSM read co-ships with its IAM grant" rule is not triggered.
  • No secrets logged: the boot-lint logs only contract violation strings, never the URL value.

Reliability

  • No new crash path from the main.ts boot-lint: cfg.redis.url is always defined (config.ts:259 → process.env.REDIS_URL ?? DEV_DEFAULT_VALUES.REDIS_URL), and validateProductionConfig(cfg) already reads cfg.redis.url before the lint loop — so a missing redis object would have thrown earlier, not here. The lint is log-only (errors logged, never thrown). Verified.
  • REDIS_URL deliberately excluded from deploy Gate 7: runCli filters kind !== 'redis'; I ran the spec and confirmed at runtime only the 3 Postgres URLs are validated (no REDIS_URL OK line). Tests explicitly guard that a broken REDIS_URL does not fail-close the gate.
  • The REDIS contract accepts the real prod value (redis://host:6379, no query params, redis: scheme) and correctly does NOT force TLS (prod runs plaintext in-VPC by design) — so it won't false-close on the live value.

Observability

Deployment

  • Deploy gate integrity: Gate 5 (buildspec-deploy.yml:167-168) requires "completed success"; a red docmost-client fails the run conclusion → deploy refused. The new gate genuinely gates the deploy.
  • Gate 7 (runCli) behavior for the 3 Postgres URLs is unchanged (the kind-discriminated branch preserves the exact sslmode/requireTls logic in the else); the message tweak only affects the empty-allowedParams redis case.
  • Fork deletion is rollout-safe: the removed /forgot-password and /password-reset routes already 403'd via the ALB deny-list, so this deletes broken UI, not a working path. No schema/contract change; rollback = redeploy the prior docmost image (frontend-only, trivially reversible). During a rolling deploy, an old SPA navigating to a now-unrouted path hits the SPA fallback — a non-regression from a 403 form.

Operations

  • The docmost-client gate is real, not vacuous: package name is client (so --filter client resolves), test script is vitest run (exits non-zero on failure), and there is no passWithNoTests override (vitest default fails on zero tests) — a broken test glob would red the job, not pass silently.
  • SIGPIPE fix is correct + semantics-preserving: -qxF flags and the trailing newline are identical between printf '%s\n' and the <<< here-string, so only the pipe (the SIGPIPE source under pipefail) is removed. It cannot introduce a false-negative — the no-match path (real violation → grep exit 1 → recorded) is unchanged.
  • docmost-client / ci-ok correctly run on pull_request + push only (not schedule/workflow_dispatch), consistent with every other required gate; a skipped run would still be caught (skipped != success in the assert loop).

Verification I ran (at the pinned SHAs, read-only)

  • pnpm --filter client test (fork, 7c4f7c7): 13 files / 103 tests passed — incl. the two new/changed specs (auth-service.test.ts ALB-allow-list routing invariant, use-passwordless.test.tsx rollback-logout swallow).
  • jest src/db/pg-callsites.spec.ts src/db/db-url-contract.spec.ts (platform): 27 passed — AST scan does not false-positive on the 4 current pg callsites; runCli validated only the 3 Postgres URLs.
  • bash scripts/check-upstream-boundary.sh: exit 0, 5/5 runs — deterministic; classifies every file this pair touches (the deleted forms/pages, use-auth.ts, auth-query.tsx, auth.types.ts, account-settings.tsx, App.tsx) as a documented seam, confirming UPSTREAM_MODIFICATIONS.md §42-49 fully cover the deletions.

Open questions for the author

None blocking. The only actionable item is the image.needs addition (finding 1); the merge-order note (finding 2) is guidance for how you land the pair.

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🔒 Security Review

Security Reviewer: Security Reviewer — Claude (independent Security lens, coupled two-PR review)
Model: Claude Opus 4.8
PRs (reviewed together):

Verdict

🟡 Approve with comments. Both diffs are sound and the security-critical behavior fails closed: the passwordless rollback never navigates into an authenticated view, logout() dual-session invalidation is preserved, the client removals are clean (no live imports of the deleted symbols), the routing-boundary test encodes the real ALB allowlist, the REDIS kind change is additive (no TLS downgrade), and the new docmost-client CI job actually gates merge. Zero merge-blocking findings. The one Priority-3 item (F-1) is a pre-existing, out-of-diff server surface that this passwordless-migration PR should acknowledge with a tracked follow-up — not a change to this PR.

Summary

Severity Count
🔴 Critical 0
🟠 High 0
🟡 Medium 1
🔵 Low 2
⚪ Info 2

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)

  • Repo/Category: FORK · Authentication / Architecture (defense-in-depth)
  • Priority: 3 (Normal) · Optional, NON-blocking · resolution = tracked follow-up issue, not a change to this PR
  • Location: docmost/apps/server/src/core/auth/auth.controller.ts:142 (forgot-password), :152 (password-reset, mints authToken at ~:170 via setAuthCookie), :181 (verify-token); docmost/apps/server/src/authz/route-guard/intentional-unguarded.ledger.ts:83,89 (both marked mode: 'public-auth')
  • Why it's relevant: PR test(client): #46 regression + complete passwordless migration (#52) #6 removes the client password UI and correctly notes these routes "are ALB-blocked in prod anyway." But the coupled reality is that the server still exposes the full password-lifecycle surface: POST /api/auth/forgot-password, /password-reset, /verify-token, /login remain live, exempt from the fail-closed APP_GUARD (they are public-auth in the ledger), and password-reset directly mints a Docmost authToken session from an emailed token — bypassing the platform's /bff/docmost/session bridge and its split-key model. In a passwordless platform this password flow "shouldn't exist." The only prod barrier is the single ALB Layer-1 deny (infra/terraform/locals.tf docmost_auth_deny_paths = ["/api/auth","/api/auth/*"]). It is real and tested — so this is not exploitable today (full exploitation would also require intercepting the victim's emailed reset token) — but the passwordless authN invariant now rests entirely on that one network rule plus Docmost not exposing an in-VPC path.
  • Recommended fix: File a tracked follow-up to close the server side so the invariant isn't network-only: neuter/remove the Docmost-native forgot-password/password-reset/verify-token/login handlers in the fork (or assert shadow users carry no usable password credential, making the flow provably inert). Belt-and-braces: a route-guard/AST tripwire that fails CI if a new public-auth /api/auth/* handler appears without an ALB-deny entry, mirroring the existing "route family ⇒ ALB classification" check. This PR's client-only removal is correct and approvable as-is.

[LOW] pg-callsites.spec.ts AST guard has two fail-open blind spots

  • Repo/Category: PARENT · Architecture (defense-in-depth completeness)
  • Priority: 2 (Low) · Optional
  • Location: services/platform/src/db/pg-callsites.spec.ts (argIsCompliant + the new-expression visitor)
  • Why it's relevant: The guard is genuinely useful and covers 100% of current sites (all four real callsites use named pg imports + toPgConnection — role-relay.service.ts:59, docmost-db.ts:26, migrate.ts:34, database.module.ts:17) and fails closed on no-arg / aliased-toPgConnection / variable-indirection. But two constructions read as compliant while disabling TLS, so a future regression there would pass CI silently: (a) a namespace/default import — import pg from 'pg'; new pg.Pool({connectionString}) — is a PropertyAccessExpression, which the visitor's ts.isIdentifier(node.expression) check never matches (invisible to the scan); (b) a property override after a compliant spread — new Pool({ ...toPgConnection(url), ssl: false }) — passes because argIsCompliant only checks that some spread is toPgConnection(...), not that no later property overrides ssl. Runtime backstops (main.ts boot-lint + deploy Gate 7) still catch the effect, so this is DiD-only.
  • Recommended fix: Either document both as accepted limitations in the file header (it already documents the variable-indirection one), or extend the walker to (1) also match new <ns>.Pool/Client(...) and (2) reject an ssl/connectionString property that appears after the compliant spread. No current site is affected.

[LOW] Routing-boundary test asserts over 3 exercised ops, not a static scan of auth-service

  • Repo/Category: FORK · Architecture (completeness of a security invariant test)
  • Priority: 2 (Low) · Optional
  • Location: docmost/apps/client/src/features/auth/services/auth-service.test.ts:65-82
  • Why it's relevant: The new invariant is correct and its allowlist matches infra exactly (ALB_ALLOWLISTED = {"/auth/logout","/auth/collab-token"} == locals.tf docmost_auth_allow_paths), so it does not bless a wrong path. But it iterates api.post.mock.calls after invoking only openDocmostSession + logout + requestAccess. It is a call-log assertion, not a static scan of auth-service.ts, so a newly added auth op that POSTs to a blocked /api/auth/* path would not turn this test red unless it is also invoked here. (Today's residual setupWorkspace → /api/auth/setup is deliberately un-exercised and correctly excluded — it is operator-only behind a temp ALB rule.) tsc + the per-op tests + the docmost-client gate cover the current ops.
  • Recommended fix: Optional hardening — assert against the module's exported surface (e.g. drive every exported auth-service fn, or AST-scan the source for api.post("/auth/...") targets and diff against the allowlist), so the guard covers future ops, not just the three enumerated here.

[INFO] Dead route constants left after the routes/pages were removed

  • Repo/Category: FORK · Architecture (dead code)
  • Priority: 1 (Trivial) · Optional cleanup
  • Location: docmost/apps/client/src/lib/app-route.ts:11-12 (FORGOT_PASSWORD, PASSWORD_RESET)
  • Why it's relevant: No security impact — nothing navigates to them (grep confirms only the definitions remain), and even a stray navigate(APP_ROUTE.AUTH.FORGOT_PASSWORD) would hit an unrouted path (client 404), never an ALB-blocked POST. Purely leftover constants after App.tsx/pages were deleted.
  • Recommended fix: Drop the two constants for tidiness. Non-blocking.

[INFO] New REDIS contract accepts plaintext redis:// (pre-existing posture, deliberate, correct)

  • Repo/Category: PARENT · Transport / Crypto
  • Priority: 1 (Trivial) · Info only
  • Location: services/platform/src/db/db-url-contract.js:76-83,132-139
  • Why it's relevant: Confirming this is not a downgrade: REDIS_URL was not linted or gated at all before this PR, so adding a contract that accepts redis:// and rediss:// is strictly additive. Not applying requireTls to the redis kind is the correct, documented backward-compat choice (prod runs plaintext Redis inside the VPC by design; rediss:// transit encryption is a tracked cache.tf follow-up), and correctly excluding it from deploy Gate 7 (runCli filters kind !== 'redis') is right because the buildspec never exports REDIS_URL from SSM — gating it would fail-close every deploy. lintDbUrl is null-safe (undefined → ok) and boot-lints REDIS at main.ts. The residual (platform session material + rate-limit state transit in cleartext in-VPC) is pre-existing and appropriately deferred.
  • Recommended fix: None here. Keep the rediss:// transit-encryption hardening on the tracked follow-up.

Reviewed and clean (positive confirmations)

  • Rollback fails closed (docmost/.../hooks/use-passwordless.ts:49-67): navigate(getPostLoginRedirect()) is reached only after both verifyPasswordless and openDocmostSession succeed. On bridge failure → logout() rollback (error swallowed) + throw stage:"bridge" sentinel, no navigate; the new test (use-passwordless.test.tsx) accurately proves the bridge sentinel survives even a failing rollback logout. No window leaves a partial session usable.
  • Real logout / token invalidation preserved (auth-service.ts:24-32): logout() clears both the platform (/auth/logout) and Docmost (/api/auth/logout, ALB-allowed) sessions via Promise.allSettled — removing the password UI dropped no session/recovery control.
  • Client removal is complete: no live import of changePassword/forgotPassword/passwordReset/verifyUserToken, their I* types, or the deleted forms/pages remains anywhere in apps/client/src. The passwordless verify path (verifyPasswordless) is separate and intact.
  • Post-login redirect is safe: getPostLoginRedirect() → safeRedirectPath() rejects //, ://, scheme prefixes, control chars, and cross-origin — no open-redirect on the tested bridge path.
  • No secret leakage: lintDbUrl violation messages expose only the param name, offending query key, and URL scheme — never host, credentials, or the URL value.
  • check-upstream-boundary.sh SIGPIPE fix preserves the fork-integrity guarantee: the here-string removes the printf | grep -q + pipefail false-positive (documented files mis-flagged); match semantics are unchanged, so an undocumented upstream edit still yields no match → violation → exit 1. No false-negative introduced (supply-chain / fork-integrity gate intact).
  • docmost-client CI job actually gates: present in ci-ok needs: and the result != "success" → exit 1 aggregation loop; ci-ok runs if: always() and is the single required status; the fork's test script is vitest run (exits, won't hang the gate); runs on the non-privileged runner (job-docmost-client, no SSM) with no env: secrets. A red fork client suite (or a submodule bump to a red commit) now blocks merge — the previously-untested gap (fix(#486): service-bridge last-admin + self-raise guard; page-restriction self-dealing guards (wiki-v2#486) #52) is closed.

Checklist coverage

  • ⚠️ Authentication — F-1 (server password endpoints persist, session-minting, network-gated); rollback + logout confirmed fail-closed
  • ✅ Authorization — server password handlers are intentionally public-auth (pre-auth by design); no authz broadened in-diff
  • ➖ Injection — no query/command/template sinks in the diff
  • ✅ XSS — deleted forms; no new sink; nothing rendered from untrusted input
  • ✅ CSRF / CORS — no CORS/cookie policy change; logout is same-origin
  • ✅ Secrets — none introduced; lint messages leak no secret value
  • ➖ File uploads — n/a
  • ✅ SSRF — n/a (no server-side fetch of user input)
  • ✅ Unsafe redirects — post-login redirect guarded by safeRedirectPath (same-origin)
  • ✅ Sensitive logging / data exposure — boot-lint/gate log param names only, no URL values
  • ➖ Deserialization — n/a
  • ➖ Path traversal — n/a
  • ⚠️ Crypto / transport — F-5 (plaintext redis:// accepted; pre-existing, deliberate, correct); toPgConnection remains TLS-no-verify (pre-existing, tracked)
  • ✅ Dependencies — no new packages; CI pins [email protected] / [email protected] / --frozen-lockfile
  • ✅ Business logic / race conditions — two-step bridge is atomic-navigate (no TOCTOU window)
  • ➖ PII / data protection — n/a in-diff
  • ✅ Audit logging — n/a in-diff; no audit path weakened
  • ✅ Security headers / cookies — unchanged
  • ⚠️ Architecture / missing layers — F-1 (network-only passwordless invariant), F-2 (AST-guard blind spots), F-3 (routing-test completeness)

Notes

  • Coupling verified: parent submodule gitlink 7c4f7c7 == fork head; the parent's new docmost-client job executes+gates the fork's client Vitest suite (the fork has no test CI of its own). Both must merge together.
  • F-1 is the one item worth a tracked issue but is explicitly not a defect in either diff — it is a pre-existing upstream server surface, out of both diffs, mitigated in prod by the tested ALB deny. Do not block or force a code round on this PR for it; open a follow-up.
  • The two DB TLS-no-verify realities (toPgConnection rejectUnauthorized:false and plaintext Redis) are both pre-existing, documented, and tracked — noted only so the picture is complete.

SHA confirmation — parent 4c865412d6cc63ac7af90b0a55507116d1e5e69a (4c86541), fork 7c4f7c7067e0d31f2812d60e81a1d89d5c6c672f (7c4f7c7).

…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]>
@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

Round 1 addressed — thanks to all seven lenses

Seven independent reviewers (Architecture, Correctness, DevOps/Reliability, Frontend/UX, Performance, Security, Testing) reviewed this PR coupled with its sibling (parent cccvu/wiki-v2#132 ⇄ fork cccvu/docmost#6). Result: 0 merge-blockers, and the two round-justifying (Level 3) findings are now fixed in-PR.

New HEADs: parent 0d63b37 · fork c4be3299 (submodule re-pinned, so docmost-client runs the completed fork).

Fixed in-PR

  • fix(#455): revoke the relayed fork session on account disable (fork half) #49 pg-callsite scan hardened (parent — Testing L3, Security F-2, Correctness L2) — the AST scan was blind to import pg from 'pg' / import * as pg / require('pg') + member new pg.Pool(), and to a ssl/connectionString override after a compliant spread. It now recognizes all those binding shapes + one hop of const-aliasing, and flags override-after-spread. Added a self-verifying meta-guard (11 bypass + 4 compliant fixtures + a no-pg case) so the header's "any present or future site fails CI" claim is now an executed assertion, not prose. Mutation-verified: a planted import pg from 'pg'; new pg.Pool({connectionString}) now reddens the whole-tree scan (was a silent false-negative); all 4 real sites still pass. Platform suite 807/807.
  • F1 dead-route cleanup completed (fork — Architecture L3, + Frontend/Correctness/Testing) — removed the orphaned AUTH.FORGOT_PASSWORD/PASSWORD_RESET constants (app-route.ts) and their inert redirectToLogin() exemptPaths entries (api-client.ts), and corrected the stale use-auth.ts ownership comment. UPSTREAM_MODIFICATIONS.md §7/§8 updated to match. No behavior change (routes were already unrouted, pages/forms deleted). Client suite 103/103, boundary check green.
  • docmost-client wired into the image job's needs (parent — DevOps L2, folded in) — the same gate-everywhere invariant this PR establishes; no deploy consequence (Gate 5 already requires whole-run success) but keeps the job graph honest.

Deferred (all Level ≤2, non-blocking) → issue docmost#138

Test/CI/type-model polish: make auth-service.test.ts a module-wide AST scan (Testing L2 / Security F-3), a discriminated-union DriverProfile (Architecture L2), docmost-client/docmost-authz build de-dup (Performance L2 / DevOps L1), naming + a §6 doc note. Each is tracked with its lens/level in docmost#138.

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 POST /api/auth/forgot-password + /password-reset (guard-exempt; password-reset mints an authToken). Pre-existing, in neither diff, mitigated today only by the ALB /api/auth/* deny — so the passwordless invariant is currently network-only. Not exploitable now; needs its own fork server PR, so it's tracked in docmost#139 for the maintainer to schedule rather than force into this test-only PR.

Re-review of the new HEADs is going out to all seven lenses now.

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

⚡ Performance Re-Review (Round 1)

Reviewer: Performance Reviewer
Model: Claude Opus 4.8
PR / Diff: cccvu/wiki-v2 docmost#132 (0d63b37) + cccvu/docmost #6 (c4be329) — coupled re-review (submodule re-pinned to fork head)
Verdict: No performance concerns — Approve

Summary: Re-reviewed the incremental changes since my Round-0 pass. The scanner hardening + meta-guard, the image.needs edge, and the fork's dead-route deletion are all perf-neutral. I verified the two specific claims the coordinator flagged: the +16 meta-guard fixtures parse tiny in-memory snippets (not the tree), and the ci.yml change is a dependency edge only. My Round-0 L2 CI duplicate-work note is acknowledged as deferred to issue docmost#138.


Prior findings — status

  • [Round-0, Minor / optional / Level 2] docmost-client duplicates checkout+install+build with docmost-authz — deferred to issue Bug: Pasting images from the clipboard does not work. docmost/docmost#138 per coordinator; not re-raised. Still accurate (both jobs run the same fork install + editor-ext/base-formula build in parallel), still Level ≤2, still not merge-blocking.

New changes verified this round

  • pg-callsites.spec.ts scanner hardening + meta-guard (parent Add Page References Easily docmost/docmost#132) — confirmed no scan/suite ballooning. The real-tree walk is unchanged: listTsFiles(SRC_ROOT).flatMap(scanFile) still runs once at the first describe body over the same 151 files (~600 KB). The new scanSource(file, src) split lets the +16 meta-guard fixtures reuse the exact detection logic by parsing one-line in-memory strings (ts.createSourceFile('fixture.ts', <~1 line>)), not disk files and not the tree — ~16 extra parses of trivial input, sub-millisecond each, negligible against a ~25 s suite (reported 807/807 in ~25 s). Per-file cost order is unchanged: the scanner now runs two top-level forEachChild passes (each iterates only the source file's direct children — top-level import/var statements, not the subtree) plus the one recursive visit walk it already had. No new disk I/O, no nested/quadratic walk, no per-node getText() (still only on matched new Pool/Client sites). Clean.
  • ci.yml — docmost-client added to the image job's needs (parent Add Page References Easily docmost/docmost#132) — confirmed no-op for wall-clock. It is a single dependency edge; no new step, install, or build. image already gates on docmost-authz (which does the same fork install + editor-ext/base-formula build plus a full server nest build), so the lighter jsdom docmost-client job will not become the critical path — the added edge does not extend image's start time in practice.
  • Fork dead-route deletion (use-auth.ts, api-client.ts, app-route.ts — test(client): #46 regression + complete passwordless migration (#52) #6) — perf-neutral, marginally smaller bundle. Pure removal of unreachable route constants/entries. No runtime path, loop, query, or I/O touched.

Checklist coverage

  • N+1 queries: – no query code in the incremental diff
  • Unnecessary / repeated DB calls: ✅ none
  • Expensive loops: ✅ scanner remains a bounded one-time walk (151 files); meta-guard fixtures are ~1-line parses
  • Memory allocations: ✅ fixtures hold trivial strings + small Site[]; no large materialization
  • Async misuse: ✅ production code untouched
  • Blocking I/O: ✅ the only sync I/O is fs.readFileSync in the test (unchanged); fixtures add none
  • Caching opportunities: ✅ pnpm cache keying unchanged and correct

VERDICT: Approve | BLOCKING: 0 | OPTIONAL: 0 (1 deferred → docmost#138) | L3PLUS: 0 | MAXSEV: 2 | SHA: parent=0d63b37 fork=c4be329 | LENS: Performance

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🎨 Frontend / UI / UX Re-review — Round 1

Reviewer: Frontend / UI / UX Reviewer
Model: Claude Opus 4.8
PR / Diff: cccvu/docmost PR #6, HEAD c4be329 — coupled with parent cccvu/wiki-v2 docmost#132 (0d63b37, submodule re-pinned)
Visual check: attempted — not run. Deletion-only follow-up (removes dead route constants + their exempt entries); verified from file content at head + PR diff hunks. No renderable surface changed since round 0.
Verdict: Merge OK — my one prior finding is resolved, nothing user-facing broke.

Summary: Re-checked my round-0 Level-2 note. The orphaned FORGOT_PASSWORD/PASSWORD_RESET route constants and their two redirectToLogin() exempt entries are cleanly removed. No dead link, no broken redirect exemption, account-settings.tsx / route table untouched and still clean. Approve.

Prior finding — status

[Minor / L2] Dead route constants — app-route.ts (+ api-client.ts exemptPaths) — RESOLVED ✅

Confirmed at head c4be329:

  • app-route.ts AUTH block no longer defines FORGOT_PASSWORD / PASSWORD_RESET (block now: REQUEST_ACCESS → SETUP → CREATE_WORKSPACE → …).
  • api-client.ts redirectToLogin() exemptPaths is now [LOGIN, SIGNUP, MFA_CHALLENGE, MFA_SETUP_REQUIRED, "/invites"] — the two dead entries dropped.
  • use-auth.ts comment corrected to match (handlers already gone in round 0).

Did the fix break anything in my lane? — No

  • No dead link. There was never a navigable one; the constants are now gone entirely, so nothing can reference a removed route. Remote code search over apps/client/src returns 0 hits for FORGOT_PASSWORD / PASSWORD_RESET / forgot-password / password-reset / changePassword / forgotPassword / passwordReset / verifyUserToken.
  • No broken redirect exemption. Removing the two exempt paths is safe precisely because those routes no longer render — no legitimate flow can land on them. The only theoretical case (an unauthenticated visitor manually typing /forgot-password and an API call 401-ing) now redirects to /login instead of being exempted, which is the correct behavior, not a regression. The load-bearing exemptions (/login, /signup, MFA challenge/setup, /invites) are intact.
  • Layout untouched. account-settings.tsx and App.tsx unchanged this round — the round-0 clean divider structure and route table still stand.

Checklist coverage

  • State & data correctness: ✅
  • State coverage (loading / empty / error / disabled / focus): ✅
  • Design-system adherence (tokens, variants, no one-offs): ✅ (dead constants removed — prior ⚠️ cleared)
  • Shared-primitive blast radius (callers checked): ✅ (0 remaining refs to any removed symbol/route)
  • Bundle & load cost: ✅ (net deletion)
  • Runtime & rendering cost: – n/a
  • Accessibility: ✅ (no interactive surface changed)
  • Responsive & interaction UX: ✅ (account-settings / routes unchanged)

No remaining Frontend/UX findings.

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🏛️ Architecture Re-Review (round 1) — Architecture lens

Reviewer: Architecture Reviewer
Model: Claude Opus 4.8
PR / Diff: COUPLED — cccvu/wiki-v2 docmost#132 (parent, 0d63b37) + cccvu/docmost #6 (fork, c4be329). Submodule re-pinned so docmost-client runs the completed fork.
Verdict: Approve — my round-1 L3 is fully resolved; remaining items are Level ≤2, tracked in docmost#138.

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 app-route.ts + api-client.ts

Verified against the diff:

  • app-route.ts drops AUTH.FORGOT_PASSWORD and AUTH.PASSWORD_RESET — the two orphaned route constants are gone.
  • api-client.ts drops both entries from redirectToLogin()'s exemptPaths — the dead redirect-exemption branch is gone.
  • use-auth.ts comment corrected — no longer claims useAuth "owns … forgot/reset … verify-token"; now reads "useAuth now owns only logout, workspace setup, and invitation signup." The stale-comment half of the finding is fixed too.
  • Boundary cost = zero, as predicted: both files were already documented seams (§7 api-client.ts, §8 app-route.ts), so the removal touched no new upstream file and the boundary check stays green.
  • Documentation is accurate and forward-safe: §7 now records dropping the two exemptPaths entries with "On upstream bump: … do NOT re-add the two dead password routes to exemptPaths," and §8 records removing the two constants with the matching "do not re-add" bump guidance. The migration's "no dead password code" invariant is now actually complete — nothing orphaned survives (verified no remaining consumers of the removed symbols).

This is the seam-consistent completion of the F1 removal. Nicely done.

⏭️ DEFERRED (tracked → issue docmost#138) — the three Level ≤2 items, unchanged this round, correctly not re-raised here:

  • [Level 2] DriverProfile optional-field union vs. true discriminated union (db-url-contract.d.ts) — still an optional-fields shape; deferring is fine (closed 4-profile hand-authored set, zero-dep .js).
  • [Level 2] db-url-contract/lintDbUrl/DRIVER_PROFILES naming now spans Redis — comments own it; rename not worth the call-site churn.
  • [Level 1] §6 App.tsx bump checklist doesn't itself list the two removed routes — the "unrouted" instruction lives in §42–49; adequate.

New changes this round — architecture check

  • pg-callsites.spec.ts hardening — ✅ sound, strengthens the invariant. The fitness function now recognizes pg's Pool/Client across every binding form (named + aliased, default, namespace, require('pg') identifier + destructured, one-hop const-alias) and both bare-identifier and member (new pg.Pool(...)) construction, with a self-verifying scanner … meta-guard describe pinning the scanner against fixtures. This closes real bypass vectors the round-1 version (named/aliased + direct/spread arg only) would have missed, and the meta-guard is the right "test the fitness test" pattern (analogous to the vacuous-pass guard). Documented limitations — multi-hop aliasing and config-variable indirection read as violations — are the correct conservative direction (fail toward flagging). No structural concern; this is a robustness improvement, not new surface.
  • CI docmost-client → image job needs — ✅ sound, closes a real gate gap. Adding the client-test job to the tagged image build's needs (alongside its existing membership in the ci-ok aggregate + assert loop) means an image can't be built from a submodule-pointer bump to a red client commit. Structurally consistent with how the other test jobs gate the image; the correct DAG edge for the parent-runs-submodule-tests topology.

Checklist coverage


VERDICT: Approve | BLOCKING: 0 | OPTIONAL: 3 | L3PLUS: 0 | MAXSEV: 2 | SHA: parent=0d63b37 fork=c4be329 | LENS: Architecture

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🔒 Security Re-Review (Round 1) — Security lens

Security Reviewer: Security Reviewer — Claude (independent Security lens, coupled two-PR re-review)
Model: Claude Opus 4.8
PRs: PARENT cccvu/wiki-v2 docmost#132 · FORK cccvu/docmost #6
New HEADs: parent 0d63b37 · fork c4be3299 (parent submodule gitlink verified == c4be329979… == fork head — the completed fork is what docmost-client runs)
Date: 2026-09-02
Prior review: parent 4c86541 / fork 7c4f7c7 → 0 blocking, 5 optional (1 at L3)

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 — disposition

F-1 (Medium/L3) — server-side password endpoints persist → ✅ TRACKED as docmost#139

cccvu/wiki-v2#139 "Docmost server still exposes password-lifecycle endpoints (passwordless invariant is network-only)" — OPEN, labels security + Priority Level 3. Correctly scoped as pre-existing, in neither diff, mitigated by the ALB /api/auth/* deny, and needing its own fork server PR. Deferring it is the right call; it does not block this pair.

F-2 (Low) — pg-scan fail-open blind spots → ✅ RESOLVED (materially hardened)

services/platform/src/db/pg-callsites.spec.ts now closes both blind spots I raised, and did it well:

  • Import/construction coverage — the scanner recognizes pg's Pool/Client bound via named (incl. aliased), default (import pg from 'pg'), namespace (import * as pg), import pg = require('pg'), const pg = require('pg'), destructured require (const { Pool } = require('pg')), and one const-alias hop (const { Pool } = pg / const P = pg.Pool); and isPgCtor matches member construction new pg.Pool() (the PropertyAccessExpression case my finding called out as invisible). Blind spot (a) closed.
  • Override-after-spread — argIsCompliant now requires the neutralizer spread and no CONNECTION_OVERRIDE_KEYS (ssl/connectionString/host/hostname/port/user/password/database) key afterward, so { ...toPgConnection(u), ssl:false } is flagged. Blind spot (b) closed.
  • Meta-guard — a new describe pins 11 bypass fixtures (must redden) + 4 compliant fixtures (must pass) + a no-false-positive-on-unrelated-Pool case, exercising the same scanSource that gates the tree. This is a mutation guard for the guard; a future weakening reddens here. No vacuous pass (both the tree scan and meta-guard assert count > 0).
  • Fails closed on the residual (multi-hop alias / config-variable indirection read as violations), and the remaining fail-open edges (a second opaque spread; a computed-key override like {["ssl"]:false}) are honestly documented and backstopped by deploy Gate 7 — contrived idioms, no real site, and strictly better than round 1. Acceptable; folded into the Bug: Pasting images from the clipboard does not work. docmost/docmost#138 polish envelope, not a new finding.
  • All four real callsites remain compliant (platform 807/807 green per author; none carry override keys).

F-3 (Low) — routing-boundary test is a call-log assertion → ✅ TRACKED as docmost#138

cccvu/wiki-v2#138 (P2 polish, OPEN) — the auth-service module-wide scan is deferred there. Appropriate for a P2.

F-4 (Info) — dead route constants → ✅ RESOLVED (+ a bonus tightening)

FORGOT_PASSWORD/PASSWORD_RESET removed from app-route.ts, the stale use-auth.ts comment corrected, and the two dead paths removed from redirectToLogin()'s exemptPaths in api-client.ts. Security note: dropping paths from exemptPaths is a fail-closed tightening — those paths now redirect an unauthenticated visitor to login instead of being public — and only the two dead password paths were removed; every still-needed exemption (LOGIN, SIGNUP, MFA_CHALLENGE, MFA_SETUP_REQUIRED, /invites) is intact. No live public surface lost its exemption. No regression.

F-5 (Info) — plaintext Redis — unchanged; remains correct/deferred (rediss:// hardening).

Did the fixes introduce anything worse? — No

  • CI gate is strictly stronger: docmost-client is now in the image job's needs (ci.yml:324) in addition to ci-ok needs + the result != "success" → exit 1 loop (:638/:654). A red fork client suite now blocks both merge and the deployable image build. Non-privileged runner, no env: secrets — unchanged.
  • Coupling verified: the parent submodule re-pins to c4be329979… (== fork head), so the gate executes the finished fork including the F-4 cleanup.
  • No behavior touched: round-1 fixes are confined to the CI test scanner (stronger), dead-code removal (fail-closed), corrected comments, and CI needs edges. The load-bearing security behavior I confirmed last round is unchanged — rollback fails closed (no navigate on bridge/rollback failure), dual-session logout() preserved, routing allowlist matches infra, REDIS contract additive/null-safe, boundary-check SIGPIPE fix preserves fail-CI-on-undocumented, no secret leakage in lint messages.

Checklist coverage (delta only)

  • ✅ Authentication — F-1 tracked (Feature Request: Add automatically generated "Table of Content" to the side bar docmost/docmost#139); no auth/session behavior changed by the fixes; exemptPaths change is fail-closed
  • ✅ Injection / Architecture — F-2 pg-guard hardened + self-verifying; all real sites compliant
  • ✅ CI trust / supply-chain — docmost-client gates merge and image; submodule re-pinned to completed fork; boundary check intact
  • ✅ Secrets / logging / transport — unchanged; no new exposure

Notes


SHA confirmation — parent 0d63b376aecadee47cc6ca4be31ad5b3ec97c164 (0d63b37), fork c4be329979c03e689bc847517fb596f4c3a469fd (c4be329).

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🚀 DevOps / Operations / Reliability Re-review — Round 1

Reviewer role: DevOps / Operations / Reliability Reviewer
Model: Claude Opus 4.8
Change: Coupled pair — cccvu/wiki-v2 docmost#132 (0d63b37) + cccvu/docmost #6 (c4be3299)
Date: 2026-09-02

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) — docmost-client now in the image job's needs

  • [PARENT] .github/workflows/ci.yml — the incremental diff (4c86541…0d63b37) is a single hunk adding - docmost-client to the image (build-once → ECR) needs:, between docmost-authz and pep-pdp-roundtrip. The image job now depends on all 9 gating jobs (previously 8), restoring its "images build only after tests pass" invariant: a red client-test regression now blocks the ECR build itself, not only the deploy. ci-ok.needs and its assert loop already carried docmost-client (unchanged — no other ci.yml hunk), so the gate remains wired in all three places that enumerate the required set. Confirmed fixed.

✅ Addressed — parent submodule re-pinned to the tested fork head

  • [PARENT] docmost gitlink is now c4be329979c03e689bc847517fb596f4c3a469fd, which equals the fork PR test(client): #46 regression + complete passwordless migration (#52) #6 head c4be3299 (verified via gh pr view 6 --json headRefOid). So every submodules: true job — including docmost-client — tests exactly the final fork state (the one carrying the F1 route-constant cleanup), not the stale 7c4f7c7. This is the correct re-point and self-covers the round-0 merge-sequence note (the pin now tracks the head CI actually runs); the coordinator confirms the coupling comments carry the merge-order guidance.

📋 Deferred (was 🔵 L1) — editor-ext/base-formula built twice across fork jobs → tracked as issue docmost#138. Fine to leave; not blocking.

Round-1 changes — new-risk sweep (my lane)

  • [PARENT] pg-callsites.spec.ts hardening — broadens the AST scanner (default/namespace/require('pg')/one-hop-alias bindings, new pg.Pool() member construction, and spread-then-ssl/connectionString/host/port override detection) plus an in-memory fixture meta-guard. From the ops lens this strengthens the CI fitness function that guards the feat(authz): bounded append/prepend idempotency at the commit boundary (#429) #44/fix(auth): __Host- the Docmost session cookie to stop sibling-origin shadowing (cccvu/wiki-v2#310) #42 driver-split incident class (a deploy-safety invariant), catching bypass idioms that would previously only be caught at deploy-time Gate 7. No new CI failure mode: the meta-guard scans inline fixture strings (no extra tree files walked; path.isAbsolute guard keeps relative fixture names intact), parsing is deterministic, and the platform suite is green (807/807 reported) — so no false-positive that would red the gate on legitimate current callsites.
  • [FORK] api-client.ts / app-route.ts / use-auth.ts — dead-config removal of the two now-deleted routes (/forgot-password, /password-reset): dropped from redirectToLogin()'s exemptPaths, the APP_ROUTE.AUTH constants deleted, and a docstring updated. No runtime/routing behavior change — those routes are unrouted and unreachable, so their presence in exemptPaths (the 401-redirect-loop guard) was already inert; the reachable auth pages (LOGIN/SIGNUP/MFA//invites) are untouched. All three are already-documented upstream seams, so the boundary check stays green (exit 0, 5/5 reported).
  • No change to the REDIS surface, Gate 7 (runCli still filters kind !== 'redis'), buildspec-deploy.yml, ecs.tf, or any SSM/IAM path — the CLAUDE.md co-ship rule remains non-triggered.

What I verified

  • Parent incremental diff 4c86541…0d63b37: only ci.yml (the one image.needs line), UPSTREAM_MODIFICATIONS.md, the docmost gitlink, and pg-callsites.spec.ts changed — scope matches the round-1 description exactly, no scope creep into deploy/infra config.
  • Gitlink c4be3299 == fork headRefOid — the pin points at the tested commit.
  • Fork incremental diff 7c4f7c7…c4be3299: only the 3 dead-config files — no server, schema, contract, or ALB-path surface touched.

VERDICT: Approve | BLOCKING: 0 | OPTIONAL: 0 | L3PLUS: 0 | MAXSEV: 1 | SHA: parent=0d63b37 fork=c4be3299 | LENS: DevOps

The image-gate fix and the re-pin close my round-0 finding; the pair is operationally sound to merge (fork #6 first, then parent docmost#132).

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🐛 Correctness Re-Review (round 1) — Bug Hunter

Reviewer role: Correctness Reviewer
Model: Claude Opus 4.8
PR / change: COUPLED — cccvu/wiki-v2 docmost#132 (0d63b37) + cccvu/docmost #6 (c4be3299, submodule re-pinned). Closes #49 / #52.
Date: 2026-09-02
Lens: Correctness — re-review of my 3 round-1 findings + a fresh hunt for anything the fixes introduced in my lane.

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/require pg imports → RESOLVED. The scanner now recognizes every binding shape and I re-derived each against pg-callsites.spec.ts:

  • Pass 1 collects pgNamespaces from import pg from 'pg' (clause.name), import * as pg (NamespaceImport), import pg = require('pg') (ImportEqualsDeclaration), const pg = require('pg') (identifier require), and pgCtorNames from named/aliased imports and const { Pool } = require('pg') destructuring.
  • Pass 2 resolves one const-alias hop (const { Pool } = pg, const P = pg.Pool) off a namespace, correctly running AFTER Pass 1 so pgNamespaces is fully populated regardless of declaration order.
  • isPgCtor matches both bare-identifier (new Pool) and member (new pg.Pool) construction.
  • The meta-guard's 11 bypass fixtures each assert count>0 && anyBypass and the 4 compliant + 1 no-pg fixtures assert the inverse — I traced all 16 through scanSource and every one lands on its asserted result. Critically, the meta-guard calls the same scanSource that gates the tree, so it can't drift from the real check. The docstring's "any present or future site" claim is now backed by executed fixtures rather than prose.

#2 (was 🟡 L1) — orphaned FORGOT_PASSWORD/PASSWORD_RESET constants + exempt-paths → RESOLVED. Both constants removed from app-route.ts; both exemptPaths entries removed from api-client.ts:redirectToLogin() with the rest of the list (LOGIN, SIGNUP, MFA_*, /invites) intact and well-formed. Round-1 established those were the only two reference sites in the client tree, so zero references remain — clean.

#3 (was 🔵/L1) — stale use-auth.ts comment → RESOLVED. Now reads "The password-lifecycle handlers (forgot/reset/change/verify-token) were removed with their dead UI (issue #52); useAuth now owns only logout, workspace setup, and invitation signup." Accurate to the code.

Fresh hunt — what the fixes could have broken (my lane)

  • No false-positive on the 4 real pg sites. role-relay.service.ts:59 + migrate.ts:34 are bare new X(toPgConnection(...)) → compliant; docmost-db.ts:26 + database.module.ts:17 are { ...toPgConnection(x), max: N } → max is deliberately NOT in CONNECTION_OVERRIDE_KEYS, so compliant. No spread-override false-positive. (Consistent with the reported 807/807.)
  • Override-after-spread logic is sound, not over-broad. CONNECTION_OVERRIDE_KEYS = ssl/connectionString/host/hostname/port/user/password/database. The .some() over arg.properties skips the spread element itself (propKeyName returns undefined for SpreadAssignment), so { ...toPgConnection(u) } alone stays compliant; only a real re-introduction of connection/TLS config flips it. Pool-tuning keys (max, timeouts, application_name) pass.
  • No new pg construction slipped in. Every new Pool/Client / new pg. / require('pg') addition in the parent diff is inside the spec's docstring or fixtures — no new real pool anywhere in the change.
  • Documented limitations fail CLOSED. Config-variable indirection (const c = toPgConnection(u); new Pool(c)) and multi-hop aliasing read as violations, not silent passes — the safe direction; the one non-flagged case (a second opaque ...override spread) is honestly disclosed and backstopped by deploy Gate 7. Deferring these to Bug: Pasting images from the clipboard does not work. docmost/docmost#138 is appropriate.
  • Fork exempt-path removal doesn't change live auth behavior — the two dropped paths were already unreachable (routes unrouted in the prior commit); the surviving 401-redirect exemptions are unchanged.
  • REDIS kind discriminator, boot-lint, SIGPIPE fix (approved round 1) — unchanged in this push; still correct.

Findings

None. 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

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

🧪 Test Review — QA Engineer's Eye — RE-REVIEW (Round 2)

Reviewer role: Test Reviewer
Model: Claude Opus 4.8
PR / change: Coupled pair — cccvu/wiki-v2 docmost#132 (0d63b37) + cccvu/docmost #6 (c4be329, submodule re-pinned). Re-review of the round-1 findings after the pg-scan hardening + fork F1 cleanup.
Date: 2026-09-02
Prior review: my Round-1 Test Review (verdict Approve, 0 blocking, 4 optional). This re-checks each prior finding against the new commits and hunts the new commits for test-lens regressions.

Posted to both PRs. Findings labelled [PARENT] / [FORK], each with merge-blocking/optional, a Priority Level (1–5), and DOCS: where doc/comment-only.

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/require pg imports + member new pg.Pool() — is fixed, and (2) the new meta-guard genuinely pins detection (non-vacuously, over the exact scanSource the tree walk uses). I verified the fix empirically by replaying the scanner's two-pass AST logic against the platform's own TypeScript 5.9.3. One new optional Level-2 DOCS inaccuracy surfaced in the hardened docstring (a limitation described as fail-closed is actually fail-open); it's non-blocking and can fold into the already-planned docmost#138 doc note.

Prior findings — dispositions

✅ RESOLVED — [PARENT] pg-scan blind to default/namespace pg imports (was 🟡 Level 3)

  • Verified empirically, not on the author's word. I replicated the new scanSource two-pass detection against the platform's [email protected] and ran the exact bypass idioms:
    • import pg from 'pg'; new pg.Pool({connectionString}) → detected=true, flaggedAsBypass=true ✅ (was the silent false-negative)
    • import * as pg from 'pg'; new pg.Client({connectionString}) → detected + flagged ✅
    • const pg = require('pg'); new pg.Pool({connectionString}) → detected + flagged ✅
    • { ...toPgConnection(u), ssl: false } (override-after-spread) → detected + flagged ✅ (a hole I hadn't even raised — good defensive add)
    • Both real compliant shapes ({ ...toPgConnection(u), max: 6 }, new Client(toPgConnection(u))) → detected + not flagged ✅ (no false positive on the 4 live sites)
  • Meta-guard genuinely pins detection (the round-1 concern): the new describe('the scanner recognizes every pg construction + bypass shape (meta-guard)') drives the same scanSource function (via scanFile), so the fixtures gate the identical logic — not a lookalike. Non-vacuity holds in both directions: each of the 11 bypass fixtures asserts count > 0 (construction is seen) and anyBypass === true (read as a violation); each of the 4 compliant fixtures asserts allCompliant (which requires sites.length > 0), so an undetected compliant fixture also reddens; the no-pg case asserts []. A future weakening that made, say, default-import invisible flips that fixture's count to 0 → red here rather than silent in prod. This is a real mutation-guard-for-the-guard.

✅ RESOLVED — [FORK] DOCS: leftover route constants + dead exempt-path reference (was 🟡 Level 1)

  • Confirmed at c4be329: FORGOT_PASSWORD/PASSWORD_RESET removed from app-route.ts; the two entries removed from redirectToLogin's exemptPaths in api-client.ts (now LOGIN/SIGNUP/MFA_CHALLENGE/MFA_SETUP_REQUIRED//invites); the stale use-auth.ts comment fixed. Tree-wide grep for the deleted password symbols returns clean. The cleanup commit touched only 3 non-test files — the round-1 regression tests (use-passwordless.test.tsx, auth-service.test.ts) are byte-unchanged, so my round-1 assessment of them (both mutation-proof) still stands.

⏸️ DEFERRED → issue docmost#138 — [FORK] auth-service.test.ts boundary invariant is a 3-op assertion, not module-wide (was 🟡 Level 2)

✅ Documented (no action needed) — [PARENT] pg-scan white-box brittleness (was 🟡 Level 2)

  • The config-VARIABLE false-positive (const c = toPgConnection(u); new Pool(c) reads as a violation) is now explicitly written into the new "Limitations" block and is fail-closed (safe direction). Author-accepted tradeoff; nothing to change.

New finding (surfaced by the hardening)

🟡 Minor — [PARENT] DOCS: "Limitations" docstring mislabels multi-hop aliasing as fail-closed when it's fail-open

  • optional · Priority Level 2 · non-blocking
  • Category: Weak/misleading comment about a security-relevant guard's coverage
  • Location: services/platform/src/db/pg-callsites.spec.ts — the "Limitations (documented, accepted…)" docstring block (first bullet)
  • Gap: The comment lumps two cases together: "Multi-hop aliasing / reassignment (const P = pg.Pool; const Q = P; new Q(...)) and a construction built from a config VARIABLE (const c = toPgConnection(u); new Pool(c)) read as violations, not passes — indirection that could hide a bypass is flagged, so the failure is safe." Only the config-variable half is true. The multi-hop half is false: I ran the multi-hop idiom through the scanner replica → detected=false, count=0, flaggedAsBypass=false. The second-hop const Q = P (where P is already a resolved ctor name, not a namespace) is tracked by neither Pass 1 nor Pass 2, so new Q(...) is invisible — a silent fail-open, the opposite of "flagged / the failure is safe."
  • Why it matters: It's a comment, so no runtime defect today — but it gives false confidence in the dangerous direction. A future maintainer who refactors a real pg site through a two-hop alias would get no CI warning while believing (per this comment) that "indirection that could hide a bypass is flagged." Consequence is bounded: multi-hop constructor aliasing is exotic, and deploy Gate 7 still fails-closed on a driver-hostile URL that actually reaches pg at runtime — which is exactly why this stays Level 2, not higher.
  • Suggested fix (pick one): (a) correct the sentence to state that multi-hop reassignment is not detected (fail-open, backstopped only by Gate 7), keeping the config-variable case as the fail-closed example; or (b) add a multi-hop alias fixture to the meta-guard's BYPASSES list — it will fail today, forcing either real handling or an honest "not covered" note. Natural fold-in for the Bug: Pasting images from the clipboard does not work. docmost/docmost#138 §6 doc note.

Coverage map — round-2 delta

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-client added to the image job's needs) 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.

@PMQ9

PMQ9 commented Sep 2, 2026

Copy link
Copy Markdown
Author

✅ Seven-lens review GREEN at HEAD — ready for human merge (do not auto-merge)

Round 1 of the coupled /pr-review-comprehensive (parent cccvu/wiki-v2#132 ⇄ fork cccvu/docmost#6) is complete. Reviewed HEADs: parent 0d63b37 · fork c4be3299 (submodule re-pinned, so docmost-client gated the completed fork).

Final verdict — all seven lenses Approve at HEAD (0 blocking, 0 non-blocking Level 3+)

Lens Verdict Blocking L3+
Architecture Approve 0 0
Correctness Approve 0 0
DevOps/Reliability Approve 0 0
Frontend/UX Approve 0 0
Performance Approve 0 0
Security Approve 0 0
Testing Approve 0 0

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:

  • fix(#455): revoke the relayed fork session on account disable (fork half) #49 pg-callsite scan hardened (Testing L3 + Security F-2 + Correctness) — now catches default/namespace/require pg imports, member new pg.Pool(), one const-alias hop, and ssl/connectionString override-after-spread; a self-verifying meta-guard makes the invariant an executed assertion. Testing empirically replayed it and confirmed the old silent false-negative is gone; all 4 real sites still pass.
  • F1 dead-route cleanup completed (Architecture L3 + 3 lenses) — orphaned route constants + their exemptPaths entries removed, stale comment fixed, UPSTREAM_MODIFICATIONS.md §7/§8 updated; boundary check green.
  • Plus DevOps's on-thesis L2: docmost-client wired into the image job's needs.

Follow-ups (all non-blocking, tracked)

For the human merge (per repo norm — reviewers don't merge)

  1. CI is re-running on the new HEAD 0d63b37; wait for CI OK green.
  2. Merge fork docmost#6 → wiki-v2 first, then re-point the parent's docmost submodule gitlink to the merged SHA, then merge #132.

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