Skip to content

compactText: overflows maxLength for small caps (returns bare '...') #573

Closed

Description

@anagnorisis2peripeteia

compactText(value, maxLength) in src/repair/text-utils.ts:1: for maxLength in 0..2 the small-cap branch returns slice(0, max(0, maxLength-3)) + '...' = just '...' (length 3), which exceeds the requested cap.

Repro:

compactText("hello world", 2) === "..."   // length 3 > maxLength 2

Invariant: compactText(s, n).length <= n. Clamp the ellipsis to fit, or floor the cap.

Activity

  1. clawsweeper commented on Jul 15, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 18, 2026, 8:36 PM ET / July 19, 2026, 00:36 UTC.

    Summary
    This issue should remain open because the same-author implementation candidate at #576 explicitly covers the reported compactText cap invariant, is still open, and recent human discussion says the issue and PR should be reviewed together before a decision.

    Reproducibility: no. not for the exact current-main SHA at high confidence. The issue gives a precise helper call and the linked PR records the failing before-result on an earlier main revision, so the behavior is source-reproducible but should be rechecked during PR review.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Include the exact command, prompt, or workflow that triggered it.
    • Add expected vs actual behavior.

    Next step
    Do not dispatch another repair: #576 already owns the exact implementation path and is awaiting the requested joint maintainer review.

    Review details

    Best possible solution:

    Review #576 as the single focused fix, verify its small-cap regression coverage against current main, and let the issue close through the merged PR once the patch is accepted.

    Do we have a high-confidence way to reproduce the issue?

    No, not for the exact current-main SHA at high confidence. The issue gives a precise helper call and the linked PR records the failing before-result on an earlier main revision, so the behavior is source-reproducible but should be rechecked during PR review.

    Is this the best way to solve the issue?

    Yes, conditionally: the linked PR’s narrow compactText boundary fix directly preserves the stated length invariant, and it is preferable to opening a duplicate repair path while that PR is under joint review.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    Codex review notes: model internal, reasoning high; reviewed against 3e090f0bca0a.

    Label changes

    Label justifications:

    • P3: This is a bounded internal helper edge case with no evidence that existing production call sites currently pass unsafe caps.
    Evidence reviewed

    What I checked:

    • Open linked fix candidate: The issue timeline cross-references fix(text): bound compactText for tiny caps #576, whose body explicitly states that compactText omits the ellipsis when it cannot fit and declares that it closes this issue. (src/repair/text-utils.ts, f37871086e40)
    • Current review direction: The July 16, 2026 comment from brokemac79 confirms this is separate from the prior stability incident and asks that the report and its linked implementation be reviewed together in the next maintenance pass.
    • Current-main status is not proven fixed: The linked PR remains open and unmerged; its before/after proof references an earlier main revision, so there is no source-and-history provenance establishing that current main SHA 3e090f0 already contains this exact fix. (src/repair/text-utils.ts, 3e090f0bca0a)

    Likely related people:

    • brokemac79: Provided the current human direction to review this report together with the linked implementation candidate before deciding it. (role: recent issue reviewer; confidence: medium; files: src/repair/text-utils.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P3
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    on Jul 15, 2026
  3. added a commit that references this issue on Jul 15, 2026
    37c14fb
  4. brokemac79 commented on Jul 16, 2026

    @brokemac79
    Contributor

    Thanks for the report. We?ve confirmed this is separate from the recent ClawSweeper review/publication stability incident.

    Our immediate priority is keeping the recovered path stable and completing a careful maintainer review of outstanding changes. We will review this report and its linked implementation together in the next maintenance pass, then leave a specific decision here.

    Please do not treat this as a request for further changes at present.

  5. added
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    on Jul 17, 2026
  6. brokemac79 commented on Jul 18, 2026

    @brokemac79
    Contributor

    @clawsweeper re-review

  7. clawsweeper commented on Jul 18, 2026

    @clawsweeper
    Contributor

    🦞🧹
    ClawSweeper re-review requested.

    I asked ClawSweeper to review this item again.
    Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
    Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

    Re-review progress:

  8. added
    issue-rating: 🐚 platinum hermit
    clawsweeper:needs-live-repro
    and removed
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    on Jul 18, 2026
  9. anagnorisis2peripeteia commented on Jul 19, 2026

    @anagnorisis2peripeteia
    ContributorAuthor

    @clawsweeper re-review

  10. added a commit that references this issue on Jul 19, 2026
    f8d5393
  11. steipete commented on Jul 19, 2026

    @steipete
    Contributor

    Fixed on main by #576 at merge commit f8d5393.

    Proof on exact PR head 2078564ff6650d040c2899cc2cefbef46d1eccd5:

    Thanks @anagnorisis2peripeteia for the clear reproduction and original patch.

  12. added a commit that references this issue on Sep 21, 2026
    38ddba6
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

    P3clawsweeper:linked-pr-openclawsweeper:needs-live-reproclawsweeper:no-new-fix-prissue-rating: 🐚 platinum hermit

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions