Skip to content

fix: pre-release review P2 ride-along (slug 404 fold, txn guards, error split, config/rules) - #246

Merged
voidvec merged 2 commits into
masterfrom
chore/review-p2-ridealong
Oct 9, 2026
Merged

voidvec merged 2 commits into
masterfrom
chore/review-p2-ridealong

Conversation

@voidvec

@voidvec voidvec commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Summary

P2 ride-along batch from the comprehensive v1.3.2..master pre-release review — the cheap, high-value P2s that should ship with v1.4.0 (follows #245, the P0/P1 batch). Leftover P2s are being registered as tracking issues.

Changes

Backend hardening

  1. Org-slug existence oracle closed — the four caller-membership gates on /api/me/organizations/{slug}/* (member list, member remove, consent-request file, consent-request withdraw) answered 403 "not a member" for an existent-but-foreign org vs 404 for a nonexistent one; any authenticated user could enumerate which org slugs exist. Now folded into the same 404 shape (the Organization slug enumerable via open-platform create/transfer error shapes #229/Client provenance enumeration + owner_name on the consent redirect URL #223 discipline ApplicationService already applies). Role gates for actual members are unchanged (403) — a member legitimately knows the org exists. ⚠ Behavior change: non-member calls that previously returned 403 now return 404 (FileGuards test updated; no frontend/SDK code branches on the old 403 for these endpoints).
  2. Transaction exactly-once guards — OrgConsentRepository::saveConsent and OrgSuccessionRepository::effectSuccession funnel every inline failure path and the COMMIT callback through an invokeOnce wrapper (the saveTokenPair real-incident hardening pattern) instead of resting solely on "a rolled-back transaction never fires its commit callback".
  3. Consent-request lookups distinguish infra failure from no-row — new three-state findPendingEx/findByIdEx (dbOk/found/row); re-file/approve/reject now answer DB_QUERY_ERROR (5xx) on lookup failure instead of masquerading as business 404/409 (loadOwnerRow normalizes DB failures to 'no owners row' on the application-management surface #230 Error-vs-NoRow policy). Old two-state methods kept (documented as folding).
  4. transfer-ownership contract completed — openapi.yaml documents 409 (target left mid-transfer) and 500 (demotion failure, retry-safe); SDK regenerated; api-diff additive baseline ratified.

Config / docs / frontend

  1. open_platform config completeness — max_pending_invitations_per_org added to all four configs (the env-override channel for that bound was dead: overrides only land on existing paths); config.bench.json gains the full fail-closed block it lacked entirely.
  2. Rule backfill — the user-ratified seventh raw-SQL exemption (advisory-lock primitives, AdvisoryLock.cc) recorded in .claude/rules/db-operations.md; rule text and code had drifted.
  3. OrganizationsPage nits — post-mutation refresh is now a direct refreshMembers (no close/reopen flicker; invite input preserved); non-numeric successor user ID surfaces a validation message instead of a silent no-op (new i18n key en+zh); the consents-panel error path mirrors the success path's org-switch race guard.

Verification

  • fulla-server/fulla-tests Release build green; 9 targeted tests pass (consent-request family ×3 incl. the updated FileGuards expectation, succession family ×2, owner transfer, OrgSlug_Uniform404, invitation round-trip, fingerprint baseline).
  • Frontend: build + vitest 37/37 + Playwright 145 passed / 2 skipped; i18n parity (new key in both locales).
  • Five local gates green; SDK drift check green.

Review-finding mapping

Finding Severity Here
C-5 / E-F2 slug existence oracle P2 folded to uniform 404
B-2 missing invokeOnce guards P2 both repositories guarded
B-4 consent-request error folding P2 Ex variants + 5xx
C-4 open_platform config gaps P2 all five configs complete
C-7 transfer-ownership response codes P2 yaml + SDK
D-4/5/6 frontend nits P2 all three
B-3 rule/code drift (7th raw SQL) P2 rule updated

Deferred to tracking issues: domain-layer [this] conventions, org resolution without openid, domain unit-test gap, callback indentation, introspection org_id semantics doc, fire-and-forget tail scopes reconcile, social login state (feature), modal dedup, RFC 7591 yaml wording, admin-endpoint tag drift, list() double-response guard wiring, fail-closed owners hot-path ops note.

- Org-slug existence oracle closed: the four caller-membership gates on
  /api/me/organizations/{slug}/* (member list, member remove,
  consent-request file, consent-request withdraw) answered 403
  "not a member" for an existent-but-foreign org vs 404 for a
  nonexistent one — any authenticated user could enumerate org slugs.
  Now folded to the same 404 shape (#229/#223 discipline, matching
  ApplicationService's own uniform 404). Role gates for actual members
  (403 owner-or-admin) are unchanged — members legitimately know the
  org exists. FileGuards test updated to the folded expectation.
- Transaction exactly-once guards: OrgConsentRepository::saveConsent and
  OrgSuccessionRepository::effectSuccession now funnel every inline
  failure path and the COMMIT callback through an invokeOnce wrapper
  (saveTokenPair's real-incident hardening pattern) instead of relying
  solely on "a rolled-back transaction never fires its commit callback".
- OrgConsentRequestRepository: new three-state findPendingEx/findByIdEx
  (dbOk/found/row) — decision endpoints no longer render infrastructure
  failures as business 404/409 (#230 Error-vs-NoRow policy). The re-file,
  approve and reject paths answer DB_QUERY_ERROR on lookup failure.
- transfer-ownership openapi: documented 409 (target left mid-transfer)
  and 500 (demotion failure; retry-safe) responses; SDK regenerated;
  api-diff additive baseline ratified (Ex overloads).
- open_platform config blocks completed: max_pending_invitations_per_org
  added to all four configs (the env-override channel for the M6 bound
  was dead — overrides only land on existing paths), and config.bench
  gained the full fail-closed block it was missing entirely.
- db-operations.md: the user-ratified seventh raw-SQL exemption (advisory-
  lock concurrency primitives, AdvisoryLock.cc) is now recorded — the rule
  text and the code had drifted.
- OrganizationsPage: post-mutation refresh uses a direct refreshMembers
  (no close-then-reopen flicker, invite input preserved); nominating a
  successor with a non-numeric user ID now surfaces a validation message
  instead of a silent no-op; the consents-panel catch mirrors the success
  path's org-switch race guard. New i18n key in en + zh-CN.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@voidvec
voidvec merged commit ad73f40 into master Oct 9, 2026
15 checks passed
@voidvec
voidvec deleted the chore/review-p2-ridealong branch October 9, 2026 04:15
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