SLP-766-01: head-evidence carries verdicts across semantic relocation of an unchanged-looking patch
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- git, python, typescript
Research direction
Start with scripts/head_evidence.py, especially normalize(), identity(), own_diff(), walk(), and render(), then read the continuity criteria in issue #765. Reproduce the alpha-to-beta relocation and base-merge cases using real Git fixtures in scripts/tests/test_head_evidence.py, alongside the benign merge and changed-byte controls. Done means all six acceptance criteria hold, the full scripts/tests suite passes, the four PR gates pass, and the repair receives independent review.
Written by the indexing model from the issue text.
Description
Type: bug
Area: tooling
Priority: high
Goal
Prevent a MACHINE continuity certificate from carrying an independent verdict onto unreviewed content, while preserving legitimate unchanged-content base refreshes. This is the previously unposted SLOPSTER finding SLP-766-01, now verified through the full original module rather than a copied normalization algorithm. Severity: HIGH because the certificate is consumed by the acceptance process; no actual incorrect repository merge is alleged.
Evidence
Inspected master 58cbabf0ef795b0b13fab6342a41878843c8992a, scripts/head_evidence.py, Git blob c9c300abd12ac08d2eae58384d962e2e26b8467a.
Locations: normalize() lines 77–84 and identity() 87–89 remove the hunk location/function context and blob identities; own_diff() uses git diff -U0; walk() lines 133–156 follows the first parent solely while those identities agree. render() then says an earlier verdict stands for the new head.
Governing acceptance: Issue #765 criterion 2 requires: “On a head that carries new content, the comment says so and carries no earlier verdict forward.” Criterion 1 separately permits an unchanged-content base merge. The false-equivalence case below is not such a merge.
Minimal real-Git fixture, file src.ts:
function alpha() {
return 0;
}
function beta() {
return 0;
}
Commit A on a topic branch changes only alpha to return 1. Commit B restores alpha and changes only beta to return 1. Their actual files and Git diffs differ. For each head, invoke the repository's own_diff(head, base, cwd), then identity(diff). Both identities are 8afb9c4b5e1b2b88 in this fixture. Invoke walk(B, reader(base, cwd)): chain.carried is true and the rendered certificate claims a verdict naming A stands for B.
Expected: B is a content change and requires fresh judgement. Observed: B is certified as unchanged. This is a lossy equivalence relation, not a cryptographic hash collision.
The same failure was reproduced with a genuine two-parent merge: advance base independently, merge it into A's branch, and make the alpha-to-beta relocation part of that merge's resulting tree. The second parent is actually reachable from base, yet walk() still carries A. Merely checking the parent count or base ancestry is therefore insufficient.
Reviewer-local execution on 2026-10-18: full unmodified, blob-verified head_evidence.py; real disposable Git repositories; actual own_diff, identity, reader, walk, and render calls. 5 regressions: 2 passed, 3 failed. Failures: ordinary relocation identity, ordinary relocation verdict chain, semantic relocation inside a base merge. Passing controls: a benign base merge shifting line positions, and a changed added byte (return 2) correctly breaking continuity.
Execution boundary: unused forge-adapter imports were replaced with fail-on-use sentinels, with mergeability.CONTEXT supplied for module initialization. No tested Git/identity/chain function was replaced, and no remote mutation was performed. Full repository policy/runtime suites were not run locally.
Scope
Repair content-continuity proof and add regressions against the real module. A candidate approach is to compare a base merge's actual product tree with its independently computed automatic merge result, rejecting conflicts/unprovable continuity, and to allow ordinary commits only when they do not alter accepted content. This is a recommendation, not a mandated implementation.
Generated-table-only changes need a narrowly checked exception: preserve legitimate docs/spec/IMPLEMENTATION_STATUS.md regeneration with its existing content-validation gate, rather than accepting arbitrary generated-file changes. Continue executing only trusted-base tooling; examine branch commits as data.
Non-goals
No transfer of verdict ownership, no automatic approval or merge, no weakening of required checks, no disabling safe base updates, no changes to economic specification. Do not treat matching titles, filenames, hunk counts, parent counts, or this lossy hash alone as sufficient evidence of continuity.
Acceptance criteria
- Moving the same removed/added lines from alpha to beta breaks verdict/handoff continuity.
- The same relocation embedded in a real two-parent base merge also breaks continuity.
- A benign base merge which merely shifts unchanged PR lines still preserves continuity when current gates are green.
- Generated-table-only regeneration remains supported only with truthful validation of that generated content.
- A certificate for changed content explicitly requires a current independent judgement and does not render an inherited-verdict claim.
- Tests import the real module and use real Git fixtures, including both refusing cases and positive controls; all existing policy tests remain green.
Verification
Add the fixtures under scripts/tests/test_head_evidence.py, run python -m unittest discover -s scripts/tests, and run the four required PR gates on the repaired head. The unchanged implementation must fail the relocation regressions while passing the benign-merge and changed-byte controls. Obtain independent review of the repair; this Issue does not itself revoke or replace any existing exact-head verdict.
Deduplication: searched current Issues for head_evidence and diff identity, and read completed #765. #765 records the original feature/contract, not this reproducible semantic-relocation failure. No matching open defect Issue was found.
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 0
- Avg merge
- 7h 23m
- Merged PRs (30d)
- 110
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from drevendev/trade_simulation
-
qa status:needs-triage
Difficulty 5/5 Over a week Newbie friendliness 8/100
drevendev/trade_simulation#926 ·
Maintainers usually reply within 1 day
-
area:visualization priority:high status:in-progress type:feature
Difficulty 5/5 Over a week Newbie friendliness 25/100
drevendev/trade_simulation#863 ·
Maintainers usually reply within 1 day
-
area:tooling priority:normal status:in-progress type:bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
drevendev/trade_simulation#829 · 1 comment ·
Maintainers usually reply within 1 day
-
M4 physical stock authority: exact tick overlay, owner-bucket mapping and migration performanceOpenarea:simulation-core priority:normal status:blocked type:feature
Difficulty 5/5 Over a week Newbie friendliness 25/100
drevendev/trade_simulation#800 ·
Maintainers usually reply within 1 day
-
area:market priority:high status:blocked type:feature
Difficulty 5/5 Over a week Newbie friendliness 24/100
drevendev/trade_simulation#799 ·
Maintainers usually reply within 1 day
All issues in drevendev/trade_simulation
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vercel-labs/durable-harness#53 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area/docs area/ui enhancement
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
melgarafael/DeskcommCRM#4098 ·
Maintainers usually reply within 1 day
-
bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kerti/balances-v2#801 ·
Maintainers usually reply within 1 day
-
lesson-submission pending-review
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Ikalus1988/MisakaNet#4510 ·
Maintainers usually reply within 1 day