Skip to content

fix(sim-cli): consistent source command flags and refusals - #10555

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/wac-qa-b10-cli-ux-consistency
Dec 1, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/wac-qa-b10-cli-ux-consistency

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

QA batch B10 (CLI UX consistency) for workflows as code. Each item was re-checked on current staging first.

  • resources and catalog take --dir. These were the only two workflows source commands without it, and bench agents kept getting unknown option '--dir'. --dir defaults to ., like the other source commands. The command reads the workspace the directory (or a directory above it) names, and a directory that names none falls back to the profile's workspace, not the working directory's. A -w or SIM_WORKSPACE naming a different workspace from the directory's record is refused with SOURCE_OTHER_WORKSPACE, as get --dir does. catalog also uses the workflow in the directory's .sim/base.json. catalog --workflow-id now accepts an exact workflow name as well as an id, the same way get <workflow> does. The flag keeps the --workflow-id spelling: that is how every other query or body workflowId field is spelled, and the flag-naming contract test checks this.
  • --json works on every workflows source and workspaces source subcommand. It is the same as --output json, and errors use it too. Before, only status and diff accepted it, so check --json failed and pointed agents at status and diff. --json is now read in profileFrom, which removes the four per-command special cases. An unknown --json on any other command now suggests --output json instead of listing source commands.
  • SOURCE_DIR_KIND_MISMATCH gives the right reason and the right command. The refusal now knows which command ran. It says "would replace its base" only for get. For find, check and the other commands it says the command does not read that kind of directory. It points at the workflow folder (--dir <ws>/workflows/<key>). It names sim workspaces source <cmd> only when that command exists, so find no longer suggests a workspace command that has no find.
  • The not-found hint says -w <id>. The CLI's own <workspaceId> placeholder used to go through the wire-name rewording and come out as -w <--workspace>.
  • Write-back skips unchanged files. Writing a get or apply answer back to disk now skips any file whose text on disk already matches the answer. A no-op apply no longer moves every file's mtime, which on a 2000-function workflow cost about 2.5 s and churned editors and watchers. A hand-edited file is still rewritten. The record files are always written.

Tests (each fails on the pre-fix code)

  • terminal.test.ts:
    • resources and catalog --dir read the directory's workspace and workflow
    • catalog inside a workflow directory includes its workflow; a --dir that names nothing reads the profile's workspace; a conflicting -w is refused
    • catalog --workflow-id <name> sends the id it resolves
    • the not-found hint reads -w <id>
    • --json gives a JSON error when the output setting is text
    • an unknown --json elsewhere suggests --output json
  • workflow-source-find.test.ts: on a workspace directory, find points at the workflow folder and not at a workspace command.
  • workflow-source-roundtrip.test.ts: a no-op apply leaves file mtimes unchanged, and a hand-edited file is still rewritten.
  • Updated expectations in the check, workspace-check and execute tests.

Gates

  • sim-cli type-check, biome, and the full sim-cli vitest suite (two workspace-apply tests timed out under load and pass when run alone)
  • bun run generate (regenerates the CLI reference docs) and content:verify-compatibility (the docs baseline records the changed resources usage fence)
  • check:cli-docs, check:comment-hygiene, check:file-names, check:utils, check:explicit-any, check:test-patterns

No change to the CLI chat primer text.

- workflows source resources and catalog take --dir (the directory's workspace, and for catalog its workflow); catalog --workflow-id takes an exact name like get
- --json (same as --output json, errors included) on every workflows/workspaces source subcommand; an unknown --json elsewhere suggests --output json
- SOURCE_DIR_KIND_MISMATCH names the command run, says 'would replace its base' only for get, and points at the workflow folder or the matching command
- the not-found hint says -w <id>, which the wire-name rewording no longer turns into -w <--workspace>
- writing a source answer back skips files whose text on disk is already the answer's, so a no-op apply moves no mtimes
@vercel

vercel Bot commented Dec 1, 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 Dec 1, 2026 8:22am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; both earlier findings are fixed and no new actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both earlier findings are fixed and no new actionable issues were found.

Summary

The PR makes source command flags and error messages consistent and skips rewriting unchanged source files.

  • Workflow resources and catalog reads can follow a source directory.
  • Every workflow and workspace source command accepts --json.
  • Source-directory refusals explain the command-specific reason and next step.
  • Not-found messages show -w <id> as the retry hint.
  • Source write-back leaves files alone when their text has not changed.

Reviews (3) · Last reviewed commit: "fix(sim-cli): resolve resources and cata..." · 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 29 files

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

Turn on auto-fix | Re-trigger cubic

…other commands do

--dir defaults to the working directory, so catalog includes the workflow it holds; a directory
naming no workspace clears the working directory's; and a -w or SIM_WORKSPACE naming another
workspace than the directory's record is refused (SOURCE_OTHER_WORKSPACE). The docs baseline
records the changed resources usage fence.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@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 30 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 3321522 into staging Dec 1, 2026
87 of 88 checks passed

This branch was successfully deployed

1 active deployment
Preview — 0517b20b 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