Skip to content

[comp] Production Deploy#2778

Merged
Marfuen merged 7 commits intoreleasefrom
main
May 7, 2026
Merged

[comp] Production Deploy#2778
Marfuen merged 7 commits intoreleasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 7, 2026

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.


Summary by cubic

Cuts organization onboarding time from ~5 minutes to ~2 minutes by parallelizing mitigations, switching rerank/onboarding to gateway-backed Google models, and simplifying progress tracking; also enables framework versioning for all orgs. Adds reliability fixes for onboarding completion (including zero-item steps) and cleans up policy template artifacts with a tested processor.

  • Performance

    • Parallelize risk/vendor mitigations with tasks.batchTriggerAndWait and log failures.
    • Switch rerank/onboarding to gateway google/* models via @ai-sdk/gateway; improve prompts with framework flags.
    • Reorder onboarding (policies → vendors → risks → linkage); fix tracker (handle zero-item steps), add readyForDashboard redirect, and clear stale onboardingTriggerJobId.
    • Add policy template processor that strips {{#if}} markers while preserving nested conditionals; include comprehensive tests.
    • Fix trigger auth context: use useRun where a TriggerProvider exists; revert page-level to useRealtimeRun; remove the ToDoOverview trigger hook.
    • Enable framework versioning for all orgs; always show History tab.
    • Build: skip TS check in Next build and reduce Sentry upload scope; add CI typecheck.
  • Dependencies

    • Bump ai to ^6.0.175; upgrade @ai-sdk/* to ^3.x; add @ai-sdk/gateway and @ai-sdk/google.
    • API: await convertToModelMessages; update types to LanguageModelV3.
    • UI: add @floating-ui/dom; align bun.lock and package versions across workspaces.

Written for commit a196339. Summary will update on new commits.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app (staging) Ready Ready Preview, Comment May 7, 2026 1:27pm
comp-framework-editor (staging) Ready Ready Preview, Comment May 7, 2026 1:27pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal (staging) Skipped Skipped May 7, 2026 1:27pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 25 files

Confidence score: 3/5

  • There are concrete medium-to-high severity risks (6–7/10 with high confidence) in onboarding flow logic, so this is not a low-risk merge despite being fixable.
  • In apps/app/src/trigger/tasks/onboarding/onboard-organization.ts, metadata.set('policies', true) is never written after updateOrganizationPolicies, which can leave real-time progress stuck and misrepresent step completion to users.
  • In apps/app/src/trigger/tasks/onboarding/generate-vendor-mitigation.ts, unhandled batchTriggerAndWait child failures can be silently ignored, and in apps/app/src/trigger/tasks/onboarding/process-policy-template.ts, conditional parsing may remove non-conditional text when markers share a node.
  • Pay close attention to apps/app/src/trigger/tasks/onboarding/onboard-organization.ts, apps/app/src/trigger/tasks/onboarding/generate-vendor-mitigation.ts, apps/app/src/trigger/tasks/onboarding/process-policy-template.ts, and apps/app/src/app/(app)/[orgId]/policies/all/components/policies-table.tsx - onboarding correctness and polling behavior need targeted validation before merge.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/app/src/trigger/tasks/onboarding/onboard-organization.ts">

<violation number="1" location="apps/app/src/trigger/tasks/onboarding/onboard-organization.ts:108">
P1: Missing `metadata.set('policies', true)` after `updateOrganizationPolicies` completes. The policies step will never be marked as finished in real-time tracking metadata, since only the initialization to `false` remains.</violation>
</file>

<file name="apps/app/src/trigger/tasks/onboarding/generate-vendor-mitigation.ts">

<violation number="1" location="apps/app/src/trigger/tasks/onboarding/generate-vendor-mitigation.ts:119">
P1: Handle `batchTriggerAndWait` results and fail the parent task when any child run fails; otherwise mitigation failures are silently ignored.</violation>
</file>

<file name="apps/app/src/trigger/tasks/onboarding/process-policy-template.ts">

<violation number="1" location="apps/app/src/trigger/tasks/onboarding/process-policy-template.ts:136">
P2: Conditional block traversal can delete non-conditional text when `{{#if}}`/`{{/if}}` markers share a node with normal content.</violation>
</file>

<file name="apps/app/src/app/(app)/[orgId]/policies/all/components/policies-table.tsx">

<violation number="1" location="apps/app/src/app/(app)/[orgId]/policies/all/components/policies-table.tsx:35">
P2: Gate polling by `shouldSubscribeToRun`; otherwise this will continue revalidating every second even when there is no onboarding run id.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread apps/app/src/trigger/tasks/onboarding/onboard-organization.ts
Comment thread apps/app/src/trigger/tasks/onboarding/generate-vendor-mitigation.ts Outdated
Comment thread apps/app/src/trigger/tasks/onboarding/process-policy-template.ts
Comment thread apps/app/src/app/(app)/[orgId]/policies/all/components/policies-table.tsx Outdated
…ntext (#2780)

useRun requires a TriggerProvider with an access token. When there's no
active onboarding (no triggerJobId), the TriggerTokenProvider renders
children without a TriggerProvider, causing useRun to throw "Missing
accessToken in TriggerAuthContext."

Reverted policies-table, use-policy-onboarding-status, and
use-onboarding-status back to useRealtimeRun which gracefully handles
missing auth context via the enabled flag.

For ToDoOverview, removed the trigger hook entirely — it only needs
a boolean "is onboarding running" which can be derived from the
triggerJobId prop.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/app/src/app/(app)/[orgId]/overview/components/ToDoOverview.tsx">

<violation number="1" location="apps/app/src/app/(app)/[orgId]/overview/components/ToDoOverview.tsx:51">
P2: Using `!!onboardingTriggerJobId` as the in-progress check can lock the publish action after failed/stuck onboarding runs, because stale job IDs are treated as active forever.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread apps/app/src/app/(app)/[orgId]/overview/components/ToDoOverview.tsx
…#2781)

Roll out framework versioning to all organizations by removing the
PostHog feature flag gate. The History tab and update banner now render
unconditionally.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…check (#2782)

Build optimizations (~110s savings):
- typescript.ignoreBuildErrors: true — skips the 79s TypeScript check
  during next build. Type errors are now caught by the check-types CI
  workflow instead.
- widenClientFileUpload: false — reduces Sentry source map upload
  scope, saving ~30-40s of scanning/uploading client-side files.

CI:
- Added pull_request trigger to check-types.yml so typecheck runs on
  every PR, replacing the in-build check.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: address cubic review findings on onboarding PR

P1: Add metadata.set('policies', true) after policy fan-out so the
    tracker boolean flag is set.
P1: Log batchTriggerAndWait failures in vendor/risk mitigation fan-outs
    instead of silently ignoring them.
P2: Strip {{#if}}/{{/if}} markers from mixed-content nodes so template
    syntax doesn't leak into rendered policies.
P2: Fix stale onboardingTriggerJobId locking publish button in
    ToDoOverview.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: strip only first marker occurrence to preserve nested conditionals

The global regex flag in stripMarkerText would remove ALL matching
{{#if}}/{{/if}} markers in a subtree, corrupting boundaries of nested
conditional blocks. Removed the g flag so only the first occurrence
(the one that triggered the match) is stripped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel vercel Bot temporarily deployed to staging – portal May 7, 2026 13:14 Inactive
@Marfuen
Copy link
Copy Markdown
Contributor

Marfuen commented May 7, 2026

@cubic-dev-ai re-review

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented May 7, 2026

@cubic-dev-ai re-review

@Marfuen I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 28 files

Confidence score: 3/5

  • There is concrete user-facing risk in apps/app/src/app/(app)/[orgId]/components/OnboardingTracker.tsx: zero-item steps are treated as incomplete, which can leave onboarding progress stuck even when there is nothing to do.
  • apps/app/src/trigger/tasks/onboarding/onboard-organization.ts currently awaits updateOrganizationPolicies immediately, reducing intended parallelism and potentially slowing onboarding task completion.
  • Given two medium-severity issues with high confidence (both 9/10), this looks like a moderate merge risk rather than a merge-blocker.
  • Pay close attention to apps/app/src/app/(app)/[orgId]/components/OnboardingTracker.tsx and apps/app/src/trigger/tasks/onboarding/onboard-organization.ts - step completion logic can block progress, and serialized async work can degrade onboarding performance.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/app/src/trigger/tasks/onboarding/onboard-organization.ts">

<violation number="1" location="apps/app/src/trigger/tasks/onboarding/onboard-organization.ts:108">
P2: `updateOrganizationPolicies` is awaited immediately, which serializes policy work before vendor/risk creation and defeats the intended parallel execution.</violation>
</file>

<file name="apps/app/src/app/(app)/[orgId]/components/OnboardingTracker.tsx">

<violation number="1" location="apps/app/src/app/(app)/[orgId]/components/OnboardingTracker.tsx:200">
P2: Zero-item steps are marked incomplete, so progress can get stuck on steps that have nothing to process.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread apps/app/src/trigger/tasks/onboarding/onboard-organization.ts
Comment thread apps/app/src/app/(app)/[orgId]/components/OnboardingTracker.tsx Outdated
* fix: address cubic review findings on onboarding PR

P1: Add metadata.set('policies', true) after policy fan-out so the
    tracker boolean flag is set.
P1: Log batchTriggerAndWait failures in vendor/risk mitigation fan-outs
    instead of silently ignoring them.
P2: Strip {{#if}}/{{/if}} markers from mixed-content nodes so template
    syntax doesn't leak into rendered policies.
P2: Fix stale onboardingTriggerJobId locking publish button in
    ToDoOverview.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: strip only first marker occurrence to preserve nested conditionals

The global regex flag in stripMarkerText would remove ALL matching
{{#if}}/{{/if}} markers in a subtree, corrupting boundaries of nested
conditional blocks. Removed the g flag so only the first occurrence
(the one that triggered the match) is stripped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(onboarding): add comprehensive tests for policy template processor

Covers placeholder replacement, inline/multi-node/nested conditionals,
mixed content nodes, edge cases, buildVariables, buildFlags, processTemplate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(onboarding): treat zero-item steps as complete in tracker

When an org has no vendors or risks, `total > 0 && completed >= total`
evaluates to false, causing those steps to appear stuck forever.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel vercel Bot temporarily deployed to staging – portal May 7, 2026 13:22 Inactive
@Marfuen
Copy link
Copy Markdown
Contributor

Marfuen commented May 7, 2026

@cubic-dev-ai review this

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented May 7, 2026

@cubic-dev-ai review this

@Marfuen I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 28 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@Marfuen Marfuen merged commit 61c5555 into release May 7, 2026
14 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.45.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants