Skip to content

refactor(evidence): reuse stepTextContains for todo overlap, hoist bounds guard#4027

Merged
esengine merged 1 commit into
main-v2from
refactor/evidence-reuse-overlap
Jun 11, 2026
Merged

refactor(evidence): reuse stepTextContains for todo overlap, hoist bounds guard#4027
esengine merged 1 commit into
main-v2from
refactor/evidence-reuse-overlap

Conversation

@esengine

Copy link
Copy Markdown
Owner

Follow-up to #4013 (no behavior change; internal/evidence tests pass unchanged).

  • Reuse stepTextContains. textOverlaps was a verbatim copy of stepTextContains (fix(evidence): tolerate citation drift when matching complete_step to todos #4006) with normalization folded in. Replace its body with stepTextContains(normalizeStepText(a), normalizeStepText(b)) — drops ~15 duplicated lines.
  • Hoist the bounds guard. hasSuccessfulCompleteStepForTodo guarded index inline on the sameTodoMatch line but accessed current[index-1] unguarded in the new overlap branch. Move the index range check to the top of the block so both accesses share one guard.

…unds guard

textOverlaps duplicated stepTextContains verbatim — fold it into a normalize-then-contains one-liner. Hoist the index bounds check so both current[index-1] accesses share one guard instead of one inline and one bare. Follow-up to #4013; behavior unchanged (evidence tests pass).
@esengine esengine requested a review from SivanCola as a code owner June 11, 2026 11:13
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 11, 2026
@esengine esengine merged commit 2c6092e into main-v2 Jun 11, 2026
14 checks passed
@esengine esengine deleted the refactor/evidence-reuse-overlap branch June 11, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant