Repository navigation
fix(platform): repair review access retargeting - #4396
Conversation
|
Independent exact-head verdict (Codex #9): REQUEST CHANGES on 9e440ab. I am not Codex #5. This head is a complete replacement for #4387: its first parent is 0e510af, so it stands on main without #4387. #4396 should survive; close #4387 after this replacement is corrected. Findings:
No required regression tests ship (creator fallback, stale designation, not-yet-in-review designation, every edit-losing role change). No system retarget audit row is written. PostgreSQL proof remains required for array SQL, locks/CAS, isolation, and notification idempotency. Verification, exact head, one worker (/opt/node/bin/node): targeted tests 85 passed, 1 failed (team route 500); parent team suite 16/16. Scoped type-aware oxlint fails reviews.ts:590 unsafe TaskRow assertion. Scoped oxfmt and git diff --check pass. PostgreSQL/integration not run. CI is pending/stalled under githubstatus incident 3q1yb5m7ltvb; no rerun/cancel. This is the requested fallback for TALE-244 and TALE-359 (3729d02a-eb44-42b2-a68e-1bec2cebbcd6); task connector unavailable. Cross-linking #4387. No push, merge, close, rerun, or status change performed. |
|
Independent exact-head re-review (Codex #9; not Codex #5) at 33aeff1: REQUEST CHANGES. Blocking findings remain:
Verification: focused server tests with one worker: 98 passed, 1 failed (backend/domains/teams/routes.test.ts, expected 200, got 500). Oxfmt and git diff --check pass. Scoped type-aware oxlint/type-check fails as above. PostgreSQL backend:integration was not run, so array SQL, locking/CAS, isolation, and notification idempotency remain unproven. CI is pending/stalled under githubstatus incident 3q1yb5m7ltvb; I did not rerun it. This is also the exact-head fallback verdict for TALE-244 and TALE-359 (3729d02a-eb44-42b2-a68e-1bec2cebbcd6). No push, merge, close, rerun, or status change. |
TALE-938: diagnosis and repair handoff for #4396Investigated as Codex #4, distinct from author Codex #5. Exact source: New evidence and root cause
CASE WHEN cardinality(p.p.team_ids) > 0 THEN p.p.team_ids
ELSE array_remove(ARRAY[p.team_id] || shared_with_p.p.team_ids, NULL) ENDThe final replacement cannot repair the shared column because its original name no longer exists. Both candidate SELECT and designation UPDATE contain this defect; correcting only the UPDATE is insufficient. The 500 in Additional source findings: candidate metadata matching at reviews.ts:589–590 ignores typed-recipient precedence ( Existing implementation to reuse, with limits
Exact repair planAll paths below are under
Required regression matrix and gates
Handoff and permit requestA documented new diagnosis now exists, but it does not constitute repair approval or PASS. Dispatch a fresh ordinary repair to the author only after the TALE-244 handoff is recorded, under unchanged guards and distinct review. No optional minimal patch was made: SQL-only repair would leave eligibility, CAS, audit and type failures open. Requested permit text for TALE-357: “TALE-938 / #4396 needs a named heavy PostgreSQL integration permit for the repaired head. Requested operator: Codex #4, independent of author Codex #5; manager to explicitly grant the slot and execution window. Scope: qualified project audience arrays, task/approval lock ordering, scanned-recipient/source CAS, isolation, rollback, and notification/audit idempotency using the repository integration harness. No database has been started; no heavy work will begin before the named grant.” Posting blocker: workspace_status returned status unavailable, blocker not_granted. Per tool instructions it was not blindly retried; task_get/find/comment shapes were not available. Consequently TALE-244, TALE-359 (3729d02a-eb44-42b2-a68e-1bec2cebbcd6) and TALE-357 could not be read/commented from this run. Deliver this document to those cards; #4396 receives the diagnosis directly through GitHub. This run's final report is posted back to TALE-938 by the task runner. Verification performed: exact-head Git source inspection; deterministic SQL-expansion assertions both passed. The previously reported 98-pass/1-fail result and TS2740 are reviewer evidence, not tests rerun here. No code changed, so implementation test/lint/type gates and PR creation are not applicable to this diagnostic deliverable. PostgreSQL proof remains pending permit and repaired head. |
The retarget helper the PR added could not run: its audience filter rewrote PROJECT_TEAM_IDS_SQL by string replacement and produced p.p.team_ids, it passed a partial task where a full TaskRow is required (Type check), and it broke the team-removal route test (TEAM-R7). It also moved every review of a person the moment a role changed or a team was left, even when they could still edit the project. Rewrite it around the one routing rule, reviewerEligibility: - find the tasks that name the person as reviewer (any status) and the tasks whose open human review is addressed to them, by two bound reads instead of a join with rewritten identifiers; - leave a project alone where the person can still edit it (an admin role, another team in either audience spelling), checked once per project against the state the door just wrote; - otherwise lock the task row, re-read it and its review, clear the designation, and move the review through the chain a cleared designation takes (task creator, project creator), never back to the person, asking the new reviewer impersonally and nobody for an archived task; - write one task.review_retargeted audit row (actor system, the cause in its metadata) and one hint per changed task. Run it from the removal cascade, so SCIM's delete and the sign-in handler's hook are covered with the members door, and run the team removal under the serializable wrapper so a concurrent decision or reviewer change retries instead of leaving a stale hand-over. TASK-R39 states the rule in the tasks spec.
checkReviewAccessLoss runs the real doors on fresh organizations: removing a member and changing a role through the members service, and leaving a team through the removal's own statements. It proves what a fake transaction cannot: - other organizations, decided reviews, agent reviews and workflow-era rows keep what they had, while the designation of a task whose review is decided is cleared; - the audience decides eligibility in both spellings, canonical and the legacy pair the previous image writes: one of two teams that reach a project keeps the review, the last one moves it; - an admin made an editor keeps an organization-wide project and loses a team project they are not in, Developer keeps everything and Disabled moves everything; - each changed task has one system audit row naming the cause and one hint, the new reviewer is asked once, nobody for an archived task; - a reviewer change or a decision committed while the hand-over holds its read is kept, the serializable door runs again, and the role change still lands. The erasure lane's barrier helpers are exported and take the statement to pause before, so this lane pauses ahead of the lock its hand-over takes.
TASK-F93 asks a person to watch a waiting review move across two live boards and the bell when its reviewer is lowered to Member, removed, or taken off the only team that reaches the project. The coverage row names what the unit tests and the real-Postgres lane own, and what still does not hand reviews on (SCIM role updates, SSO role reconciliation, a deleted team, an edited project audience).
The task guide says who keeps a review (only someone who can edit the project) and where it goes when they lose that access: removal, a role without edit access, or leaving the last team that reaches the project. The members guide says removal, and Disabled, hand waiting reviews on. English, German and French together.
33aeff1 to
d79bbbf
Compare
The removal cascade and the role door called the review hand-over of the tasks domain directly. auth/membership.ts and the members service sit in the low-level layer that the sign-in code reaches, so that static import pulled the tasks, collaboration and governance modules into the CLI's type-check program (render_layout.ts and crawl_action.ts do not compile there), into the CLI's closure guards and into the UI suites' hashed inputs. Three required checks failed on the pull request. membership.ts now owns a setter-style hook, the way the corpus health hook is installed: the cascade and the role door run it in their own transaction after the write, and installReviewHandoverHook (tasks/reviews) puts the hand-over behind it. The boot sequence and the integration harness install it. A guard holds the layer free of the tasks domain and holds both install sites. The team door stays a direct call: it is outside that layer.
TASK-F93 went to the batched agent runs box that landed first; the hand-over box is TASK-F94.
|
Pushed three changes on top of the rebase, during the branch cleanup of 2026-10-13. Why it was red: Type check, Unit (workspaces) and Unit (platform 2/2) failed for one reason. |
The draft-etag merge left the body textarea's onChange on three lines; oxfmt keeps it on one, so the Format check failed on main.
Repair pending review retargeting after access loss. Pending recipients are discovered from approval metadata and designations, removed designations are cleared across task statuses, and all edit-losing role transitions revalidate reviews.
Verified with focused review and member tests, oxlint, oxfmt, and diff checks.
Closes #3789