From 1b25e69e01592e21fee4818f4904feeb85023f17 Mon Sep 17 00:00:00 2001 From: Jeff Hamons Date: Sun, 19 Jul 2026 09:10:02 -0500 Subject: [PATCH 1/2] fix(fix-swarm): scope git add to owned-files, don't sweep worktree debris Lane checks that run pytest were recording FAIL in ringer runs but passing on manual reruns of the same verify command. Traced to fix-swarm.py's unconditional `git add -A`: it stages ANY file present in the task worktree, not just the agent's actual diff, so the owned-files gate then flags incidental debris as an unauthorized change and fails the whole check even though verify (pytest) passed. Confirmed two debris sources via reproduction against the real 2026-07-19 sprint-wave-3/4 task worktrees: - w3-4598-wallclock: fresh pytest-of-/ basetemp junk. The worker engine (opencode) runs pytest under a sandbox that returns EPERM on writes to ~/.jeff-os/_test_isolation/ and the system temp dirs; Python's tempfile falls through to cwd (the task worktree) as a last resort, leaving pytest-of-.../pytest-N/ debris behind. - w4-2369-refresh: a stale, unrelated .jeff-os/state/argus/checkpoint.json dated May 14 -- 2+ months old, sitting untracked in the worktree from setup, first swept in by this run's git add -A. Fix: unless owned-files is the wildcard "*", stage with `git add -u` (tracked-file modifications only, so an out-of-lane edit to an existing file still trips outside_owned_files) plus `git add -- ` for new files under the declared lane. Untracked debris outside the lane is never staged, so it's never flagged. Verified against both task worktrees: checks now PASS with the debris still present, and a synthetic out-of-lane edit to a tracked file still correctly fails outside_owned_files. Ringer's own check-subprocess env (_run_check, ringer.py:6766) was investigated and ruled out -- not the cause. --- templates/fix-swarm/checks/fix-swarm.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/templates/fix-swarm/checks/fix-swarm.py b/templates/fix-swarm/checks/fix-swarm.py index 9c482150..1e84aa31 100644 --- a/templates/fix-swarm/checks/fix-swarm.py +++ b/templates/fix-swarm/checks/fix-swarm.py @@ -131,9 +131,27 @@ def main() -> int: ) ) - add_result = run_git(["add", "-A"]) - if add_result.returncode != 0: - failures.append(fail("git_add_failed", output_tail(add_result.stdout))) + if "*" in owned_files: + add_result = run_git(["add", "-A"]) + if add_result.returncode != 0: + failures.append(fail("git_add_failed", output_tail(add_result.stdout))) + else: + # Stage tracked-file modifications (so out-of-lane edits to existing + # files still get caught by the owned-files check below) plus any + # new files under the owned paths. Deliberately does NOT `add -A`: + # worker/check subprocesses can leave untracked debris in the + # worktree (e.g. a sandboxed pytest run falling back to cwd for its + # basetemp) that has nothing to do with the agent's actual diff. + add_u_result = run_git(["add", "-u"]) + if add_u_result.returncode != 0: + failures.append(fail("git_add_failed", output_tail(add_u_result.stdout))) + # Only pass owned paths that actually exist: `git add -- ` hard-fails + # ("did not match any files") for a declared-but-untouched owned path. + existing_owned = [item for item in owned_files if Path(item).exists()] + if existing_owned: + add_owned_result = run_git(["add", "--"] + existing_owned) + if add_owned_result.returncode != 0: + failures.append(fail("git_add_failed", output_tail(add_owned_result.stdout))) if not args.summary.is_absolute() and args.summary.exists(): run_git(["reset", "--quiet", "--", str(args.summary)]) From fdcd5d7f177968fd6c54ef0fe3c4aa0633a62cdf Mon Sep 17 00:00:00 2001 From: Jeff Hamons Date: Mon, 27 Jul 2026 18:01:32 -0500 Subject: [PATCH 2/2] docs: credit myself in README so the contributor audit passes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tests/test_contributors.py audits every author in the branch history against `## Contributors`, so any first-time contributor's PR is red until the line lands. Adding it here rather than leaving a red required check for you to interpret. Identical text on both my open PRs (#79, #80) so the second resolves trivially once the first merges — drop the commit if you would rather add credit at merge time. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 529e36cf..cb9397b1 100644 --- a/README.md +++ b/README.md @@ -357,6 +357,7 @@ Every community PR that lands in main is credited here — that's a project rule - [@davekopecek](https://github.com/davekopecek) (Dave Kopecek) — committed the design-reference fixture so the design-token guard runs on every machine (#30) - [@snapsynapse](https://github.com/snapsynapse) (Sam Rogers) — graceful shutdown on SIGINT/SIGTERM with worker-tree cleanup and finished state, plus the 14-test end-to-end CLI regression suite (#4) - [@mlava](https://github.com/mlava) (Mark Lavercombe) — named setup failures across every diagnostic surface (#37) and `run --baseline`, the no-workers check preflight (#38) +- [@jeffhamons](https://github.com/jeffhamons) (Jeff Hamons) — a private OpenCode session store per worker, ending the `database is locked` deaths that made concurrent cheap-tier workers look like model failures (#79), and fix-swarm staging scoped to owned files instead of sweeping worktree debris (#80) Contributions are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md) for the philosophy and what gets a PR merged fast. The short version: small and scoped, rebased on current main, every claim backed by an executed test. Authorship is always preserved — where a maintainer pushes a mechanical fix to your branch, you remain the commit author.