Repository navigation
fix(git): keep untracked new files inside the 2000-char diff slice - #23
Merged
Merged
Conversation
Failure episodes and success events took a naive prefix of capture_diff_snapshot, so a large tracked diff dropped the untracked new-file supplement from DEBUG #57. Truncate inside the helper and reserve a fixed tail for that supplement. Co-authored-by: Steper Lin <linker.lin@live.com>
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
失败 episode 和成功事件不再把
capture_diff_snapshot的结果做[:2000]前缀切片。截断改在 helper 内完成:已跟踪 diff 会占满 2000 字时,先裁跟踪前缀,固定留 480 字给未跟踪新文件块,因此notes.md这类证据在大 diff 里仍然可见。预算仍是 2000,不抬高。Failure episodes and success events no longer take a naive
[:2000]prefix ofcapture_diff_snapshot. Truncation happens inside the helper: when the tracked diff would fill the 2000-character budget, the tracked prefix is clipped first and a fixed 480-character tail is kept for untracked new-file hunks, so a file such asnotes.mdstays visible. The budget stays 2000.What changed
capture_diff_snapshotreserves_UNTRACKED_TAIL_CHARS(480, and at most a quarter ofmax_chars) when the tracked diff would leave less room than that tail. The returned string is at mostmax_chars. If nothing eligible is untracked, the tail goes back to the tracked diff._failure_diffand the success event both callcapture_diff_snapshot(..., max_chars=_STORED_DIFF_CHARS)(2000). The second[:2000]slice is gone, so both arms share one policy..venv,node_modules,__pycache__,.git, protected files, runtime dirs (memory/,.evolver/), and NUL binaries stay out of the untracked supplement.skip_validation, or val-seal changes. DEBUG #61 and DEBUG #68 residuals are untouched.How to test
uv run pytest tests/test_git_ops.py tests/gep/test_solidify.py tests/gep/test_solidify_acceptance_hook.py tests/gep/test_solidify_bench_pack.py tests/gep/test_solidify_diagnostic_funnel.py tests/gep/test_solidify_dogfood_fixes.py tests/gep/test_solidify_fitness.py tests/gep/test_solidify_helpers.py tests/gep/test_solidify_pending_soft.py tests/gep/test_solidify_soft_continue_bugs.py tests/gep/test_solidify_soft_default.py tests/gep/test_no_git_no_commit.py tests/test_auto_trigger_and_evolution_e2e.py::TestAutoEvolutionRealReliableBeneficialE2E::test_two_round_closed_loop_rollback_then_beneficial_repair -q --tb=line181 passed.uv run ruff check src tests && uv run ruff format --check src tests && uv run mypy srcSuccess: no issues found in 353 source files.uv run pytest tests/ -q --tb=line -m "not slow"4454 passed, 25 deselected, plustests/gep/test_material.py::TestWatermarkIngest::test_identical_rewrite_is_noop(skippedvsrewrite_noop). That failure reproduces on unmodifiedmaster(233bb5b) in this environment and is not part of this diff.Risk
Low. The stored diff text changes only when a tracked diff would otherwise crowd out untracked new files. The 2000-character episode/event budget is not raised. The default 80_000-character capture (policy secret scan) reserves the same 480-character tail only when the tracked diff itself exceeds that budget.
Harness/evaluator governance
Upstream governance surface: solidify stored diff scene (
gep/git_ops.capture_diff_snapshot, failure_failure_diff, successdiff_snapshot). Gates, Parent baseline,skip_validation, and val seal are unchanged.Downstream EvoX impact: N/A -- snapshot text only, no bridge or contract change.
Rollout-local scope: episode/event diff string allocation inside the existing 2000-character budget.
Promotion boundary: this PR; no feature flag.
Evaluator mismatch sets: evidence (diff scene). Observation, action, repair, verification, and belief sets are unchanged.
Non-regression evidence: git_ops + solidify family (181 passed, including the two-round closed loop), ruff, and mypy. Full non-slow suite has one pre-existing
test_materialfailure that also fails onmaster.Fix-severity review: low
Owner approval: N/A
Security boundary: untracked new-file text was already eligible for the snapshot after #22. This change only keeps that text inside the truncated budget. Noise, protected, runtime, and binary paths stay excluded. No new network or secret-handling path.
Rollback: revert this commit.
Live promotion: no
Autonomous evaluator self-editing: no
Self-check
pytest -m "not slow"has one pre-existing failure onmaster(test_identical_rewrite_is_noop), noted above..pysource in CI — N/A, no new modules.Related
Follow-up to #22 / DEBUG #57. Does not close a GitHub issue.