Repository navigation
fix(text): bound compactText for tiny caps - #576
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 10:23 PM ET / July 19, 2026, 02:23 UTC. Summary Reproducibility: yes. from source and the PR’s focused terminal proof: the previous small-cap branch appended a three-character ellipsis even when the cap was 0, 1, or 2. The supplied regression directly exercises the affected helper boundary. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the isolated tiny-cap guard and its regression coverage once the exact-head required checks complete successfully. Do we have a high-confidence way to reproduce the issue? Yes, from source and the PR’s focused terminal proof: the previous small-cap branch appended a three-character ellipsis even when the cap was 0, 1, or 2. The supplied regression directly exercises the affected helper boundary. Is this the best way to solve the issue? Yes. Returning a plain prefix when an ellipsis cannot fit preserves the documented cap invariant without introducing new configuration or changing normal truncation behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2bf58bdd858d. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (5 earlier review cycles)
|
Four internal string helpers violated their invariants on inputs outside their current call sites (all callers pass safe values, so these are latent, surfaced by property-testing with einsiedlerkrebs): - trimMiddle: maxLength < 120 made `edge` negative — slices read the wrong ends (`slice(-0)` returns the whole string) and the "truncated N" count exceeded the input length. Fall back to a simple head truncation. - compactText: maxLength <= 2 returned the bare "..." (length 3), overflowing the cap. Drop the ellipsis when there is no room for it. - slug: the length slice ran after the trailing-dash trim, so slicing on a "-" boundary re-introduced a trailing dash — not idempotent. Re-trim post-slice. - normalizeGitHubActor: stripped only one trailing [bot], leaving a residual on a doubled suffix — not idempotent. Strip all trailing [bot]. Adds regression + unregression tests for each. Closes openclaw#571 Closes openclaw#572 Closes openclaw#573 Closes openclaw#574
a3faecc to
f378710
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Thanks for the contribution. We are reviewing this together with #571, #572, #573, and #574. The recent stability incident means we are deliberately holding non-incident changes for careful maintainer review while we confirm the recovered review/publication path remains stable. The small helper fixes look separable, but the actor-normalisation portion needs deliberate checking against the mutation-authorisation boundary before we decide how to proceed. We will return with a concrete maintainer decision; no further branch changes are requested at present. |
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
* fix(text): harden string helpers against small/degenerate inputs Four internal string helpers violated their invariants on inputs outside their current call sites (all callers pass safe values, so these are latent, surfaced by property-testing with einsiedlerkrebs): - trimMiddle: maxLength < 120 made `edge` negative — slices read the wrong ends (`slice(-0)` returns the whole string) and the "truncated N" count exceeded the input length. Fall back to a simple head truncation. - compactText: maxLength <= 2 returned the bare "..." (length 3), overflowing the cap. Drop the ellipsis when there is no room for it. - slug: the length slice ran after the trailing-dash trim, so slicing on a "-" boundary re-introduced a trailing dash — not idempotent. Re-trim post-slice. - normalizeGitHubActor: stripped only one trailing [bot], leaving a residual on a doubled suffix — not idempotent. Strip all trailing [bot]. Adds regression + unregression tests for each. Closes openclaw#571 Closes openclaw#572 Closes openclaw#573 Closes openclaw#574 * test(repair): keep mutation actor matching fail-closed * test(text): pin helper boundary semantics * fix(text): narrow hardening to compact text bounds Co-authored-by: Cameron Beeley <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
Summary
compactText(value, maxLength)obey its maximum length for caps smaller than the three-character ellipsisProof
Built output on Node 26.5.0:
timeoutand the runtime packaging test does not resolve the compiler service under this local setupThanks @anagnorisis2peripeteia for the report, original fix, and boundary tests.
Closes #573.