Skip to content

fix(workflow-code): scope check's untyped JSON ref warning per field, as the server does - #10400

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/check-untyped-ref-field-scope
Nov 25, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/check-untyped-ref-field-scope

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Problem: after improvement(workflows): agent-benchmark fixes for JSON refs, export, subflow moves and rerun-from-block #10399, check reported W_JSON_REF_UNTYPED on every untyped reference in a block whose digest changed. Renaming a block's display name changes its key, so renaming a block, or a block it reads, surfaced every untouched untyped reference in those blocks. One restructure edit produced about 12 warnings on lines the agent never edited. The server never had this problem: it reports per field, after applying the apply's renames.
  • The rule is now per field, in the compile beside the server's: check reports only a field the edit makes store a reference anew. That is a field whose text differs from what the printed source stored (after the lock's renames), or one where the reference was typed when printed and is untyped now, as when a Function's code or a Start input changed.
  • New recorded state: the CLI keeps no printed text, so get and apply now record the printed source's JSON fields that hold untyped references (normally empty) in .sim/stored-edges.json, next to the edges. The three record readers share one fingerprint-checked read.
  • Fallback and strict mode: without that record, or without the catalog the source was printed with, check falls back to the block-level rule. --strict still reports every reference.

Type of Change

  • Bug fix

Testing

  • New tests in workflow-source-check.test.ts, all red on staging and green now:
    • renaming the block holding the reference, and the block it reads, gives no warning;
    • editing another field of the same block gives no warning;
    • after a Function code edit, only the reference that edit untyped is reported.
  • The guard in the CLI and the per-reference check in the compile were each removed in turn, and each removal turns its test red.
  • The improvement(workflows): agent-benchmark fixes for JSON refs, export, subflow moves and rerun-from-block #10399 Start-inputFormat regression test and --strict stay green.
  • Gate:
    • bun run generate, bun run lint, bun run type-check, bun run check:audits, docs content:verify-compatibility, check-block-registry.ts origin/staging;
    • workflow-code (804), sim-cli (1169), apps/sim lib/workflows/code (262);
    • test:integration on apply-workflow-source and cross-kind (120).

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)

…at store a reference anew

The offline check reported W_JSON_REF_UNTYPED on every untyped bare reference of a block whose
digest changed since the get. Renaming a block's display name changes its key, so the block and
every block reading it compiled to a new digest, and each untouched untyped reference in them was
reported although its field stores exactly what it stored. The server compares per field, through
the apply's renames, and stays quiet there.

A get or apply now records in .sim/stored-edges.json the JSON fields of the printed source that
hold untyped references (the text each stores and those references; CompileResult.untypedJsonFields),
and the compile reads them back as CompileInput.storedUnreadUntypedFields beside the lock. Such a
reference stays quiet while its field compiles to the same text through the lock's renames, as
one the stored workflow holds does against `stored`. A field whose text changed, or a reference
that was typed when printed (a Start input or a Function's code an edit changed), is reported.
Without the record or the catalog the source was printed with, the check keeps the block-level
rule; --strict still reports every one.
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Nov 25, 2026 5:52am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

check now reports W_JSON_REF_UNTYPED per changed JSON field rather than per changed block.

  • Workflow checks warn only about untyped references in edited fields.

No actionable issues found. Tests were inspected but not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Compile printed source] --> B[Record fields and untyped references]
  B --> C[Check edited source]
  C --> D{Strict mode?}
  D -->|Yes| E[Report every untyped reference]
  D -->|No| F{Record and original catalog available?}
  F -->|Yes| G[Report changed fields and newly untyped references]
  F -->|No| H[Use previous block-level rule]
Loading

Reviews (1) · Last reviewed commit: "fix(workflow-code): scope the check's W_..." · Reviewed by Greptile

@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 8 files

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

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 48f7887 into staging Nov 25, 2026
87 checks passed

This branch was successfully deployed

1 active deployment
Preview — 488e4a82 Deployed Nov 25, 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