Repository navigation
git/checkout: a fresh working copy lives inside the run's own directory - #124
Merged
Merged
Conversation
A run has one directory — the job's, or its own (plans/jobs.md §2). With
`workdir` a checkout is kept inside the job's; without one it used to go
under <dataDir>/worktrees/<runId>, while job/dir hands a run with no job
its artifact dir — so a workflow whose agent has cwd: "{{ dir.path }}"
could not see the repositories it checked out unless it ran under a job.
Now the fresh copy goes under the run's artifact dir, <artifacts>/<runId>/
<repo>, still removed at run end (the dir itself is the run's and stays);
a bare bag with no artifacts capability keeps the worktrees fallback.
Invisible to code-change-pr, which reads checkout.path.
This is what lets the seeded `job` and `explore` workflows take `repos`
on the launch (plans/jobs.md §2 as written — one git/checkout per URL into
the run's directory, kept under a job, fresh in a one-shot) with one YAML
and no conditional cwd. The jobs.md sketch now reads `{{ $current }}`
and gives the foreach body an id, the two things that would not have run
as written; federation.md marks step 2 (the explorer, in mcp) built.
Evanfeenstra
added a commit
to stakwork/stakgraph
that referenced
this pull request
Oct 8, 2026
…, peers + strut/run-workflow) stakwork/strut#124 merged: a fresh checkout now lands in the run's artifact dir, so the seeded job and explore workflows see their `repos` in cwd without a job too. Also carries #123: peers.json + /peers, the strut/run-workflow step, list_peers and `peer` on the builder's tools.
Evanfeenstra
added a commit
to stakwork/stakgraph
that referenced
this pull request
Oct 8, 2026
… job launch (#1752) * Lab: the explore workflow (federation step 2), and repos on the job launch explore — what another strut asks this one to run (strut plans/federation.md §2.2): a read-only agent over the graph's read steps and the read-only file tools that answers a question from this swarm's knowledge graph and the repositories named on the launch, with its sources. The SAME launch and skeleton as `job`: { prompt, repos?, session? } + `job` on the launch; job/dir → one git/checkout per repository INTO the run's directory → agent → pack. No bash or web: the caller may be another strut. params (model, maxSteps, tools, builtins, system) are the evolvable surface; tests fake the agent and the checkout and run the rest through the real registry. job gains `repos?` the same way — plans/jobs.md §2 as written: each repository checked out into the job's directory, kept turn to turn; hive passes none today. `items: "{{ input.repos || 0 }}"` is how "none" reads (foreach takes a count). The one-shot case — a run with no job seeing its checkouts in cwd — needs strut's git/checkout to put a fresh copy under the run's own directory (stakwork/strut, feature/checkout-into-run-dir); the pinned strut gets bumped once that lands. Under a job it works on today's pin. * mcp: bump strut to 8908a18 (git/checkout into the run's own directory, peers + strut/run-workflow) stakwork/strut#124 merged: a fresh checkout now lands in the run's artifact dir, so the seeded job and explore workflows see their `repos` in cwd without a job too. Also carries #123: peers.json + /peers, the strut/run-workflow step, list_peers and `peer` on the builder's tools.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #123 (federation step 1); the strut half of step 2, the explorer.
The problem. A run has one directory, the job's or its own (plans/jobs.md §2). With
workdira checkout is kept inside the job's directory; without one it went under<dataDir>/worktrees/<runId>, whilejob/dirhands a run with no job its artifact dir. So a workflow whose agent hascwd: "{{ dir.path }}"could only see the repositories it checked out when it ran under a job.The change.
git/checkoutwithoutworkdirputs the fresh copy under the run's artifact dir,<artifacts>/<runId>/<repo>, still removed at run end; the dir itself is the run's and stays. A bare bag with noartifactscapability keeps the old fallback. Invisible tocode-change-pr, which readscheckout.path.Why now. It lets the seeded
jobandexploreworkflows in the lab takereposon the launch with one YAML and no conditional cwd: onegit/checkoutper URL into the run's directory, kept under a job, fresh in a one-shot. That is plans/jobs.md §2 as written; its sketch is corrected here too ({{ $current }}, a bodyid), and federation.md marks step 2 built. The lab PR is stakwork/stakgraph (branchfeature/explore-seed), which bumps its pinned strut once this lands.Tests. A new case in
src/git.test.tspins the path, the removal at run end, the kept artifact dir, no fallback dir made, and the single cache worktree. The bare-bag case keeps its existing assertions. 1361 tests pass.