Trevor PaughSystems engineer
Trevor PaughProject Chronicles

Chronicles / The Factory

Tools, not command lines

Design

The Factory's job store, site sync and launch are typed tools now, served by a small server inside the plugin, instead of PowerShell command lines quoted by the agents. Two hardening fixes followed from the same job's review.

The recurring source of trouble in the pipeline was quoting. Agents were writing PowerShell command lines by hand, with the Bash-versus-PowerShell differences, the substitution helpers and the single-quote rules all living in prompt text. A clerk’s prompt was mostly instructions on how to quote.

Typed calls

The job store, the push to the site and the launch are now tools the agents call with typed arguments, served by a dependency-free Node server that ships with the plugin. The clerk, the merger, the approver and the Factory skill call them. Most of the clerk’s prompt went away. The site token stays in one file, read only by the script the server runs.

Two findings from the review

The approver on job 006 caught a run reported as failed when it had finished cleanly: the exit code came from the last git call inside the script, not from the script. A tool call now succeeds whenever its script does. The security reviewer caught the other: any agent with the plugin’s tools could have pushed any local JSON file to the site. The sync tool now refuses anything that is not a job or spec file in a Factory jobs folder.