A run installs the repository's dependencies in a scripted step, so agents don't spend their steps hunting for them #109
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
Agents set up the repository's environment themselves, partway through a step. In the 8 runs whose logs are still on production (runs 17 to 29), about 116 of 1,474 bash calls (8%) were dependency hunting:
pip install,npm install,which, listingsite-packages.ModuleNotFoundErrororImportErrorcame back 36 times, in runs 22, 23, 25 and 26.fastapiand went looking in osfd's own virtualenv at/opt/openspecflow/app/.venv..venvin the worktree duringopenspec.apply[1]to run its tests, which is how #105 happened.node_moduleswas installed duringopenspec.apply(#67's step-by-step measurement).Expected
backend/andfrontend/:uv.lockorpyproject.toml→uv syncrequirements.txt→ a.venvandpip install -rpackage-lock.json→npm ciopenspec.apply. It runs again before the test steps if the run added or changed a manifest, because a new repository has none untilapplywrites them.AGENTS.mdblock tells agents the environment is ready and where it is, so they use it rather than making their own.It should use #67's shared npm and uv caches once they land. #105 already keeps these environments out of commits. It's also a precondition for #104's scripted test steps, and for LSP diagnostics if runs ever turn them on (#46).
Adding nodes to the built-in pipelines runs into #102 for runs already in flight, so deploy when idle.
Related: #46, #67, #104, #105, #107.
Shipped in
6a4f98a, as the OpenSpec changeinstall-dependencies. It is now archived (9d27890), and its requirements are the newrun-dependenciesspec.Installed before implementation.
script.depsruns beforeopenspec.apply(fix.implementin a quick fix) in every implementing built-in pipeline. It finds the manifests git sees, at the root and up to two directories down, and installs each directory with the tool its manifests call for:npm ci;package.jsonwithout one:npm install --no-package-lock;uv.lock:uv sync --all-extras --all-groups;.venvbeside thepyproject.tomlorrequirements*.txt, with the project installed editable and every extra.No lockfile the repository lacks is written. An editable install's new
*.egg-info/goes into the run's.git/info/exclude.Recorded, and a failure says why.
.osf/deps.jsonrecords each directory with its command, exit code, seconds and a digest of its manifests. A failed install fails the step, and the step's output ends with the installer's own last lines. Go, Rust and other ecosystems are recorded as skipped.Again before the tests.
script.deps.testsinstalls again only where a manifest is new or changed, so a project written from nothing during implementation is installed before its tests run. The agents' block inAGENTS.mdtells them to use these environments rather than make their own.Verified on production after deploying
3346eae, with run 33 (run_01M3P3GXYAS552B7G7EYPNV8KV, cmoriarty/scratch, git-flow-quick-fix):script.depsinstalledbackend/withuv venv .venv && uv pip install --python .venv -e .in 11.3 s, andfrontend/withnpm ciin 11.1 s.git statusclean under both directories.script.deps.testsreported that no manifest had changed.pip install,npm installorwhich, andfix.implementtook 17 tool calls.