Repository navigation
improvement(workflow-code): round 11 audit — fix found bugs, remove dead and compatibility code, one home for shared rules - #10379
waleedlatif1 wants to merge 6 commits into
Conversation
…low-sdk and workspace-code - compile: keep refs to unknown outputs out of W_JSON_REF_UNTYPED past the warning cap - babelMessage lives in babel.ts and strips (line:column) from code-file syntax errors - SDK_MAJOR defined once in workflow-code/sdk; workspace-code and the CLI starter use it - drop SPECIAL_BUILDER_KEYS, dead subflow edge branches, duplicate env/stored/key helpers - isModelField, RESOURCE_KEY_HINT, isStoredCall shared; casts narrowed - builder snippets fill McpServerRef, FolderRef and FileRef params - doc fixes: MCP url identity, auth schemes, not-executable message, limits and TSDoc
…fusal codes, human subject for source scope, drop legacy-id catalog projection, doc fixes
…from one table - workflow check and status hold the command lock (read-only), so they never read a directory an apply or get is rewriting; check help names exit 10 - recordedWorkspace binds check, create and params to the workspace a directory records - workspace check: no login keeps its AUTH_REQUIRED refusal (exit 13); drop requireCachedCatalog - typeCheckWorkspace shared by the workspace check and a workflow folder check - status commands declare no apply operation - every source command's exit-code help built from the one table, status included - drop renamedVariables; reword apply's workflowId argument, name SOURCE_WORKFLOW_MISMATCH - workspace get never exits 7; INTERRUPTED_EXIT_CODE defined once
…he SDK major from its constant
…each code was reported, one env-name pattern, one createdBy, recordedWorkspace reads the flag
…ING_LIMITS and asserts the cap was hit
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[Medium impact] This PR appears safe to merge; no actionable issues were found. SummaryThis PR fixes workflow-source checks and brings shared rules into common helpers.
No actionable issues were found. This assessment is based on source review; no tests were run.
|
There was a problem hiding this comment.
1 issue found across 87 files
Confidence score: 5/5
- In
source-status.ts, the help omits exit 9 for rate-limited plan requests, so users may not know what the status means. Add rate-limit wording to the shared exit-code row.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/sim-cli/src/commands/protocol/source-status.ts">
<violation number="1" location="packages/sim-cli/src/commands/protocol/source-status.ts:84">
P3: `statusHelp` omits exit 9 even though a rate-limited plan request eventually exits `RATE_LIMITED_EXIT_CODE`. Add status-specific rate-limit wording to the shared exit-code row.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
| failed; ${AUTH_REQUIRED_EXIT_CODE} not logged in (AUTH_REQUIRED) or the credential was refused: the status shows the | ||
| local changes only, then run \`sim login\`. A server that cannot be reached is not a failure: the | ||
| status shows the local changes only and says so (exit 0 or ${SOURCE_LOCAL_CHANGES_EXIT_CODE}).` | ||
| ${sourceExitCodesHelp(command)}` |
There was a problem hiding this comment.
P3: statusHelp omits exit 9 even though a rate-limited plan request eventually exits RATE_LIMITED_EXIT_CODE. Add status-specific rate-limit wording to the shared exit-code row.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/sim-cli/src/commands/protocol/source-status.ts, line 84:
<comment>`statusHelp` omits exit 9 even though a rate-limited plan request eventually exits `RATE_LIMITED_EXIT_CODE`. Add status-specific rate-limit wording to the shared exit-code row.</comment>
<file context>
@@ -72,20 +73,16 @@ export interface StatusReport<Plan> extends SourceStatus {
-failed; ${AUTH_REQUIRED_EXIT_CODE} not logged in (AUTH_REQUIRED) or the credential was refused: the status shows the
-local changes only, then run \`sim login\`. A server that cannot be reached is not a failure: the
-status shows the local changes only and says so (exit 0 or ${SOURCE_LOCAL_CHANGES_EXIT_CODE}).`
+${sourceExitCodesHelp(command)}`
+}
</file context>
Summary
A final audit of workflows and workspace as code: six audit agents covered compile/print, catalog/values, workspace-code/SDK, the CLI source commands, the server, and docs/constants. Independent verifiers then tried to refute each finding. 35 of 57 survived; the rest were wrong, deliberate, or not a strict improvement.
Bugs (each has a test that fails on the old code)
W_JSON_REF_UNTYPEDonce the warning cap cut itsW_UNKNOWN_OUTPUT_PATHfrom the listing. The reporter now records where each code was reported, listed or not.workflows source checkandstatuswrote workspace files (workspace.d.ts, tsconfigs, SDK blocks) without the source-directory lock. They now take it, as the workspace commands do.workflows source paramsignored a starter directory's workspace and read the profile's catalog. Check, create and params now share onerecordedWorkspace.E_SYNTAX(and a tool'sE_TOOL_CODE) kept Babel's(line:col)suffix with its 0-based column. Both now usebabelMessage, like the entry file.<McpServerRef>in example calls instead ofmcp('<key>').folder()andfile()are fixed the same way.Dead and compatibility code removed
legacyIds/legacyCanonicalIdscatalog projection, its contract fields and type.connect()that could not fire, andrequireCachedCatalog.apply*operations declared by both status commands, which only plan.variables.renamed ?? []fallback.SPECIAL_BUILDER_KEYS.One home for shared rules
SDK_MAJORin@sim/workflow-code/sdk).SOURCE_REFUSAL_CODES), and one renderer for the two workflow source policies.INTERRUPTED_EXIT_CODE.stored()check and the resource-key hint.typeCheckWorkspacefor both checks.Docs and help the code contradicted
stored-edges.json; the rootwritten.json).tables/stray-file hint.Type of Change
Testing
bun run generate,bun run lint,bun run type-check,bun run check:audits,check:api-validation:strict,check-block-registry.ts origin/staging, rootbun run test.test-auditauthoring gate. Each behaviour fix was shown red on the old code by restoring the old file, then green.Checklist
test-auditauthoring gate)