fix: [ENG-2676] strip derived-artifact paths from related: frontmatter#618
fix: [ENG-2676] strip derived-artifact paths from related: frontmatter#618bao-byterover merged 3 commits intomainfrom
Conversation
`*.abstract.md` and `*.overview.md` (and other derived artifacts) are excluded from the push payload via isExcludedFromSync(). When they landed in a doc's `related:` field, the parent doc shipped to remote with dangling references to siblings that were never sent. Two write paths could produce them; both now filter: - consolidate.ts `addRelatedLinks` (dream's CROSS_REFERENCE) filters incoming AND pre-existing entries, so each touch opportunistically cleans up legacy dangling refs. - curate-tool.ts `filterValidFiles` drops excluded paths from `relations` before MarkdownWriter writes them — covers both ADD and UPDATE since both call sites share the helper. Pre-existing dangling refs in untouched docs are out of scope; a separate migration can scrub them.
|
Claude finished @cuongdo-byterover's task in 3m 45s —— View job PR Review — fix: [ENG-2676] strip derived-artifact paths from related: frontmatterScore: 3/5 — solid, well-scoped fix on the dream/CROSS_REFERENCE side, with one meaningful gap on the curate side that contradicts the PR description.
What's good
What's missing or worth tightening
Out of scope (correctly noted in PR body)Pre-existing dangling refs in untouched docs — agreed, separate migration. The current PR's opportunistic cleanup on dream's CROSS_REFERENCE is a nice middle ground. · branch |
… UPDATE PR #618 review flagged that the curate UPDATE path could still leak derived-artifact entries into `related:` because `existingParsed.relations` flowed unfiltered into both `detectStructuralLoss` (false-positive `lostRelations`, bumping impact to high) and `resolveStructuralLoss` (union-merging the legacy bad data back into the final write). Filter `existingParsed.relations` through isExcludedFromSync immediately after parse so all downstream conflict logic sees a clean view. Adds an UPDATE-path test that pre-seeds a stale `.abstract.md` entry and asserts it is stripped. Also fixes the reviewer nit on consolidate.ts:681 — early-return when `incoming` is empty and there's no existing frontmatter, so we don't wrap an otherwise-clean file in `---\nrelated: []\n---\n`.
|
Claude finished @cuongdo-byterover's task in 3m 8s —— View job PR Review — fix: [ENG-2676] strip derived-artifact paths from related: frontmatterScore: 4/5 — solid follow-up from 3/5. The blocking UPDATE structural-loss leak is properly fixed; new test locks in the regression-prevention. Remaining items are non-blocking refinements.
What's good
What's worth tightening (all non-blocking)
Out of scope (correctly noted in PR body)Pre-existing dangling refs in untouched docs — agreed, separate migration. The opportunistic-cleanup-on-touch behavior is the right middle ground. Verification not done
· branch |
Round 2 of review-driven cleanup. None blocking, all small. - Filter executeCrossReference target files: skip derived-artifact paths in `action.files` so addRelatedLinks never writes `related:` onto a `.abstract.md` / `.overview.md` if the LLM ever proposes one. - addRelatedLinks: don't introduce `related: []` into a file whose frontmatter never had the key, when the merged set is empty. - Tighten existingParsed.relations guard from truthy to length-aware so the no-op filter is actually skipped on empty arrays. - UPDATE relations test: assert `impact === 'low'` to lock in the no-false-positive structural-loss-elevation invariant. Also retains the legitimate sibling in proposed so the only "lost" entry would be the filtered derived one — the assertion now genuinely exercises the filter's effect on conflict-detector counting.
|
Claude finished @cuongdo-byterover's task in 2m 32s —— View job PR Review — fix: [ENG-2676] strip derived-artifact paths from related: frontmatterScore: 5/5 — Final round addresses all 4 non-blocking items from the prior review cleanly. Up from 4/5 → ship-ready.
What's good in this round
Minor observations (defer-able, won't block)
Verification not done
SummaryThis is the right shape of follow-up: surgical, scoped, and each change traceable to a specific review item. The blocking issue from review #1 stays fixed (verified |
RyanNg1403
left a comment
There was a problem hiding this comment.
E2E verified on a paid-tier project: brv curate writes clean related: despite *.abstract.md / *.overview.md siblings on disk, and brv dream CROSS_REFERENCE strips both incoming AND pre-existing derived-artifact entries on every touched doc — fix works.
*.abstract.mdand*.overview.md(and other derived artifacts) are excluded from the push payload via isExcludedFromSync(). When they landed in a doc'srelated:field, the parent doc shipped to remote with dangling references to siblings that were never sent.Two write paths could produce them; both now filter:
addRelatedLinks(dream's CROSS_REFERENCE) filters incoming AND pre-existing entries, so each touch opportunistically cleans up legacy dangling refs.filterValidFilesdrops excluded paths fromrelationsbefore MarkdownWriter writes them — covers both ADD and UPDATE since both call sites share the helper.Pre-existing dangling refs in untouched docs are out of scope; a separate migration can scrub them.
Summary
Type of change
Scope (select all touched areas)
Linked issues
Root cause (bug fixes only, otherwise write
N/A)Test plan
User-visible changes
List user-visible changes (including defaults, config, or CLI output).
If none, write
None.Evidence
Attach at least one:
Checklist
npm test)npm run lint)npm run typecheck)npm run build)mainRisks and mitigations
List real risks for this PR. If none, write
None.