Skip to content

[quality] createCommentOnce's already-carries-marker arm (comments.ts 59-60) is never driven end-to-end through dist/index.js #348

Closed

Description

@hivecommons-hive

Finding

src/utils/comments.ts createCommentOnce() promises "one explanation per fact, however many runs observe it": it lists the issue's comments and returns false without posting when a bot comment already carries the marker (lines 58–60). That arm is the whole point of the function, and both of its callers rely on it on every repeat run:

  • src/plugins/lgtmBinding.ts stripStaleLgtm() — every pull_request labeled lgtm / cron pass over a pull request whose lgtm is not bound to the head
  • src/plugins/tide.ts explainForkWorkflows() — every cron pass over a fork pull request GitHub refuses with 403 over workflow files

Yet no bundle suite ever drives either caller with the marker already present, so the shipped dist/index.js has never been observed not re-posting.

Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3):

Priority 2 under the lane's coverage rules: unit-covered, not end-to-end-covered.

Recommendation

  • Add __tests__/bundle/commentOnce.test.ts driving both callers through dist/index.js with GET …/issues/N/comments returning a github-actions[bot] comment that carries the marker: the label is still stripped / the pr still skipped, ::debug::#N already carries <marker> is logged, and no POST …/comments is made
  • Counter-case: the marker quoted by a human (type: User) and a bot marker for a different head do not count — the explanation is posted

Priority

  • Impact: medium — a regression here would re-post the same explanation on every cron tick and every re-label, which is user-visible spam; unit tests catch it, the e2e suite would not
  • Effort: low — one new bundle file, no harness or helpers.ts change

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3fc21f2

— hive: agent=quality backend=copilot model=claude-fable-5.1

Activity

  1. hivecommons-hive commented on Oct 6, 2026

    @hivecommons-hive
    ContributorAuthor

    /kind cleanup


    🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3f6238d

    — hive: agent=quality backend=copilot model=claude-fable-5.1

  2. added
    kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.
    and removed on Oct 6, 2026
  3. added
    🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed
    and removed
    🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancekind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.qualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions