Skip to content

feat(accounts): Epic 5 — Finding → Fix & Anchored Actions (Story 5.1)#1423

Open
srtab wants to merge 2 commits into
feat/epic-4-needs-me-queuefrom
feat/epic-5-finding-fix
Open

feat(accounts): Epic 5 — Finding → Fix & Anchored Actions (Story 5.1)#1423
srtab wants to merge 2 commits into
feat/epic-4-needs-me-queuefrom
feat/epic-5-finding-fix

Conversation

@srtab

@srtab srtab commented Jul 22, 2026

Copy link
Copy Markdown
Owner

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-issues finding, 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.

  • Finding → Fix (FR-13): a found-issues finding whose envelope actionable[] list is non-empty offers a fix it action (amber button-fix); all-clear / non-actionable items offer no fix action.
  • Preview before commit (FR-14): invoking fix it shows a transient scope/intent preview of what will be attempted before anything runs. v1 is a scope/intent confirmation, not a full generated diff. Cancel / dismiss / Esc creates no session.
  • One launch path (AR8): the fix launches through the existing sessions.services.submit_batch_runs with the appropriate SessionOrigin, linked back to its source — no new job-creation code path, no free-form launcher.
  • Item contract (AR7): both the submit call and the back-link are built from a single classifier-authored actionable[] item; consumers never re-parse prose or invent fields.
  • Calm HTMX partial swaps / HX-Trigger — no scroll-jumping auto-refresh; keyboard-activatable with a teal focus ring (Esc closes the preview); en + pt (pt-PT) strings.

Scope boundaries (v1)

  • Only the fix it verb is wired here — review this / retry / re-run are Story 5.2.
  • Preview is a scope/intent confirmation, not a generated diff.
  • No command palette; no free-form "New Job" initiation anywhere on the console.

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.

srtab added 2 commits July 22, 2026 00:43
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.
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