Skip to content

improvement(workflow-code): one primer for coding agents and mothership, pre-installed typescript - #10449

Merged
waleedlatif1 merged 3 commits into
stagingfrom
improvement/workflow-code-chat-primer
Nov 27, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
improvement/workflow-code-chat-primer

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Sim now owns the source primer Mothership reads, so the worker can drop its string rewrite of it, and Mothership's sandbox no longer has to install TypeScript on the first source check.

  • One primer, two surfaces. sourcePrimer(kind, surface) takes cli (a coding agent with its own shell) or chat (Mothership). Everything else is shared; only the edit loop and the root AGENTS.md pointer differ. The chat loop runs check && apply in run_code's shell, then tests the draft (workflows run <id> --dry --input … --dir <dir>) and deploys (workflows deploy <id>) through sim_cli. It never mentions --run or workspace source. Both surfaces state the table rule: change columns before the get. Every primer stays under the 4096-byte budget (cli 3991, chat 4094, workspace 3947), and the primer tests now cover each surface. print-source-primers.ts keeps workflow and workspace and adds chat.workflow.
  • The CLI picks the surface itself. In Mothership's workbench, buildMothershipSandboxSession sets SIM_CLI_HOST=mothership. For sim_cli, runCli passes host: 'mothership' to runEmbeddedCli. An embedded run never reads the server's env. In either case, source get/create write the chat primer and pointer, and workflows source --help shows the chat loop. The constants live in a new import-free sim/host subpath.
  • Inventory. workspaces source check calls no operation Sim refuses, but it only checks a directory that the refused workspaces source get writes. It is now mothershipUnavailable. Rule: a --dir command in a group whose get is refused.
  • TypeScript. source check looks for the pinned release in SIM_TYPESCRIPT_DIR (<dir>/<version>/node_modules/typescript, the same layout as the cache) before installing into the cache, and never writes to that directory. A failed check now ends stderr with Error: <file:line:col> error <CODE>: <message> for its first error, so the install notice or a warning can no longer become the headline.

Worker follow-up (separate PR): sync chat.workflow verbatim and delete chatPrimer. Delete the workspaces source block-list entry. Bake typescript@<pin> into the sandbox image under a directory and set SIM_TYPESCRIPT_DIR to it in the workbench bootstrap.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • New tests fail on the pre-change code: chat primer refusals, Mothership and embedded primer and help, the SIM_TYPESCRIPT_DIR check with a fake npm that must not run, and a failed check's last stderr line (json, table and GitHub Actions output).
  • The CLI help and pointer text are byte-identical to before.
  • The inventory diff against staging changes exactly one entry (workspaces source check).
  • Full local gate: generate, lint, type-check, check:audits, test, block registry.

Checklist

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

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner November 26, 2026 23:31
@vercel

vercel Bot commented Nov 26, 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 27, 2026 12:21am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no blocking issue remains.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue remains.

Summary

This PR gives coding agents and Mothership separate edit loops built from one shared primer. It also:

  • Mothership and coding agents get workflow guidance from one primer.
  • Mothership’s command list hides directory actions whose source get is refused.
  • Source checks can use a TypeScript release installed ahead of time.
  • Failed source checks end stderr with the first error on one line.

Both earlier findings are addressed: chat deploy commands include --expected-draft-fingerprint, and relative SIM_TYPESCRIPT_DIR paths are resolved before the compiler starts. No new actionable issues were found.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Shell[Mothership shell] --> Env[SIM_CLI_HOST]
  Tool[sim_cli] --> Host[Embedded host option]
  Env --> Surface[primerSurface]
  Host --> Surface
  Surface --> Chat[Chat primer and help]
  Local[Local CLI without host] --> CLI[Coding-agent primer and help]
Loading

Reviews (3) · Last reviewed commit: "fix(workflow-code): keep the test-resour..." · 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 26 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread packages/sim-cli/package.json Resolved
@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 Nov 27, 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.

All reported issues were addressed across 27 files

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

Turn on auto-fix | Re-trigger cubic

…ip, pre-installed TypeScript

- source-primer: a cli/chat surface; the chat primer stops the shell loop at apply and tests and
  deploys through sim_cli, with no workspace source or --run; print-source-primers emits chat.workflow
- the CLI serves the chat primer and source help where its host is Mothership: SIM_CLI_HOST=mothership
  in the workbench env (sandbox-session) or host on runEmbeddedCli (sim_cli)
- command inventory: workspaces source check is mothershipUnavailable with the rest of its group
- source check reads the pinned TypeScript from SIM_TYPESCRIPT_DIR before installing it, and a
  failed check ends stderr with its first error
…IM_TYPESCRIPT_DIR, drop ./host from the published manifest
@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 Nov 27, 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 27 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 6dd989a into staging Nov 27, 2026
156 of 158 checks passed

This branch was successfully deployed

1 active deployment
Preview — ca491cca Deployed Nov 27, 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