Repository navigation
fix(git): include untracked new files in diff snapshots (DEBUG #57) - #22
Merged
Merged
Conversation
git diff HEAD omits files that were never added, so a notes.md created in the worktree left both the failure episode and the success event with an empty scene. Append those files as new-file hunks from the shared snapshot helper, and keep dependency, runtime, and binary noise out of that supplement. Co-authored-by: Steper Lin <linker.lin@live.com>
2 of 6 tasks
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.
Summary
失败现场和成功路径共用的 diff 快照以前只跑
git diff HEAD,宿主新建且未git add的文件(例如notes.md)不会进入 episode。现在这份快照会把未跟踪新文件收成diff --git新文件块,两臂口径一致。Failure and success snapshots share
capture_diff_snapshot. It used to run onlygit diff HEAD, so an untracked new file such asnotes.mdwas missing from the episode. The helper now appends those files as new-file hunks. Both arms stay on that one helper.What changed
capture_diff_snapshot仍先取git diff HEAD(已跟踪文件的暂存与未暂存改动,含已经git add的新文件),再追加从未入库的未跟踪新文件。补充块跳过爆炸半径不计的路径(
.venv、node_modules、__pycache__、.git、.env等受保护文件)、运行态目录(memory/、.evolver/等,与_is_runtime_state同口径),以及文件头含 NUL 的二进制。读入量不超过快照剩余预算。失败侧
_failure_diff与成功侧事件的diff_snapshot都走这个 helper。未改固化门、不写 Parent baseline、不调用skip_validation、不开 val 密封。未动 DEBUG #61,也未重开未完成 run 的 tick 宿主契约。DEBUG #57 标为已修。回归:未跟踪
notes.md在hypothesis_missing的 episode 里可见,成功事件的diff_snapshot里同样可见;噪声与二进制不出现。capture_diff_snapshotstill starts withgit diff HEAD(staged and unstaged edits to tracked paths, including a new file alreadygit added), then appends never-added files.The supplement skips blast-radius noise (
.venv,node_modules,__pycache__,.git, protected files such as.env), runtime-state dirs (memory/,.evolver/, same heads as_is_runtime_state), and binaries whose first bytes contain NUL. Reads stay within the remaining snapshot budget._failure_diffand the success-pathdiff_snapshotboth use this helper. No solidify-gate, Parent-baseline,skip_validation, or val-seal changes. DEBUG #61 and the unfinished-run tick host contract stay deferred.DEBUG #57 is marked fixed. Regression: untracked
notes.mdis visible onhypothesis_missingand on the success event; noise and binaries are not.How to test
uv run pytest tests/test_git_ops.py tests/gep/test_solidify.py tests/gep/test_solidify_soft_continue_bugs.py tests/gep/test_solidify_fitness.py tests/gep/test_solidify_acceptance_hook.py tests/gep/test_solidify_soft_default.py tests/gep/test_no_git_no_commit.py tests/gep/test_sprint23_bandit_novelty.py tests/gep/test_sprint23_coverage_gaps.py tests/gep/test_policy_check.py -qExpected:
166 passed.uv run pytest tests/test_auto_trigger_and_evolution_e2e.py::TestAutoEvolutionRealReliableBeneficialE2E::test_two_round_closed_loop_rollback_then_beneficial_repair -qExpected:
1 passed.uv run ruff check src/evolver/gep/git_ops.py tests/test_git_ops.py tests/gep/test_solidify.pyuv run ruff format --check src/evolver/gep/git_ops.py tests/test_git_ops.py tests/gep/test_solidify.pyuv run mypy src/evolver/gep/git_ops.pyExpected: ruff clean, mypy
Success: no issues found in 1 source file.Risk
Low. Recorded diff text can now include untracked new-file hunks, so the existing secret scan on this snapshot sees new source files, and later novelty comparisons can see their
+lines. Tracked diffs stay first and are still truncated the same way. Noise trees are not appended. Accept/reject gates are unchanged.Harness/evaluator governance
Upstream governance surface:
gep/git_ops.capture_diff_snapshot(the diff scene stored by solidify failure and success events). Gate logic, Parent baseline writers, and val seal are untouched.Downstream EvoX impact: N/A — no bridge or contract change. Recorded diff text may contain untracked new-file hunks.
Rollout-local scope: snapshot contents only; no proposal, shadow, or cohort change.
Promotion boundary: N/A — not a gate or default-policy promotion.
Evaluator mismatch sets: evidence (the stored diff). Observation, action, repair, verification, and belief sets are unchanged.
Non-regression evidence: untracked-file unit tests on the helper,
hypothesis_missingepisode, and successdiff_snapshot; 166 related tests plus the two-round closed-loop e2e.Fix-severity review: low
Owner approval: N/A
Security boundary: untracked source can now appear in the diff already scanned for secrets.
.envand other protected paths stay out of the untracked supplement. No new network or host tool.Rollback: revert this commit. Snapshots return to
git diff HEADonly.Live promotion: no
Autonomous evaluator self-editing: no
Self-check
uv run pytest(relevant modules, 166 passed, plus 1 closed-loop e2e),uv run ruff check/ruff format --checkon touched files,uv run mypy src/evolver/gep/git_ops.py.Related
DEBUG #57