Repository navigation
docs: note why the two body-strip helpers must not be unified - #770
Merged
Merged
Conversation
chain-preflight.ts:stripCodeAndComments and assess-collision-detect.ts:stripCodeBlocksAndComments are near-identical in name and body, differing only by an inline-code-span strip. They read as obvious DRY bait, but the divergence is required: the two modules have opposite requirements for the same syntax. A backticked marker in the pre-flight is a documentation example to discard; a backticked path in the collision detector is the entire signal, because PATH_REGEX only matches backtick-wrapped paths. Unifying them on the pre-flight's version silently kills path extraction: current: [ 'src/lib/foo.ts', 'bin/cli.ts' ] with inline-span strip: [] The detector's 15 tests would fail on that change, so this is a signpost, not a missing guard — it saves the next reader the round trip. Cross-references each function from the other. Comments only; no behavior change. Entire-Checkpoint: 1bebdf23da8b
This was referenced Jul 15, 2026
admarble
added a commit
that referenced
this pull request
Jul 16, 2026
QA follow-ups on the shared-parser extraction. 1. Moving `stripCodeAndComments` out of `chain-preflight.ts` stranded the cross-reference PR #770 added an hour earlier: `assess-collision-detect.ts` still warned "Do NOT unify this with `chain-preflight.ts:stripCodeAndComments`" — a function that no longer exists there. That note is the only guard against a silent-empty-set bug: unifying the two strip helpers deletes every path PATH_REGEX matches. A dev who follows the pointer, finds nothing, and concludes the note is stale is the exact failure #770 exists to prevent. Repointed to `dependency-markers.ts`. Moving a function has to carry its prose references, not just its call sites. 2. `stripCodeAndComments` was exported but has no consumer outside its module — it was private in `chain-preflight.ts`. An exported symbol implies a public API that #770's note is warning people away from. Restored to private. Swept for other stale references to the moved symbols: `BLOCKER_MARKER_REGEX` is gone everywhere, and the surviving `chain-preflight.ts:parseDeclaredBlockers` pointer is still accurate. Comment/visibility only — no behavior change. Build, lint clean; 48 files / 1092 tests pass.
admarble
added a commit
that referenced
this pull request
Jul 16, 2026
* fix(#767): harden parseDependencies; share body-marker parser parseDependencies matched its 'depends on' marker anywhere in an issue body with an optional #, so prose mentions, in-fence examples, and lines describing other issues parsed as real declarations — and sortByDependencies silently reordered the run on them. Extract the hardened pre-flight mechanics (line anchoring, required #, code/comment stripping) from chain-preflight.ts into a shared dependency-markers.ts parser, keeping the marker set per-caller: the pre-flight honors 'depends on' and 'blocked by'; the sorter honors only 'depends on' so it does not start reordering on 'blocked by'. Label parsing is untouched. Tests use the verbatim issue bodies from #767's evidence table. Closes #767 Entire-Checkpoint: 2255710168b5 * fix(#767): repoint #770's divergence note; unexport the strip helper QA follow-ups on the shared-parser extraction. 1. Moving `stripCodeAndComments` out of `chain-preflight.ts` stranded the cross-reference PR #770 added an hour earlier: `assess-collision-detect.ts` still warned "Do NOT unify this with `chain-preflight.ts:stripCodeAndComments`" — a function that no longer exists there. That note is the only guard against a silent-empty-set bug: unifying the two strip helpers deletes every path PATH_REGEX matches. A dev who follows the pointer, finds nothing, and concludes the note is stale is the exact failure #770 exists to prevent. Repointed to `dependency-markers.ts`. Moving a function has to carry its prose references, not just its call sites. 2. `stripCodeAndComments` was exported but has no consumer outside its module — it was private in `chain-preflight.ts`. An exported symbol implies a public API that #770's note is warning people away from. Restored to private. Swept for other stale references to the moved symbols: `BLOCKER_MARKER_REGEX` is gone everywhere, and the surviving `chain-preflight.ts:parseDeclaredBlockers` pointer is still accurate. Comment/visibility only — no behavior change. Build, lint clean; 48 files / 1092 tests pass.
admarble
added a commit
that referenced
this pull request
Sep 9, 2026
QA follow-ups on the shared-parser extraction. 1. Moving `stripCodeAndComments` out of `chain-preflight.ts` stranded the cross-reference PR #770 added an hour earlier: `assess-collision-detect.ts` still warned "Do NOT unify this with `chain-preflight.ts:stripCodeAndComments`" — a function that no longer exists there. That note is the only guard against a silent-empty-set bug: unifying the two strip helpers deletes every path PATH_REGEX matches. A dev who follows the pointer, finds nothing, and concludes the note is stale is the exact failure #770 exists to prevent. Repointed to `dependency-markers.ts`. Moving a function has to carry its prose references, not just its call sites. 2. `stripCodeAndComments` was exported but has no consumer outside its module — it was private in `chain-preflight.ts`. An exported symbol implies a public API that #770's note is warning people away from. Restored to private. Swept for other stale references to the moved symbols: `BLOCKER_MARKER_REGEX` is gone everywhere, and the surviving `chain-preflight.ts:parseDeclaredBlockers` pointer is still accurate. Comment/visibility only — no behavior change. Build, lint clean; 48 files / 1092 tests pass.
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.
Comments only — no behavior change.
chain-preflight.ts:stripCodeAndCommentsandassess-collision-detect.ts:stripCodeBlocksAndCommentsare near-identical in name and body, differing only by an inline-code-span strip. They read as obvious DRY bait. The divergence is required: the two modules have opposite requirements for the same syntax.PATH_REGEXonly matches backtick-wrapped paths → keep it.Unifying them on the pre-flight's version silently kills path extraction:
The detector's 15 tests would fail on that change, so this is a signpost rather than a missing guard — it saves the next reader the round trip. Each function now cross-references the other with the reason.
Came out of asking whether anything from #762 needed consolidating; this was the one candidate that looked consolidatable and specifically must not be.
Heads-up: the unmerged local branch
chore/chain-suggestion-annotationalso touchesassess-collision-detect.ts(formatCollisionAnnotations). Different function, so no conflict expected, but worth knowing if both land.