Skip to content

Normalize review-thread position metadata across GitHub and GitLab #8174

Closed

Description

@csoceanu

Problem

PR #7907 exposes review-thread positions through shared line and original_line fields, but GitHub and GitLab assign different meanings to those values.

On GitHub:

  • originalLine is the line where the thread was originally created.
  • line can be null when the thread is outdated.
  • The relevant side of the diff requires diffSide, which is not currently fetched.

On GitLab:

  • line is populated from new_line.
  • original_line is populated from old_line.
  • A null new_line can represent a removed-line comment rather than an outdated thread.

Consequently, consumers cannot reliably match findings by path and line across both forges.

Context: #7907 (comment)

Expected behavior

Define an explicit, consistent position contract for review threads across supported forges. The model should preserve enough information to distinguish:

  • old-side and new-side positions;
  • outdated GitHub threads;
  • removed-line GitLab discussions; and
  • multi-line positions, if supported.

This may require fields such as diff side, outdated status, old line, new line, and start line rather than overloading line and original_line.

Acceptance criteria

  • The review-thread model clearly defines each position field.
  • GitHub fetching includes the required side and outdated metadata.
  • GitLab old-line and new-line positions are represented without changing their meaning.
  • JSON output documentation explains the normalized contract.
  • Tests cover a GitHub old-side thread, a GitHub outdated thread, a GitLab discussion containing both old and new line positions, and a GitLab removed-line discussion.
  • Existing consumers either remain compatible or receive a documented migration path.

Relationship to #7907

This is non-blocking follow-up work from #7907. It should be resolved before the agents-side consumer relies on path-and-line matching across forges.

Activity

  1. csoceanu commented on Oct 20, 2026

    @csoceanu
    ContributorAuthor

    /fs-triage Please reassess this issue against current Fullsend main and the agents repository.

    This issue was opened from the review of fullsend#7907. PR #7907 introduced the shared review-thread model and GitHub/GitLab review-thread fetching. However, its normalized position model still does not distinguish GitHub diff-side and outdated-thread metadata from GitLab old-line, new-line, and removed-line semantics.

    Please verify whether the current Fullsend implementation still lacks:

    • GitHub diff-side and outdated metadata;
    • explicit old-side/new-side fields;
    • multi-line position support;
    • tests and documentation for the normalized contract.

    For context, agents#1635 consumes this review-thread data, and the current agents dismissal logic matches human dismissals using exact finding IDs from trusted review-bot comments rather than path/line fallback.

    Please assess whether fullsend#8174 is still relevant and actionable against the current upstream main branches. Also explain how it relates to the agents consumer and whether it remains a separate Fullsend-side follow-up for other forge consumers.

  2. fullsend-ai-triage commented on Oct 20, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 1:03 PM UTC · Completed 1:05 PM UTC

    Commit: c299191 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.19

  3. added
    feature
    triaged
    on Oct 20, 2026
  4. fullsend-ai-triage commented on Oct 20, 2026

    @fullsend-ai-triage

    Reassessed against current main: this is still relevant and actionable, and no PR is in flight for it.

    What changed with the maintainer comment

    • The earlier suggestion to keep line/original_line as legacy fields is superseded. Since the model is only a couple of weeks old, the contract can replace those names outright rather than add fields beside them. Existing in-repo consumers and the fake client need updating in the same change, and the agents-side forwarding of these fields should get a short migration note.
    • On GitLab, is_outdated should be null/unknown rather than false. GitLab's position data does not report outdated state, and a null new_line only means a removed-line discussion. The contract should say this explicitly, which in Go implies a nullable boolean.

    Still-open gaps (re-verified)
    The thread struct has no side, outdated, or start-line fields. The GitHub query does not fetch side, outdated, or start-line metadata. The GitLab fetcher ignores line_range. The CLI internals doc has no position contract. These match the four gaps you listed.

    Useful reference
    The normative entity-context snapshot reviews schema already uses side (left/right), start_line, original_line, original_start_line and original_side. Aligning the normalized names with that vocabulary would avoid inventing a second one.

    Relationship to the agents consumer
    The agents dismissal logic matches by trusted finding IDs, not path/line, so it is not broken today. This remains a separate Fullsend-side follow-up that should land before anyone relies on cross-forge path-and-line matching, and it covers any other consumer of fetch-review-threads.

    Proposed test cases

    GitHub: LEFT-side thread; outdated thread (line=null, isOutdated=true); multi-line thread
    GitLab: discussion with old_line and new_line; removed-line discussion (new_line=null, is_outdated=null); line_range multi-line
    All: JSON field names match the documented contract; is_outdated is null on GitLab
    

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
    Previous run

    Reassessed against current main: this is still relevant and actionable, and nothing is in flight for it.

    What the code shows today

    • forge.ReviewThread still has only line and original_line.
    • The GitHub GraphQL query does not fetch diffSide, isOutdated, startLine, originalStartLine or startDiffSide.
    • The GitLab fetcher puts new_line in line and old_line in original_line, and ignores line_range. A removed-line discussion therefore has a null line, which looks like a GitHub outdated thread even though it means something else.
    • docs/guides/dev/cli-internals.md documents role semantics but gives no position contract.

    So all four gaps you listed (diff side and outdated metadata, explicit old/new fields, multi-line, tests and docs) are still open.

    Relationship to the agents consumer
    The agents dismissal logic forwards path, line and original_line but matches human dismissals by trusted finding IDs, not by path and line. It is therefore not broken today and does not need this fix. This stays a separate Fullsend-side follow-up. It should land before anyone relies on cross-forge path-and-line matching, and it also covers any other consumer of fetch-review-threads. It is separate from the role-provenance follow-up tracked in #8173.

    Suggested approach
    Make the change additive. Keep line and original_line with documented legacy semantics, and add normalized fields for diff side, outdated state, old/new line and start line. Describe each field in the struct comments and in the CLI internals doc. One question for maintainers: GitLab's position data does not show whether a discussion is outdated, so the contract should say whether is_outdated is unknown or false on GitLab.

    Proposed test cases

    GitHub: old-side (LEFT) thread; outdated thread (line=null, isOutdated=true); multi-line thread
    GitLab: discussion with both old_line and new_line; removed-line discussion (new_line=null)
    All: legacy line/original_line values and JSON names unchanged; new fields present in CLI output
    

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  5. csoceanu commented on Oct 20, 2026

    @csoceanu
    ContributorAuthor

    @fullsend-ai/core Could you confirm the intended normalized contract for GitLab’s is_outdated field?

    GitHub exposes an explicit isOutdated value, but GitLab’s Discussions API represents positions using old_line, new_line, and line_range. GitLab uses old_line without new_line for removed-line discussions, so new_line: null should not automatically be interpreted as “outdated.”

    Should the normalized is_outdated field therefore be null/unknown on GitLab rather than false?

  6. rh-hemartin commented on Oct 21, 2026

    @rh-hemartin
    Member

    I don't think we need to retain legacy names, this is just a week old if I recall correctly. Edit: well, maybe two

    And I think it should be null/unknown on GitLab yes, we can't say it is true/false as the GitLab API does not know either if I understood correctly.

  7. csoceanu commented on Oct 22, 2026

    @csoceanu
    ContributorAuthor

    /fs-triage Please incorporate @rh-hemartin’s latest comment into the reassessment and confirm whether this issue remains relevant and actionable.

  8. fullsend-ai-triage commented on Oct 22, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 7:52 AM UTC · Completed 7:54 AM UTC

    Commit: 35c8bf8 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.21

  9. added
    ready-to-code
    and removed
    feature
    triaged
    on Oct 22, 2026
  10. fullsend-ai-coder commented on Oct 22, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 7:56 AM UTC · Completed 8:12 AM UTC

    Commit: 35c8bf8 · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $2.07

  11. added a commit that references this issue on Oct 22, 2026
  12. added 2 commits that reference this issue on Oct 29, 2026
  13. self-assigned this
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugready-to-code

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions