Skip to content

fix(workflow-code): active-field and secret correctness - #10544

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/wac-qa-b1-active-fields-secrets
Dec 1, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/wac-qa-b1-active-fields-secrets

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

QA batch B1 for workflows as code: fixes for active fields and secrets, needed before the flag is on for everyone.

  • Basic-only fields on an advancedMode block. The serializer never sends a standalone mode: 'basic' field from a block in advanced mode, but compile and print ignored advancedMode. Compile warned W_REQUIRED_MISSING. Print wrote todo(), which broke P3 print idempotence on the full corpus (sailpoint_v2:sailpoint_search_aggregate:advanced). A value written to clear the warning was silently dropped at run time. A single basicOnlyHidden predicate in catalog/activity.ts, which the serializer mirror also uses, now drives checkFields (W_FIELD_NOT_APPLICABLE), missingRequiredFields and print's needsTodo.
  • Workflow variables printed literal credentials. A variable value holding a detected credential now prints as value: stored() with W_LITERAL_SECRET. Compile resolves stored() from the stored workflow's variable of the same key, or raises E_STORED_VALUE_MISSING. With only the lock (offline check), the value is left unread. Compile also warns on a literal or kept credential in a variable. isStoredCall moves into compile/context.ts so tools and variables share it.
  • Minted webhook token warned on every run. A value Sim mints at creation (mintsFreshValue) still prints as stored(), but neither print nor keepStored reports W_LITERAL_SECRET for it.
  • E_LIMIT_EXCEEDED for code files now states the measured total and the file that crossed the limit. The exact count runs only on the error path.
  • CI never ran the full corpus. A new workflow-code-corpus workflow runs the corpus suites with ROUNDTRIP_CORPUS_FULL=1 nightly, on dispatch, and when the workflow file itself changes.
  • Docs (syntax.mdx, diagnostics.mdx, SYNTAX.md, DESIGN.md, stored() TSDoc):
    • The claim that "a secret is never printed" is narrowed to what is actually true.
    • Variable stored() is documented.
    • So is the advancedMode case of W_FIELD_NOT_APPLICABLE.
    • New rule for minted values: one Sim creates, such as a webhook token, is kept when omitted, and null clears it.

Type of Change

  • Bug fix

Testing

Each test below went red with only its guard reverted (one guard at a time) and green with the fix.

  • apps/sim/lib/workflows/code/hand-written.test.ts, real catalog:
    • A basic-only field on an advancedMode block: no todo(), no W_REQUIRED_MISSING, and writing it gives W_FIELD_NOT_APPLICABLE. Three guards.
    • A variable holding an sk-… key: warned on apply; the read-back holds stored() and not the key; compiling against the stored workflow round-trips the variables; with no stored workflow the result is E_STORED_VALUE_MISSING. Three guards.
    • A webhook trigger applied twice: the read-back has token: stored() and no W_LITERAL_SECRET from print or compile. Two guards.
  • packages/workflow-code/src/compile/hostile.test.ts: the code-file limit message names the measured total and the file.
  • Full corpus with ROUNDTRIP_CORPUS_FULL=1, every corpus suite including typecheck: 49/49 green.
  • Also green: the workflow-code package suite (824), lib/workflows/code (274), root bun run test, type-check, check:audits, lint, generate and check-block-registry.

Risks

  • Variable stored() is new compile surface. The round-trip test and the full corpus cover it. Offline checks read it as null, the same way a lock-bound block param is left out unread.
  • A minted field that a user overwrote with their own literal secret no longer warns. It still prints as stored(), so the value never reaches the file.
  • The stored() TSDoc in SDK core.d.ts changed, which regenerated core-text.generated.ts.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

- basic-only fields on an advancedMode block are never required, never printed as todo(), and W_FIELD_NOT_APPLICABLE when written
- workflow variable values holding a detected credential print as stored() with W_LITERAL_SECRET; compile resolves stored() by variable key
- a value creation mints (webhook token) no longer warns W_LITERAL_SECRET on print or apply
- E_LIMIT_EXCEEDED for code files names the measured total and the file
- nightly job runs the corpus suites over the full corpus
- docs: narrow the never-printed claim, document minted values and null
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 1, 2026 6:23am UTC

Request Review

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 19 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no new actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Fixes active-field checks and keeps detected credentials in workflow variables out of printed source.

  • Advanced-mode blocks leave basic-only fields out of checks and printed source.
  • Detected credential values in workflow variables stay out of source and can be kept with stored().
  • Sim-minted values stay stored without a literal-secret warning.
  • Code-size errors name the measured total and the file that crossed the limit.
  • CI runs the full workflow-code corpus on a schedule and on demand.

Reviews (2) · Last reviewed commit: "fix(workflow-code): read a variable's st..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 19 files

Confidence score: 5/5

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

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit c9c0a3d into staging Dec 1, 2026
88 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/wac-qa-b1-active-fields-secrets branch December 1, 2026 07:03

This branch was previously deployed

1 inactive deployment
Preview — ae6e94d2 Deployed Dec 1, 2026 by vercel[bot]
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