feat(accounts): Epic 5 — Finding → Fix & Anchored Actions (Story 5.1) - #1423
Open
srtab wants to merge 5 commits into
Open
feat(accounts): Epic 5 — Finding → Fix & Anchored Actions (Story 5.1)#1423srtab wants to merge 5 commits into
srtab wants to merge 5 commits into
Conversation
Add a `fix it` affordance on actionable found-issues findings in the Feed and the Queue. It opens a scope/intent preview (repo/ref scope + the finding intent + the untrusted fix_prompt as inert, auto-escaped text — no generated diff) and, only on an explicit confirm POST, launches exactly one change session via submit_batch_runs(trigger_type=UI_JOB). Render paths and the preview GET perform zero writes and enqueue zero runs; the confirm re-validates the live envelope server-side (shared still_actionable + FIX + non-empty fix_prompt), owner-scopes the run, gates can_run, builds RepoTarget from the originating run's ref, and swaps the item to a calm "fix started" state without decrementing the "you have N" count. The preview + POST-only enqueue is the human-in-the-loop security gate over classifier-authored, untrusted run prose.
- Move actionable-id/prompt assembly and the can_run gate inside the try so a hostile/stale payload or repo-client error degrades to a calm inline notice instead of a 500. - Use a single generic "not found or not accessible" denial message that never reveals whether the repo exists. - Reject a present-but-invalid surface param with 404 rather than silently coercing to the default (which would mis-target the swap). - Fix preview: fall back to the item region for focus return when a concurrent console swap detaches the trigger; drop the max-height cap so the untrusted instruction is fully readable before confirm. - Fix-started: drop aria-live (node lives inside clobbered #console-main); the OOB #fix-announce region is the single announcer.
… and reviewed via bmad-loop
GitLab can answer 5xx *after* a write has already persisted. python-gitlab's client-level retry_transient_errors then re-POSTs the same create up to max_retries=10, producing duplicates: one 500 once yielded 11 identical inline comments on an MR, and this accounted for 18% of all inline comments in a 2026-07-21 audit. Opt all 10 non-idempotent create-writes out per call via the shared NO_TRANSIENT_RETRY_ON_WRITE constant. Idempotent GETs/LISTs keep the client-level retry, and obey_rate_limit/429 handling is untouched. Award-emoji and webhook creates remain deliberately exempt and are now marked as such in-code, so an exemption is distinguishable from an omission. Suppressing the transport retry is not sufficient on its own, so also: - update_or_create_merge_request now adopts an MR that persisted before a 5xx. GitLab dedupes MR creation with a 409 this function already recovered from, and the retry used to convert 500 -> 409 -> recover. Without this the opt-out turns a transient 5xx into a failed publish with an orphaned branch. - The inline-discussion tool returns an explicit "status UNKNOWN, do NOT retry" marker on a 5xx, so the agent cannot re-drive the same duplicate storm one layer up, where nothing bounds it. - clone_tokens' access_tokens.create is opted out too; it shares the same client and was minting up to 11 project access tokens. The constant lives in gitlab/utils.py rather than client.py because client.py imports clone_tokens, so the reverse import would be circular. Tests drive python-gitlab's real retry stack (only the HTTP transport is mocked) and assert POST counts. Asserting the kwarg is merely passed still passes when it is misspelled, since python-gitlab silently forwards unknown kwargs as query params and keeps retrying.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Epic 5 — Finding → Fix & Anchored Actions (Story 5.1)
Stacked on
feat/epic-4-needs-me-queue(→ Epic 3 → Epic 2 →main) — please review only the delta on top of it. This PR delivers Story 5.1; Story 5.2 (the remaining anchored actions — review this / retry / re-run) will follow on this branch.What it does
Gives the Review Console its single legitimate launch capability: from an actionable
found-issuesfinding, one fix it action spawns a change session — gated by a scope/intent preview so a bad fix can never silently land — linked back to the originating finding.found-issuesfinding whose envelopeactionable[]list is non-empty offers a fix it action (amberbutton-fix); all-clear / non-actionable items offer no fix action.Esccreates no session.sessions.services.submit_batch_runswith the appropriateSessionOrigin, linked back to its source — no new job-creation code path, no free-form launcher.actionable[]item; consumers never re-parse prose or invent fields.HX-Trigger— no scroll-jumping auto-refresh; keyboard-activatable with a teal focus ring (Esccloses the preview); en + pt (pt-PT) strings.Scope boundaries (v1)
Testing
uv run pytest tests/unit_tests/accounts/→ 370 passed.Notes
Base is
feat/epic-4-needs-me-queue, not the default branch — review only the delta. Produced via the unattended dev loop.