Skip to content

fix(import,web): imported items keep their authors, dates, threads, verdicts and diffs (FG-6) - #147

Merged
PastaPastaPasta merged 8 commits into
masterfrom
fix/import-fidelity-fg6
Sep 29, 2026
Merged

PastaPastaPasta merged 8 commits into
masterfrom
fix/import-fidelity-fg6

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Summary

FG-6 (imported data fidelity) from the dash-ux QA sweep: L-04, L-05, L-06, L-36, L-37, L-45, L-46, L-74, L-76 (dash-forge-qa/evidence/dash-ux/LEDGER.md). This PR changes no contracts. Where the schema has no field, the importer writes a provenance line into the body or notes, and the web reads it. The web believes that line, and any imported record, only when the document's signer is the repo owner or a current maintainer (trustedOrigin, the same trust set as the mirror note and issue numbering). The proper fields are proposed for the fresh registration in docs/design/release-asset-manifest.md §4: release.imported, and imported.baseOid/headLabel on PRs.

Finding Fix
L-04 Imported items show the mirror identity and the import time Lists, detail pages, timeline comments, reviews, inline line comments and replies show @author on github.com. The author is plain text, never a Forge profile link (L-38). They also show the original date in a <time> element with the exact time on hover, plus a mirrored tag. Releases open their notes with > Published on github.com by @x on YYYY-MM-DD, and the release card and rail show that date.
L-05 Threads drop most comments (1 of 24 on dash#6935) An item whose source comment count exceeds what the since window returned is re-read in full. A PR whose detail review_comments count exceeds the window's line comments is re-read too.
L-06 / L-74 Text cut mid-word, mid-code, with no marker on release notes fit_text cuts at a paragraph, line or word boundary and closes open code: ``` and ~~~ fences of any length, N-backtick spans, and escaped backticks. A note links the full text on bodies and release notes.
L-36 A merged imported PR's diff is "unavailable" The PR body records the source base (> Base <oid> · head …). The web tries it first as a merge-base candidate. GitHub's base.sha is the branch tip, so the merge base is taken, not the raw tip. Otherwise it falls back to the head's parent with a note and a link to the source diff, never an error. GitLab re-reads merged and closed MRs once for diff_refs.base_sha.
L-37 A fork PR shows no head branch The header shows the source head label (owner:branch), in preference to the mirror's refs/mirror/pull/N/head.
L-45 "approved" is contradicted by "No maintainer has approved" A mirrored review shows its source verdict as a badge: approved on github.com · not counted here. The document's own verdict stays a comment, so a mirror identity's approval never counts as a maintainer's.
L-46 "closed this" appears before the comments that preceded it Comments and reviews are written before close and merge events. A refused comment still lets the state be written (state_after).
L-76 A closed PR "wants to merge" It says "wanted to merge".

Live proof (moutai, 1.556 DASH of the 2 DASH cap; moutai-disk 78.5%)

The mirror is sharkdp/fd, imported into a fresh repo (fd-fg6-2f5ead2d): code, releases and labels, then issues and PRs with a 30-day --state window. I checked it in a browser on a local build of this branch, with the build SHA verified. Screenshots are in dash-forge-qa/evidence/impl/fix-import-fidelity-fg6/.

  • #2039 (merged, fork, 7 + 11 comments at the source):
    • all 18 comments shown, with the original authors and dates;
    • the header reads "from hexbinoct:fix/min-depth-broken-symlink";
    • verdict badges read "requested changes / approved on github.com · not counted here";
    • Files changed shows 5 files, +247 −28, compared from the source base.
  • feat(web): syntax and word highlighting in diffs, visible dark tints, collapsed commit bodies #362: all 48 comments shown.
  • #2132 (closed): "@jabrailkhalil on github.com wanted to merge into master from jabrailkhalil:fix/sanitize-error-messages".
  • Releases: "Published 1mo ago on github.com by @tmccombs · mirrored by …".

Tests

  • Rust:
    • boundary cuts and code closing (every_kind_of_open_code_is_closed);
    • release publisher line, including undated;
    • PR origin line;
    • full thread re-read (an_item_whose_window_missed_comments_is_read_in_full);
    • GitLab diff_refs and fork detection;
    • the state-after-thread order (state_follows_the_thread_even_past_a_refused_comment).
  • Web:
    • provenance parsers and the trust gate;
    • Byline and date-only times;
    • loadPullComparison: the source base as a merge-base candidate (the moved-tip case, with no revert of base-branch changes; this test fails on the old code), and the parent fallback for imported PRs.
  • Checks: cargo clippy --workspace --all-targets -D warnings, cargo test -p forge-import -p forge-core -p dg, vitest (2,800+), tsc and eslint are all green.

Reviews

  • code-simplifier: findings applied. They include one real bug: fork detection was case-sensitive.
  • code-review-validator: HIGH and other findings addressed in cd34dd57/fc72f748: merge-base from the source base, GitLab diff_refs, the state after an item error, date-only release times, close_code robustness, and more. Item 11 was left as is on purpose; the wipe makes it moot.

A re-import applies this to existing mirrors. The showcase will be re-imported after the wipe, not before.

🤖 Generated with Claude Code

PastaPastaPasta and others added 7 commits September 29, 2026 08:57
…ase and fork head, thread before state (FG-6 WIP)

An item whose source comment count is more than the since window returned is read in full (L-05). Long bodies and release notes are cut at a paragraph, line or word boundary, open code is closed, and a note links the full text (L-06, L-74). Release notes open with who published it and when (L-04). A mirrored PR's body names its base commit and a fork's head branch (L-36, L-37). Comments and reviews are written before the close or merge that followed them (L-46).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…se and head (FG-6 WIP)

A trusted mirror's imported issue, PR, comment and review show the original author as text and the original date, tagged mirrored (L-04). Reviews show their source verdict as not counted here (L-45). A closed PR says wanted to merge (L-76), and a mirrored PR names its fork head (L-37) and is diffed from the base commit its source recorded, else its head's parent with a note, never an error (L-36). Releases show who published them and when.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…-6 notes line until then

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
One pass closes code, a match builds the PR origin line, full_thread serves both thread paths, fork detection is case-insensitive, Byline and ItemAuthor share one author choice, pullSpec takes the parsed base, and the timeline's comment verb and review provenance read plainly.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ance quote

The browser QA on the fd mirror showed the origin line folded into the provenance sentence. An empty quote line now separates them, and the web reader accepts either form.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Imported PRs are diffed from the merge base of the source's recorded base and the head (GitHub's base.sha is the branch tip, not the merge base), and a stopped or failed search falls back like any PR, with a link to the source diff. GitLab reads merged and closed MRs once more for diff_refs, and a fork needs both project ids to differ. A refused comment no longer skips the state. An imported PR's source head label beats the mirror ref. Undated releases write no line. close_code handles ~~~ and long fences, double-backtick spans and escaped backticks. PRs whose line comments outnumber the window are read in full, and imported line comments and replies show the original author.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c9d13fdb-08cd-48b6-a58a-c2ee807f18f9

📥 Commits

Reviewing files that changed from the base of the PR and between 24eb0f5 and bb32542.

📒 Files selected for processing (31)
  • crates/forge-import/src/github.rs
  • crates/forge-import/src/gitlab.rs
  • crates/forge-import/src/model.rs
  • crates/forge-import/src/sink.rs
  • crates/forge-import/src/source_github.rs
  • crates/forge-import/src/source_gitlab.rs
  • crates/forge-import/src/source_gitlab_tests.rs
  • docs/design/release-asset-manifest.md
  • forge-web/components/repo/byline.test.tsx
  • forge-web/components/repo/byline.tsx
  • forge-web/components/repo/inline-comments.tsx
  • forge-web/components/repo/issue-content.tsx
  • forge-web/components/repo/issues-content.tsx
  • forge-web/components/repo/new-pull-content.tsx
  • forge-web/components/repo/pull-content.tsx
  • forge-web/components/repo/pull-diff.tsx
  • forge-web/components/repo/pulls-content.tsx
  • forge-web/components/repo/releases-content.tsx
  • forge-web/components/repo/repo-rail.tsx
  • forge-web/components/repo/timeline.tsx
  • forge-web/hooks/use-mirror-trust.ts
  • forge-web/lib/design/contrast.test.ts
  • forge-web/lib/repo/issues.ts
  • forge-web/lib/repo/new-release-carry.test.ts
  • forge-web/lib/repo/provenance.test.ts
  • forge-web/lib/repo/provenance.ts
  • forge-web/lib/repo/releases.test.ts
  • forge-web/lib/repo/releases.ts
  • forge-web/lib/view/issues-view.ts
  • forge-web/lib/view/pull-diff.test.ts
  • forge-web/lib/view/pull-diff.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…tever its fence

The closer for a long fence or span run could exceed the 5 bytes reserved, and the text overflowed the 5120-byte field: the write refused, the item skipped and the cursor stuck. The cut now shrinks until text, closer and note fit, with a test for fences and spans of 3 to 200. Also removes the unreachable search-stopped branch and a stale comment (review).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PastaPastaPasta
PastaPastaPasta merged commit 167bf65 into master Sep 29, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant