Merge branch 'publish-drop-sandbox-masks' into main
Drop sandbox placeholder files before commit; refuse them at merge Claude Code 2.1.312 creates empty protected files (.env*, package.json, lockfiles) in the workspace. The runner now removes new zero-byte ones before staging, and the merge step refuses a branch that adds them. Removes the 16 placeholders task tkn5j34775tk put on main.
24 files changed,
+457
−6
.env+0 −0.env.development+0 −0.env.development.local+0 −0.env.production+0 −0.env.production.local+0 −0.env.test+0 −0.env.test.local+0 −0.gitmodules+0 −0.npmrc+0 −0.rastrillo/budgets.txt+1 −1.yarnrc+0 −0.yarnrc.yml+0 −0bunfig.toml+0 −0internal/runner/thin/mergestep.go+10 −1internal/runner/thin/sandbox_masks.go+37 −0internal/runner/thin/sandbox_masks_test.go+167 −0internal/runner/workspace/sandbox_masks.go+102 −0internal/runner/workspace/sandbox_masks_test.go+81 −0internal/runner/workspace/task.go+10 −4package-lock.json+0 −0package.json+0 −0pnpm-lock.yaml+0 −0scripts/runner-reference-allowlist.json+49 −0yarn.lock+0 −0
CI passed — run details
diff --git a/.env b/.env| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/.env.development b/.env.development| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/.env.development.local b/.env.development.local| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/.env.production b/.env.production| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/.env.production.local b/.env.production.local| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/.env.test b/.env.test| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/.env.test.local b/.env.test.local| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/.gitmodules b/.gitmodules| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/.npmrc b/.npmrc| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 9ef687b0..50b31089 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -38,7 +38,7 @@ time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full |
| perf GET /releases/* skip Verified runner release file downloads, not browser GET screens. |
| perf GET /install.sh skip Mac runners: the one-line bootstrap a terminal pipes to sh, not a browser screen. |
| time internal/runner/containment 15s Plan 3 loaded CI measured 10.817s; |
| -size internal/runner/thin 24200 16572 Runner state, connections and execution share internal helpers. Adds Claude OAuth usage and refusal tests. Measured 24200 source, 16572 test lines. |
| +size internal/runner/thin 24246 16739 Runner state, connections and execution share internal helpers. Adds usage refresh and placeholder guards. Measured 24246 source, 16739 test lines. |
| time internal/thintest 240s Thin contract and page tests, the Assistant's and the models' included, share one harness. Measured 202s on a shared 16 CPU box (2026-11-13); CI runs two lanes. |
| time internal/runner/mac 30s Mac runners (Darwin worker): real process groups killed after a grace and proven gone (SIGTERM, SIGKILL, the marker sweep), and the probes run end to end with fake srt and xcodebuild, P6 killing. |
| time internal/runner/thin 45s Thin v1 slice 4 review: real git repositories for the merge and squash checks, a stalled fetch, and a 16 MiB candidate streamed through the review diff and the checks pack (about 5s). |
diff --git a/.yarnrc b/.yarnrc| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/.yarnrc.yml b/.yarnrc.yml| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/bunfig.toml b/bunfig.toml| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/internal/runner/thin/mergestep.go b/internal/runner/thin/mergestep.go| index 45dc5186..a8678ec8 100644 |
| --- a/internal/runner/thin/mergestep.go |
| +++ b/internal/runner/thin/mergestep.go |
| @@ -11,6 +11,7 @@ import ( |
| "amadan.net/oficina/equipo/internal/runner/forge" |
| "amadan.net/oficina/equipo/internal/runner/workspace" |
| + "amadan.net/oficina/equipo/internal/runnerproto" |
| "amadan.net/oficina/equipo/internal/wire" |
| ) |
| @@ -62,8 +63,12 @@ func (e *Engineer) mergeStep(ctx context.Context, r stepRow, progress func(wire. |
| if e.ConfirmMerge != nil { |
| confirm = func(ctx context.Context) error { return e.ConfirmMerge(ctx, r.StepID, r.Attempt) } |
| } |
| + var maskDetail string |
| notAuthorized := false |
| confirmMerge := func(ctx context.Context) error { |
| + if maskDetail = e.mergeSandboxDetail(ctx, r); maskDetail != "" { |
| + return forge.ErrMergeRefused |
| + } |
| err := confirm(ctx) |
| if errors.Is(err, ErrMergeNotAuthorized) { |
| notAuthorized = true |
| @@ -98,13 +103,17 @@ func (e *Engineer) mergeStep(ctx context.Context, r stepRow, progress func(wire. |
| cctx, cancel := context.WithTimeout(mctx, 3*time.Minute) |
| out, err = forge.MergeBranch(cctx, m) |
| cancel() |
| - if notAuthorized || !errors.Is(err, forge.ErrMergeUncertain) || uncertain+1 >= mergeAttempts { |
| + if maskDetail != "" || notAuthorized || !errors.Is(err, forge.ErrMergeUncertain) || uncertain+1 >= mergeAttempts { |
| break |
| } |
| time.Sleep(time.Duration(uncertain+1) * mergeBackoff) |
| } |
| // Why it did not merge, for the person (the stopped step's log tail): |
| // the hub's status, code and message, or the error's words. |
| + if maskDetail != "" { |
| + rep.LogTail = runnerproto.RedactDetail(maskDetail, runnerproto.DetailLimit) |
| + return fail("policy_rejected") |
| + } |
| rep.LogTail = forge.MergeDetail(err) |
| if notAuthorized && err != nil { |
| return fail("merge_not_authorized") |
diff --git a/internal/runner/thin/sandbox_masks.go b/internal/runner/thin/sandbox_masks.go| new file mode 100644 |
| index 00000000..2164c9ea |
| --- /dev/null |
| +++ b/internal/runner/thin/sandbox_masks.go |
| @@ -0,0 +1,37 @@ |
| +package thin |
| + |
| +import ( |
| + "context" |
| + "errors" |
| + "fmt" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/workspace" |
| +) |
| + |
| +const ( |
| + copyMergeSandboxMask = "Merge refused: %s is a new empty file at a sandbox placeholder path. Remove it or add the intended contents before merging." // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-13) |
| + copyMergeSandboxCheck = "Could not check the branch for sandbox placeholder files: %v" // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-13) |
| +) |
| + |
| +// Every actual merge request checks the judged commit against the current |
| +// default branch. Reconciliation of an already landed merge needs no check. |
| +func (e *Engineer) mergeSandboxDetail(ctx context.Context, r stepRow) string { |
| + ctx, cancel := context.WithTimeout(ctx, fetchTimeout) |
| + defer cancel() |
| + _, base, _, err := e.Clones.Heads(ctx, r.Repo, nil) |
| + if err != nil && !errors.Is(err, ErrEmptyRepo) { |
| + return fmt.Sprintf(copyMergeSandboxCheck, err) |
| + } |
| + if err := e.fetch(ctx, r.Repo); err != nil { |
| + return fmt.Sprintf(copyMergeSandboxCheck, err) |
| + } |
| + tree := workspace.TaskTree{Git: e.O.Runner.GitPath, GitDir: e.Clones.Path(r.Repo), Dir: e.Clones.Path(r.Repo)} |
| + paths, err := tree.AddedSandboxMasks(ctx, base, r.CandidateSHA) |
| + if err != nil { |
| + return fmt.Sprintf(copyMergeSandboxCheck, err) |
| + } |
| + if len(paths) > 0 { |
| + return fmt.Sprintf(copyMergeSandboxMask, fmt.Sprintf("%q", paths[0])) |
| + } |
| + return "" |
| +} |
diff --git a/internal/runner/thin/sandbox_masks_test.go b/internal/runner/thin/sandbox_masks_test.go| new file mode 100644 |
| index 00000000..c1941bd0 |
| --- /dev/null |
| +++ b/internal/runner/thin/sandbox_masks_test.go |
| @@ -0,0 +1,167 @@ |
| +package thin |
| + |
| +import ( |
| + "context" |
| + "os" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/forge" |
| + "amadan.net/oficina/equipo/internal/runner/workspace" |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +var maskTestPaths = []string{ |
| + ".env", ".env.local", ".env.development", ".env.development.local", |
| + ".env.production", ".env.production.local", ".env.test", ".env.test.local", |
| + ".gitmodules", ".npmrc", ".yarnrc", ".yarnrc.yml", "bunfig.toml", |
| + "package-lock.json", "package.json", "pnpm-lock.yaml", "yarn.lock", |
| +} |
| + |
| +func writeMaskTest(t *testing.T, dir, path, body string) { |
| + t.Helper() |
| + if err := os.WriteFile(filepath.Join(dir, path), []byte(body), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +func TestSandboxMasksPublish(t *testing.T) { |
| + for _, kind := range []string{"placeholders", "real_package", "existing_empty", "existing_emptied", "symlink", "ordinary_empty"} { |
| + t.Run(kind, func(t *testing.T) { |
| + ctx := context.Background() |
| + e, f, r, _ := hubRig(t) |
| + seed := filepath.Join(filepath.Dir(f.dir), "seed") |
| + if kind == "existing_empty" || kind == "existing_emptied" { |
| + body := "" |
| + if kind == "existing_emptied" { |
| + body = "old contents\n" |
| + } |
| + writeMaskTest(t, seed, ".gitmodules", body) |
| + gitOut(t, seed, "add", ".gitmodules") |
| + gitOut(t, seed, "commit", "-qm", "existing file") |
| + gitOut(t, seed, "push", "-q", f.dir, "main") |
| + } |
| + if err := e.fetch(ctx, r.Repo); err != nil { |
| + t.Fatal(err) |
| + } |
| + base, err := e.defaultTip(ctx, r.Repo) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + r.Specialist, r.Branch, r.Base = wire.SpecialistEngineering, "equipo/tk1-masks", base |
| + loc := e.tree(r, base) |
| + tree, err := workspace.PrepareTaskTree(ctx, loc.Git, e.Clones.Path(r.Repo), base, r.Branch, loc.Dir, loc.GitDir) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + writeMaskTest(t, tree.Dir, "NEWS", "intentional change\n") |
| + keep := "" |
| + switch kind { |
| + case "placeholders": |
| + for _, p := range maskTestPaths { |
| + writeMaskTest(t, tree.Dir, p, "") |
| + } |
| + case "real_package": |
| + keep = "package.json" |
| + writeMaskTest(t, tree.Dir, keep, "{\"name\":\"real\"}\n") |
| + case "existing_empty", "existing_emptied": |
| + keep = ".gitmodules" |
| + writeMaskTest(t, tree.Dir, keep, "") |
| + case "symlink": |
| + keep = ".npmrc" |
| + if err := os.Symlink("NEWS", filepath.Join(tree.Dir, keep)); err != nil { |
| + t.Fatal(err) |
| + } |
| + case "ordinary_empty": |
| + keep = "ordinary.txt" |
| + writeMaskTest(t, tree.Dir, keep, "") |
| + } |
| + sha, err := tree.Commit(ctx, "step", commitName, commitEmail) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if kind == "placeholders" { |
| + for _, p := range maskTestPaths { |
| + if _, err := os.Lstat(filepath.Join(tree.Dir, p)); !os.IsNotExist(err) { |
| + t.Errorf("placeholder %s remains before publish: %v", p, err) |
| + } |
| + } |
| + } else if _, err := os.Lstat(filepath.Join(tree.Dir, keep)); err != nil { |
| + t.Fatalf("real file removed: %v", err) |
| + } |
| + r.Candidate = sha |
| + rep := e.publish(ctx, r, wire.StepReport{}) |
| + if rep.State != wire.StepDone || !rep.Pushed { |
| + t.Fatalf("publish: %+v", rep) |
| + } |
| + paths := "\n" + gitOut(t, f.dir, "ls-tree", "-r", "--name-only", r.Branch) + "\n" |
| + if kind == "placeholders" { |
| + for _, p := range maskTestPaths { |
| + if strings.Contains(paths, "\n"+p+"\n") { |
| + t.Errorf("published placeholder %s", p) |
| + } |
| + } |
| + } else if !strings.Contains(paths, "\n"+keep+"\n") { |
| + t.Fatalf("real file missing from published tree: %s", paths) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestMergeStepSandboxMasks(t *testing.T) { |
| + for _, p := range append(append([]string{}, maskTestPaths...), "ordinary.txt", "nested/package.json", "nonempty", "existing", ".npmrc/empty") { |
| + t.Run(p, func(t *testing.T) { |
| + e, f, r, _ := hubRig(t) |
| + seed := filepath.Join(filepath.Dir(f.dir), "seed") |
| + name, body, refused := p, "", true |
| + if p == "existing" { |
| + name, refused = ".gitmodules", false |
| + writeMaskTest(t, seed, name, "") |
| + gitOut(t, seed, "add", name) |
| + gitOut(t, seed, "commit", "-qm", "existing empty") |
| + gitOut(t, seed, "push", "-q", f.dir, "main") |
| + } |
| + gitOut(t, seed, "checkout", "-q", "-B", r.Branch, "main") |
| + if p == "ordinary.txt" || p == "nested/package.json" || p == ".npmrc/empty" { |
| + refused = false |
| + } |
| + if p == "nonempty" { |
| + name, body, refused = "package.json", "{}\n", false |
| + } |
| + if err := os.MkdirAll(filepath.Dir(filepath.Join(seed, name)), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + writeMaskTest(t, seed, name, body) |
| + writeMaskTest(t, seed, "NEWS", "merge change\n") |
| + gitOut(t, seed, "add", "-A") |
| + gitOut(t, seed, "commit", "-qm", "candidate") |
| + r.CandidateSHA = gitOut(t, seed, "rev-parse", "HEAD") |
| + gitOut(t, seed, "push", "-q", "--force", f.dir, r.Branch) |
| + rep := e.Exec(context.Background(), r, func(wire.StepReport) {}) |
| + if refused { |
| + if rep.State != wire.StepFailed || f.requests != 0 || !strings.Contains(rep.LogTail, "sandbox placeholder") || !strings.Contains(rep.LogTail, name) { |
| + t.Fatalf("placeholder merge: %+v, requests %d", rep, f.requests) |
| + } |
| + } else if rep.State != wire.StepDone || f.requests != 1 { |
| + t.Fatalf("real file merge: %+v, requests %d", rep, f.requests) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestMergeStepSandboxMasksConfirmsLast(t *testing.T) { |
| + e, f, r, _ := hubRig(t) |
| + f.answer = func(_ int, merge func() (forge.HubMergeResult, error)) (forge.HubMergeResult, error) { |
| + e.Clones.Forge = f |
| + return merge() |
| + } |
| + e.ConfirmMerge = func(context.Context, string, int64) error { |
| + e.Clones.Forge = brokenRemote{f} |
| + return nil |
| + } |
| + rep := e.Exec(context.Background(), r, func(wire.StepReport) {}) |
| + if rep.State != wire.StepDone || f.requests != 1 { |
| + t.Fatalf("read the repository after final authorization: %+v", rep) |
| + } |
| +} |
diff --git a/internal/runner/workspace/sandbox_masks.go b/internal/runner/workspace/sandbox_masks.go| new file mode 100644 |
| index 00000000..6b2bda5b |
| --- /dev/null |
| +++ b/internal/runner/workspace/sandbox_masks.go |
| @@ -0,0 +1,102 @@ |
| +package workspace |
| + |
| +import ( |
| + "context" |
| + "errors" |
| + "os" |
| + "path/filepath" |
| + "slices" |
| + "strings" |
| +) |
| + |
| +// These are the root files created by Claude 2.1.312's subprocess scrub |
| +// initializer, including .env.local even when a repository ignores it. |
| +var sandboxMaskPaths = []string{ |
| + ".env", ".env.local", ".env.development", ".env.development.local", |
| + ".env.production", ".env.production.local", ".env.test", ".env.test.local", |
| + ".gitmodules", ".npmrc", ".yarnrc", ".yarnrc.yml", "bunfig.toml", |
| + "package-lock.json", "package.json", "pnpm-lock.yaml", "yarn.lock", |
| +} |
| + |
| +// Record absence before the specialist starts, after checkout or rebase. |
| +func (t *TaskTree) recordSandboxPaths() error { |
| + t.absentSandboxPaths = nil |
| + for _, name := range sandboxMaskPaths { |
| + _, err := os.Lstat(filepath.Join(t.Dir, name)) |
| + switch { |
| + case errors.Is(err, os.ErrNotExist): |
| + t.absentSandboxPaths = append(t.absentSandboxPaths, name) |
| + case err != nil: |
| + return err |
| + } |
| + } |
| + return nil |
| +} |
| + |
| +// The caller has proved the namespace exited. Existing files, symlinks, |
| +// directories and new files with contents belong to the step, not cleanup. |
| +func (t TaskTree) removeSandboxMasks() error { |
| + for _, name := range t.absentSandboxPaths { |
| + path := filepath.Join(t.Dir, name) |
| + info, err := os.Lstat(path) |
| + if errors.Is(err, os.ErrNotExist) { |
| + continue |
| + } |
| + if err != nil { |
| + return err |
| + } |
| + if info.Mode().IsRegular() && info.Size() == 0 { |
| + if err := os.Remove(path); err != nil { |
| + return err |
| + } |
| + } |
| + } |
| + return nil |
| +} |
| + |
| +// AddedSandboxMasks reads the exact root entries in committed trees. It does |
| +// not descend into directories with these names. Empty base means an unborn |
| +// default branch; existing paths of any type are left to normal review. |
| +func (t TaskTree) AddedSandboxMasks(ctx context.Context, base, candidate string) ([]string, error) { |
| + if !objectID.MatchString(candidate) || base != "" && !objectID.MatchString(base) { |
| + return nil, ErrTreeRefused |
| + } |
| + read := func(sha string) (map[string]bool, error) { |
| + entries := map[string]bool{} |
| + if sha == "" { |
| + return entries, nil |
| + } |
| + args := []string{"ls-tree", "-z", "-l", "--full-tree", sha, "--"} |
| + raw, err := t.git(ctx, nil, nil, append(args, sandboxMaskPaths...)...) |
| + if err != nil { |
| + return nil, err |
| + } |
| + for _, entry := range strings.Split(raw, "\x00") { |
| + if entry == "" { |
| + continue |
| + } |
| + meta, name, ok := strings.Cut(entry, "\t") |
| + f := strings.Fields(meta) |
| + if !ok || len(f) != 4 || !slices.Contains(sandboxMaskPaths, name) { |
| + return nil, ErrTreeRefused |
| + } |
| + entries[name] = (f[0] == "100644" || f[0] == "100755") && f[1] == "blob" && f[3] == "0" |
| + } |
| + return entries, nil |
| + } |
| + before, err := read(base) |
| + if err != nil { |
| + return nil, err |
| + } |
| + after, err := read(candidate) |
| + if err != nil { |
| + return nil, err |
| + } |
| + var paths []string |
| + for _, name := range sandboxMaskPaths { |
| + if _, existed := before[name]; !existed && after[name] { |
| + paths = append(paths, name) |
| + } |
| + } |
| + return paths, nil |
| +} |
diff --git a/internal/runner/workspace/sandbox_masks_test.go b/internal/runner/workspace/sandbox_masks_test.go| new file mode 100644 |
| index 00000000..c881a8e8 |
| --- /dev/null |
| +++ b/internal/runner/workspace/sandbox_masks_test.go |
| @@ -0,0 +1,81 @@ |
| +package workspace |
| + |
| +import ( |
| + "context" |
| + "errors" |
| + "os" |
| + "path/filepath" |
| + "testing" |
| +) |
| + |
| +func TestTaskTreeSandboxMasksRebase(t *testing.T) { |
| + ctx := context.Background() |
| + clone, base := taskClone(t) |
| + seed := filepath.Join(filepath.Dir(clone), "seed") |
| + if err := os.WriteFile(filepath.Join(seed, ".gitmodules"), nil, 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + taskGit(t, seed, "add", ".gitmodules") |
| + taskGit(t, seed, "commit", "-qm", "intentional empty file") |
| + candidate := taskGit(t, seed, "rev-parse", "HEAD") |
| + taskGit(t, clone, "fetch", "-q", seed, "main") |
| + root := t.TempDir() |
| + tree, err := PrepareTaskTree(ctx, "/usr/bin/git", clone, base, "equipo/tk1-rebase", filepath.Join(root, "work"), filepath.Join(root, "private")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if conflicts, err := tree.Rebase(ctx, base, candidate); err != nil || len(conflicts) != 0 { |
| + t.Fatalf("rebase: %v %v", conflicts, err) |
| + } |
| + sha, err := tree.Commit(ctx, "resolved", "t", "t@example.com") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if got := taskGit(t, tree.GitDir, "ls-tree", "--name-only", sha, "--", ".gitmodules"); got != ".gitmodules" { |
| + t.Fatalf("rebase lost existing file: %q", got) |
| + } |
| +} |
| + |
| +func TestTaskTreeSandboxMasksOnly(t *testing.T) { |
| + for _, unborn := range []bool{false, true} { |
| + t.Run(map[bool]string{false: "base", true: "unborn"}[unborn], func(t *testing.T) { |
| + ctx := context.Background() |
| + clone, base := taskClone(t) |
| + if unborn { |
| + base = "" |
| + } |
| + root := t.TempDir() |
| + tree, err := PrepareTaskTree(ctx, "/usr/bin/git", clone, base, "equipo/tk1-masks", filepath.Join(root, "work"), filepath.Join(root, "private")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + for _, name := range sandboxMaskPaths { |
| + if err := os.WriteFile(filepath.Join(tree.Dir, name), nil, 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + if _, err := tree.Commit(ctx, "masks", "t", "t@example.com"); !errors.Is(err, ErrNoChanges) { |
| + t.Fatalf("placeholder-only commit: %v", err) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestAddedSandboxMasksUnborn(t *testing.T) { |
| + clone, _ := taskClone(t) |
| + seed := filepath.Join(filepath.Dir(clone), "seed") |
| + if err := os.WriteFile(filepath.Join(seed, "package.json"), nil, 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + taskGit(t, seed, "add", "package.json") |
| + taskGit(t, seed, "commit", "-qm", "empty package") |
| + candidate := taskGit(t, seed, "rev-parse", "HEAD") |
| + tree := TaskTree{Git: "/usr/bin/git", GitDir: filepath.Join(seed, ".git"), Dir: seed} |
| + paths, err := tree.AddedSandboxMasks(context.Background(), "", candidate) |
| + if err != nil || len(paths) != 1 || paths[0] != "package.json" { |
| + t.Fatalf("unborn: %v %v", paths, err) |
| + } |
| + if _, err := tree.AddedSandboxMasks(context.Background(), candidate, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); err == nil { |
| + t.Fatal("missing candidate accepted") |
| + } |
| +} |
diff --git a/internal/runner/workspace/task.go b/internal/runner/workspace/task.go| index 9151a1d9..e013c1de 100644 |
| --- a/internal/runner/workspace/task.go |
| +++ b/internal/runner/workspace/task.go |
| @@ -27,6 +27,7 @@ var ( |
| // config from the repository or the namespace ever runs. |
| type TaskTree struct { |
| Dir, GitDir, Git, Branch, Base string |
| + absentSandboxPaths []string |
| } |
| func (t TaskTree) git(ctx context.Context, stdin io.Reader, extra []string, args ...string) (string, error) { |
| @@ -95,7 +96,8 @@ func PrepareTaskTree(ctx context.Context, git, clone, base, branch, dir, gitDir |
| if _, err := t.git(ctx, nil, nil, "symbolic-ref", "HEAD", "refs/heads/"+branch); err != nil { |
| return t, err |
| } |
| - return t, nil |
| + err := t.recordSandboxPaths() |
| + return t, err |
| } |
| if id, err := t.git(ctx, nil, nil, "rev-parse", "--verify", "--end-of-options", base+"^{commit}"); err != nil || id != base { |
| return t, ErrTreeRefused |
| @@ -115,7 +117,8 @@ func PrepareTaskTree(ctx context.Context, git, clone, base, branch, dir, gitDir |
| if _, err := t.git(ctx, nil, nil, "symbolic-ref", "HEAD", "refs/heads/"+branch); err != nil { |
| return t, err |
| } |
| - return t, nil |
| + err := t.recordSandboxPaths() |
| + return t, err |
| } |
| // check refuses a tree that holds a .git entry at any depth (it would |
| @@ -150,6 +153,9 @@ func (t TaskTree) Commit(ctx context.Context, message, name, email string) (stri |
| if err := t.check(); err != nil { |
| return "", err |
| } |
| + if err := t.removeSandboxMasks(); err != nil { |
| + return "", err |
| + } |
| if _, err := t.git(ctx, nil, nil, "add", "-A", "--", "."); err != nil { |
| return "", err |
| } |
| @@ -215,7 +221,7 @@ func (t TaskTree) Remove() error { |
| // resolve. The runner still commits on the base, so the new commit is |
| // the change, rebased. No merge driver or attribute from the repository |
| // runs (system and global config are off). |
| -func (t TaskTree) Rebase(ctx context.Context, from, commit string) ([]string, error) { |
| +func (t *TaskTree) Rebase(ctx context.Context, from, commit string) ([]string, error) { |
| if !objectID.MatchString(from) || !objectID.MatchString(commit) || !objectID.MatchString(t.Base) { |
| return nil, ErrTreeRefused |
| } |
| @@ -255,5 +261,5 @@ func (t TaskTree) Rebase(ctx context.Context, from, commit string) ([]string, er |
| if _, err := t.git(ctx, nil, nil, "checkout-index", "-a", "-f"); err != nil { |
| return nil, err |
| } |
| - return conflicts, nil |
| + return conflicts, t.recordSandboxPaths() |
| } |
diff --git a/package-lock.json b/package-lock.json| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/package.json b/package.json| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml| deleted file mode 100644 |
| index e69de29b..00000000 |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index cf407170..61c28532 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -15539,6 +15539,55 @@ |
| "count": 2, |
| "reason": "Ignores a runner binary built in place, so build output is never committed; a path, not a dead reference." |
| }, |
| + { |
| + "path": "internal/runner/thin/sandbox_masks_test.go", |
| + "line_sha256": "4359f6f4f06e9f729c19d93229089be803fb31e74b82ff90b328ab9aa3de85f2", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Sandbox placeholder paths and regression fixtures, not executable package dependencies." |
| + }, |
| + { |
| + "path": "internal/runner/thin/sandbox_masks_test.go", |
| + "line_sha256": "6902db0d0f77ef5c018f1c4af5ef257cc2c074652ab4f2a8bb2fb3715c1707ac", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Sandbox placeholder paths and regression fixtures, not executable package dependencies." |
| + }, |
| + { |
| + "path": "internal/runner/thin/sandbox_masks_test.go", |
| + "line_sha256": "7660ef41721f3cdf6030dda6191b5beed142e1864f14c4d17d417796812e13c1", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Sandbox placeholder paths and regression fixtures, not executable package dependencies." |
| + }, |
| + { |
| + "path": "internal/runner/thin/sandbox_masks_test.go", |
| + "line_sha256": "b3365d06857ad1fd1eb4c1c2700d4247a35c5e04b2088e24e78a65ac42e0240a", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Sandbox placeholder paths and regression fixtures, not executable package dependencies." |
| + }, |
| + { |
| + "path": "internal/runner/thin/sandbox_masks_test.go", |
| + "line_sha256": "d37312e2102a1f607ed48f08b1250b82fc96526eb7383177eda929291ea3de67", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Sandbox placeholder paths and regression fixtures, not executable package dependencies." |
| + }, |
| + { |
| + "path": "internal/runner/workspace/sandbox_masks.go", |
| + "line_sha256": "4359f6f4f06e9f729c19d93229089be803fb31e74b82ff90b328ab9aa3de85f2", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Sandbox placeholder paths and regression fixtures, not executable package dependencies." |
| + }, |
| + { |
| + "path": "internal/runner/workspace/sandbox_masks.go", |
| + "line_sha256": "6902db0d0f77ef5c018f1c4af5ef257cc2c074652ab4f2a8bb2fb3715c1707ac", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Sandbox placeholder paths and regression fixtures, not executable package dependencies." |
| + }, |
| { |
| "path": "internal/runner/thin/claude_usage_test.go", |
| "line_sha256": "f825b76c337132f77447485c6b3a489b59c82a31d1e7ccfaa73425b42c86cde3", |
diff --git a/yarn.lock b/yarn.lock| deleted file mode 100644 |
| index e69de29b..00000000 |