Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions apps/web/src/components/VideoWorkflowStudio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
studioRunQuality,
studioStatusLabel,
studioStatusMessage,
studioVerifiedLiveUrl,
type StudioPipelineCheck,
type StudioRunQuality,
} from '@/lib/studio-pipeline-status';
Expand Down Expand Up @@ -626,13 +627,13 @@ export default function VideoWorkflowStudio() {
delayMs: 2000,
signal: deployAbort.signal,
});
const live = polled.result?.live_url;
const live = studioVerifiedLiveUrl(polled.result?.live_url);
if (live) setDeployLiveUrl(live);
if (polled.result?.github_repo) setDeployRepo(polled.result.github_repo);
if (polled.result?.jobId) setDeployJobId(polled.result.jobId);

if (live) {
setActionMessage(`Deploy ready: ${live} (run ${started.runId})`);
setActionMessage(`Deploy receipt: ${live} (run ${started.runId})`);
return;
}
if (polled.result?.kind === 'handoff') {
Expand Down Expand Up @@ -667,7 +668,8 @@ export default function VideoWorkflowStudio() {
});
jobId = kick.jobId;
if (kick.jobId) setDeployJobId(kick.jobId);
if (kick.live_url) setDeployLiveUrl(kick.live_url);
const kickLive = studioVerifiedLiveUrl(kick.live_url);
if (kickLive) setDeployLiveUrl(kickLive);
if (kick.github_repo) setDeployRepo(kick.github_repo);

if (!kick.ok && !kick.jobId) {
Expand All @@ -679,8 +681,8 @@ export default function VideoWorkflowStudio() {
return;
}

if (kick.live_url) {
setActionMessage(`Deploy live: ${kick.live_url}`);
if (kickLive) {
setActionMessage(`Deploy receipt: ${kickLive}`);
return;
}

Expand All @@ -699,11 +701,12 @@ export default function VideoWorkflowStudio() {
}

const polled = await pollStudioJob(jobId, { attempts: 6, delayMs: 1500 });
if (polled.live_url) setDeployLiveUrl(polled.live_url);
const polledLive = studioVerifiedLiveUrl(polled.live_url);
if (polledLive) setDeployLiveUrl(polledLive);
if (polled.github_repo) setDeployRepo(polled.github_repo);

if (polled.live_url) {
setActionMessage(`Deploy ready: ${polled.live_url}`);
if (polledLive) {
setActionMessage(`Deploy receipt: ${polledLive}`);
} else if (polled.jobStatus === 'failed' || polled.jobStatus === 'error') {
setActionMessage(
`Deploy job ${jobId} failed${polled.message ? `: ${polled.message}` : ''}. Export package for manual handoff.`,
Expand Down
7 changes: 7 additions & 0 deletions apps/web/src/lib/__tests__/studio-pipeline-status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,13 @@ describe('studio-pipeline-status', () => {
expect(retired).not.toMatch(/durable Workflow DevKit/);
});

it('does not claim live deploy in retired studio without a verified receipt guard', () => {
const retired = readFileSync(join(process.cwd(), 'src/components/VideoWorkflowStudio.tsx'), 'utf8');
expect(retired).toContain('studioVerifiedLiveUrl');
expect(retired).not.toContain('setActionMessage(`Deploy live: ${kick.live_url}`)');
expect(retired).not.toContain('setActionMessage(`Deploy ready: ${polled.live_url}`)');
});

it('renders review_action as a card with status, title, and detail', () => {
const review = studioActionCard({
tool: 'review_action',
Expand Down