Skip to content

Bind ask selector rows by request id - #847

Merged
TheGreatAxios merged 5 commits into
mainfrom
cl-7535-tui-askpermission-selector-renders-stale-or-mismatched
Sep 10, 2026
Merged

Bind ask selector rows by request id#847
TheGreatAxios merged 5 commits into
mainfrom
cl-7535-tui-askpermission-selector-renders-stale-or-mismatched

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Permission and operator-ask selector rows bind by request id, not render-order index, so a later ask cannot keep the previous ask's labels or values.
  • Missing ids fail closed. Ids are minted at the permission gate and session emit; the TUI does not invent them.

Verification

  • bun run typecheck, bun run build, and bun run test pass
  • bun run check passes

Fixes CL-7535
Changelog: bug

@linear-code

linear-code Bot commented Sep 9, 2026

Copy link
Copy Markdown

CL-7535

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Independent critic found no blocking stale-label defect. Rows are id-keyed; missing ids fail closed; ids minted at gate/session. Follow-up in progress: remove overlay-host index fallback on gate accept, add sequential permission.gate paint test.

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

re-critic of origin/main..HEAD including 693c488 found no remaining blocking stale-label or index-keyed accept on live gate overlays. Gate Enter with a painted value missing from live itemIds denies/cancels. Sequential permission.gate paint of B's labels is covered. createApprovalResume unchanged. File-for-later only: sequential permission.gate then Accept-once-on-B expecting allow:true.

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

re-critic including 951d142: sequential permission.gate Accept once on B now asserts allow:true and would fail if that path still fail-closed to deny. No remaining blocking stale-label issues on live gate overlays.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Critic · Comment

Permission and operator gate rows bind by minted request/ask id; Enter fail-closes when the painted Select value is missing from live itemIds.

Findings

  • src/permission/gate.ts:51withRequestId was inserted under the classifyOutcome/finishApprovalWait comment, so that block now documents the wrong function.

Notes

  • Sequential permission Accept once on B is locked (src/tui/gate-wire.test.ts). No remaining blocking stale-label or index-keyed accept on live gate overlays.

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

follow-up test sequential permission.gate Accept once on B expects { allow: true }. CI green at 951d142.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Verdict: approve (cannot GitHub-approve own PR).

CL-7535 holds at 20cff935. Selector rows bind by request id, not index. Ids mint at gate/session emit (createGateRequestApproval / randomUUID at emit), not in the TUI overlay and not on PermissionRequest. Stale or empty Enter is unavailable, not Reject. Escape still denies. Sequential Accept once is locked on the live ask; a later ask cannot keep the previous labels or values. Missing ids fail closed.

No blocking findings. Docs/comment nits: docs/TUI.md and src/tui/gate-events.ts still say ids mint at overlay-open; they mint earlier, on the gate event.

Keep the sequential B-not-A paint, Accept-once-on-B, painted-id-unavailable, empty-Enter-unavailable, missing-event-id fail-closed, and Esc-denies tests.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Verdict: approve (GitHub cannot approve own PR).

CL-7535 holds at 20cff935. Selector rows bind by request id, not index. Ids mint at gate/session emit (createGateRequestApproval / randomUUID at emit), not in the TUI overlay and not on PermissionRequest. Stale or empty Enter is unavailable, not Reject. Escape still denies. Sequential Accept once is locked on the live ask; a later ask cannot keep the previous labels or values. Missing ids fail closed.

No blocking findings. Docs/comment nits: docs/TUI.md and src/tui/gate-events.ts still say ids mint at overlay-open; they mint earlier, on the gate event.

Keep the sequential B-not-A paint, Accept-once-on-B, painted-id-unavailable, empty-Enter-unavailable, missing-event-id fail-closed, and Esc-denies tests.

@TheGreatAxios
TheGreatAxios added this pull request to stack #856 September 9, 2026 22:29
Overlay ask ids mint on the gate event at emit, not on
PermissionRequest. Escape still denies. An empty or mismatched
Enter cannot impersonate Reject.
Ids exist on the gate event before the overlay opens, so the
selector contract and PermissionGateEvent comment should not
say they mint at overlay-open.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7535-tui-askpermission-selector-renders-stale-or-mismatched branch from 0212868 to f809575 Compare September 10, 2026 00:40
@TheGreatAxios
TheGreatAxios merged commit edfff2f into main Sep 10, 2026
5 checks passed
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