Ensure Galley stages executor-produced worktree changes before supervisor review so newly-created files are visible in review evidence even when the executor did not run git add.#69
Conversation
|
/galley Please revise the review-staging implementation around the submitted artifact set. Goal: Implementation direction:
Acceptance criteria:
Keep the fix scoped to the review-staging/evidence boundary. The supervisor prompt does not need a new dirty-specific rule for this patch; this is a Galley-owned submitted-artifact selection issue. |
|
Galley requeued task |
f63fe9f to
5e74f9f
Compare
Goal
Ensure Galley stages executor-produced worktree changes before supervisor review so newly-created files are visible in review evidence even when the executor did not run git add.
Acceptance Criteria
AC1After an executor attempt completes and before supervisor review evidence is captured, Galley stages executor-produced worktree changes so newly-created untracked files are included in the attempt diff.AC2Supervisor evidence for an attempt uses the staged, reviewable diff produced by Galley, so a task is not reviewed as an empty submitted diff when the only change is a new file created by the executor.AC3Review-time staging does not require the executor to run git add and remains compatible with accepted-task finalization; accepted new files are committed through the existing Galley finalization path.AC4Review-time staging preserves context-only task input behavior; files declared in task.files with commit:false are not accidentally committed as part of accepted-task finalization.AC5Review-time staging preserves forbidden-path enforcement; changes under task.scope.forbidden_paths are still detected before accepted finalization completes.AC6Galley records review-time git add evidence when it stages executor output and surfaces a clear attempt error if staging fails instead of sending an empty diff to supervisor.Final Verification
gofmt -l $(git ls-files '*.go'): passedgo build -o /tmp/galley-bin ./cmd/galley: passedgo run ./cmd/galley task validate <tmp afk-task with workspace path substituted>: passedgo run ./cmd/galley profile validate --kind environment examples/environment-local.yaml: passedpython3 -m json.tool on schemas/claude-result.schema.json, schemas/supervisor-verdict.schema.json, plugins/galley/skills/galley/references/{task,quality,environment}.schema.json, plugins/galley/.claude-plugin/plugin.json, plugins/galley/.codex-plugin/plugin.json, .claude-plugin/marketplace.json, .agents/plugins/marketplace.json: passedgofmt -l internal/daemon/review_staging_test.go internal/daemon/loop.go internal/vcs/vcs.go: passedgofmt -l .: passedgo test ./internal/daemon ./internal/vcs ./internal/workspace: passedtest -z "$(find . -name '*.go' -not -path './.git/*' -print | xargs gofmt -l)": passedgo test ./...: passedgo build -o /tmp/galley ./cmd/galley: passedgo run ./cmd/galley schema check: passedgo run ./cmd/galley task validate examples/afk-task.yaml: passedgo run ./cmd/galley profile validate --kind quality examples/quality-default.yaml: passedpython3 -m json.tool schemas/claude-result.schema.json >/dev/null: passed./scripts/smoke-local.sh: passedKey Decisions
D1Who should make executor-created files reviewable for supervisor evaluation? -> Galley stages executor-produced worktree changes after executor completion and before supervisor evidence capture.claude-decision-2Fix the staging-failure path in loop.go (swallow the error in Run) or fix the test expectation? -> Fix the test expectation to expect Run to return a non-nil error.claude-decision-3Should daemon/loop.go or vcs/vcs.go be modified during this rerun? -> Leave them untouched.claude-decision-4How should review-time staging exclude commit:false input destinations without breaking the existing finalization cleanup path? -> Pass each commit:false destination as a :(exclude,literal) pathspec to git add -A -- . :(exclude,literal) so the destinations are physically kept in the worktree (still readable as context by the executor) but never enter the index, and therefore never appear in any diff surface that builds Evidence.Diff. The existing CleanupNonCommitted hook continues to remove them before commit.claude-decision-5Should the seam signature (stageExecutorOutput) include excludePaths, or should the closure read loaded.Files internally? -> Add excludePaths to the seam signature.Risks
R1trust-boundary: Review-time staging mutates the Git index before supervisor acceptance, so task input cleanup, forbidden-path checks, and finalization must preserve existing safety boundaries.