Skip to content

review: preserve finding IDs across shifted lines and never reuse them for different findings #1818

Closed

Description

@csoceanu

What happened

On #1792, re-reviews exposed two finding-ID integrity bugs.

1. The same finding received a new ID

The score_field wiring finding in docs/prioritize.md was initially recorded as:

  • f_522c6032780cda57

It was incorrectly marked resolved_by_change using unrelated evidence (“Token example updated”). When the same underlying finding appeared again after its line shifted, it received a new ID:

  • f_63302131e40e81c0

This caused an unchanged finding to be posted again as new.

2. An existing ID was reused for a different finding

f_2034ca010b83e889 initially referred to the unnecessary actions: write permission on GITHUB_TOKEN.

A later review reused that ID for a different token-permission finding concerning the project-reading token.

A finding ID must identify one finding for the lifetime of the PR. Reusing it for a different concern can attach dispositions and human resolutions to the wrong finding.

Relevant review runs:

Expected behavior

  • A finding represented by an existing stamped GitHub review thread keeps that thread’s finding ID when its line moves.
  • A finding ID is never transferred to a different finding.
  • If an existing thread cannot be mapped reliably, mint a new ID instead of guessing.
  • Do not match an old ID merely because it is the only finding with the same category in the same file.

Proposed change

Implement this in the agents post-review path, building on #1608.

For GitHub, reuse the review-thread fetch that post-review already performs. Treat the <!-- finding:f_… --> stamp on the existing inline thread as the authoritative mapping between the thread and its finding ID.

When reconciling current findings:

  1. Preserve the stamped ID when GitHub maps the finding to the existing thread, including after line movement or a force-push.
  2. Do not reuse an ID based only on file and category.
  3. If no existing stamped thread can be mapped, mint a new ID.
  4. Start with GitHub support.
  5. For GitLab, if the existing thread’s line cannot be mapped reliably, fail closed by minting a new ID.

This should be an agents-only change; no fullsend change is required.

Validation

Add post-review tests covering:

  1. A stamped GitHub thread whose line shifts retains its ID.
  2. The old and new locations are not both emitted as active findings.
  3. A different finding in the same file and category does not inherit the old ID.
  4. An unmappable GitLab thread results in a new ID.
  5. Existing dismissed_by_human, resolved_by_change, and reclassified dispositions remain attached to the correct finding.

Related

Activity

  1. Benkapner commented on Oct 28, 2026

    @Benkapner
    Member

    /fs-triage This is one bug in the finding-id ledger from #1608. Motivating example: #1792.

    check:

  2. added
    fullsend-no-fix
    on Oct 28, 2026
  3. fullsend-ai-triage commented on Oct 28, 2026

    @fullsend-ai-triage

    🤖 Triage · ⚠️ Cancelled · Ended 9:47 AM UTC

    Commit: 16657d5 · View workflow run →

  4. fullsend-ai-triage commented on Oct 28, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 9:49 AM UTC · Completed 9:51 AM UTC

    Commit: 16657d5 · View workflow run →

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

  5. removed
    fullsend-no-fix
    on Oct 28, 2026
  6. added
    bug
    ready-to-code
    on Oct 28, 2026
  7. fullsend-ai-triage commented on Oct 28, 2026

    @fullsend-ai-triage

    Triage found this actionable as a single issue: it is not a duplicate and has no blocking dependency.

    Related work (checked):

    Where the fix lives (verified in this repo): the id assignment and reconciliation logic is in scripts/post-review.src.sh, which generates scripts/post-review.sh. The thread fetch and stamp parsing are in scripts/lib/github-review-ops.lib.sh, with the GitLab counterpart in scripts/lib/gitlab-review-ops.lib.sh. Tests belong in scripts/post-review-test.sh.

    Scope: as requested, items listed as out of scope (#1760, dismissed_by_human/#1710, re-review low gate, hide-ids, any fullsend change) are excluded.

    Proposed test case:

    1. Stamped GitHub thread, line shifts after a push -> finding keeps the stamped id.
    2. Old and new locations are not both emitted as active findings.
    3. Different finding, same file and category -> gets a new id, not the old one.
    4. GitLab thread whose line cannot be mapped -> new id (fail closed).
    5. dismissed_by_human / resolved_by_change / reclassified dispositions stay attached to the correct finding.
    

    Note: the request asked that this not be auto-promoted to ready-to-code. This triage run is in the harness's mechanical auto-promote mode, which the triage output cannot override, so a maintainer may want to check the labels afterward.


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  8. removed
    ready-to-code
    on Oct 28, 2026
  9. fullsend-ai-coder commented on Oct 28, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Code · ⚠️ Cancelled · Started 9:53 AM UTC · Ended 9:55 AM UTC

    Commit: 16657d5 · View workflow run →

  10. Benkapner commented on Oct 28, 2026

    @Benkapner
    Member

    /fs-code Implement this issue only. Motivating example is #1792; do not edit that PR.

    Do this in fullsend-ai/agents:

    • Identity only, in scripts/post-review.src.sh, the bundled scripts/post-review.sh, and scripts/post-review-test.sh.
    • Reuse the existing GitHub stamped-thread fetch (<!-- finding:f_… -->). Refresh file/line from that map before id copy or mint.
    • A stamped GitHub thread keeps its f_ id when the line moves (push or force-push).
    • Never move an id onto a different finding.
    • Do not copy an id just because it is the only prior finding with that file and category.
    • If GitHub cannot map the stamp, mint a new id.
    • Do not mark a mapped finding resolved_by_change from unrelated evidence.
    • GitLab: if the thread line cannot be mapped, mint. Fail closed. Do not add GitLab mapping.
    • Regenerated scripts/post-review.sh must stay in sync (make scripts/post-review.sh).

    Tests in scripts/post-review-test.sh:

    1. Stamped GitHub thread, line shifts: keeps f_old.
    2. Old and new locations are not both emitted as active findings.
    3. Different finding, same file and category: new id, does not inherit f_old.
    4. Unmappable GitLab thread: new id.
    5. dismissed_by_human, resolved_by_change, and reclassified stay on the correct id.
    6. Model tries to close a mapped still-present concern with unrelated evidence: host keeps that id open and does not remint.

    Do not:

    If a coder PR from ready-to-code is already open for this issue, update that branch. Do not open a second PR.

  11. fullsend-ai-coder commented on Oct 28, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ⚠️ Cancelled · Started 9:53 AM UTC · Completed 9:55 AM UTC

    Commit: 16657d5 · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high

  12. fullsend-ai-coder commented on Oct 28, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 9:57 AM UTC · Completed 10:11 AM UTC

    Commit: 16657d5 · View workflow run →

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

  13. added a commit that references this issue on Nov 2, 2026
  14. added a commit that references this issue on Nov 2, 2026
  15. added a commit that references this issue on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions