Skip to content

Enhance Preview component with file fetching and loading state manage… - #7

Merged
pedrofrxncx merged 1 commit into
mainfrom
chore/async-image-preview
Apr 4, 2025
Merged

pedrofrxncx merged 1 commit into
mainfrom
chore/async-image-preview

Conversation

@pedrofrxncx

Copy link
Copy Markdown
Collaborator

…ment

@pedrofrxncx
pedrofrxncx merged commit eacc2dd into main Apr 4, 2025
@pedrofrxncx
pedrofrxncx deleted the chore/async-image-preview branch May 20, 2025 21:58
guitavano added a commit that referenced this pull request Jul 31, 2026
…tokens, dedup enqueue

P1:
- #4 double-enqueue race: per-(task,reviewer,cycle) claim table
  (INSERT ... ON CONFLICT DO NOTHING) gates each reviewer so a
  concurrent/duplicate trigger enqueues a reviewer at most once per cycle.
- #5 reviewer identity forgery: each claim mints a reviewToken bound to the
  reviewer; TASK_BOARD_REVIEW_DECISION marks a decision `verified` only when
  the token resolves to a claim whose reviewer matches. Auto-merge gate
  requires every enabled reviewer's latest verdict to be a VERIFIED approve,
  so one agent can't forge the two-reviewer sign-off.

P2:
- #6 tests: shared review-cycle reducer + verifiedOnly anti-forgery gate,
  checks-status parsing/preview-host, reviewer re-review cycle.
- #7 duplication: extract enqueueAgentRunForTask (thread create + link +
  persist-before-dispatch + enqueue) shared by the Super Agent and reviewer
  enqueues; reuse StudioContextFactory instead of a local copy.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
guitavano added a commit that referenced this pull request Jul 31, 2026
…roduction (#5520)

* feat(task-board): QA Agent + Code Reviewer review flow with ship-to-production

Add two per-org automated reviewers that run on a task's PR once the Super
Agent finishes, gated by org flags, plus a manual "ship to production" merge.

- Reviewers: QA Agent (verifies the task solved the problem) and Code Reviewer
  (reviews the code with the repo's stack review skills). Enabled per-org via
  `qa_agent_enabled` / `code_reviewer_enabled` flags; both run as linked threads
  shown live on the card, delegated by the Super Agent.
- Trigger is headless: fires from the projector's run-terminal hook when a
  Super Agent run finishes (no UI required); the modal's poll is a safety net.
- Decision via `TASK_BOARD_REVIEW_DECISION` (request_changes hands back to the
  Super Agent with feedback + `gh pr checkout` to update the same PR; approve
  records the sign-off). Auto-merge (`auto_merge` flag) merges once every enabled
  reviewer approves; a manual "Ship to production" button + merge tool otherwise.
- Merge is gated on CI: never ships on failing/pending checks (client + server).
- PR card: live state, an expandable checks footer (Status API + Checks API,
  with each failing check's output markdown), and the deco deploy preview link
  (lifted from the deploy bot's PR comment). Concurrent GitHub reads + a
  loading skeleton.
- Dev: dispatch defaults the sandbox target to the env-configured provider so
  background runs work under `--local-sandbox-provider`.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(task-board): review-cycle re-review + preview-host injection + org-scoped merge conn

Address blockers/important findings from the branch review:
- Re-review never re-ran the reviewers: the thread-finish backstop advanced a
  task to In Review without recording a `status_changed` activity, so the
  reviewer cycle boundary (`lastInReviewAt`) went stale after a request_changes
  fix pushed to the same PR. Record the transition so reviewers re-run.
- Preview-host match was an unanchored substring on attacker-writable PR-comment
  URLs (phishing button + a URL the autonomous QA agent opens). Replace with a
  strict hostname check (`isDecoPreviewHost`).
- `resolveGithubConnection` resolved a linked connectionId without an org filter
  on a PR-merge (write) path — org-scope the lookup.
- Add unit tests: `isDecoPreviewHost` (incl. the decoy), `reviewerHandledThisCycle`
  (incl. the re-review prior-cycle case).

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(task-board): harden review flow — anti-race claims, anti-forgery tokens, dedup enqueue

P1:
- #4 double-enqueue race: per-(task,reviewer,cycle) claim table
  (INSERT ... ON CONFLICT DO NOTHING) gates each reviewer so a
  concurrent/duplicate trigger enqueues a reviewer at most once per cycle.
- #5 reviewer identity forgery: each claim mints a reviewToken bound to the
  reviewer; TASK_BOARD_REVIEW_DECISION marks a decision `verified` only when
  the token resolves to a claim whose reviewer matches. Auto-merge gate
  requires every enabled reviewer's latest verdict to be a VERIFIED approve,
  so one agent can't forge the two-reviewer sign-off.

P2:
- #6 tests: shared review-cycle reducer + verifiedOnly anti-forgery gate,
  checks-status parsing/preview-host, reviewer re-review cycle.
- #7 duplication: extract enqueueAgentRunForTask (thread create + link +
  persist-before-dispatch + enqueue) shared by the Super Agent and reviewer
  enqueues; reuse StudioContextFactory instead of a local copy.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* test(task-board): add TASK_BOARD_REVIEW_DECISION to Task Manager tools integration assertion

The studio-pack integration test pinned the Task Manager's selected_tools
without TASK_BOARD_REVIEW_DECISION, which the review flow added to the
manager. Align the expected list with the source (task-manager.ts) and the
unit test.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
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.

2 participants