Skip to content

repo-fleet-hygiene:audit: display_value %q-escapes any non-ASCII value (empty kind counts render as $'\342\200\224') #4208

Closed

Description

@kyle-sexton

Problem

In the repository rollup, a repository with no findings shows:

Kind counts: $'\342\200\224'

The intended value is an em dash (—).

Cause

display_value in skills/audit/scripts/audit-fleet.sh (~line 137) sets LC_ALL=C and tests the value against ^[[:print:]]*$. In the C locale, every byte above 0x7F fails [[:print:]], so any non-ASCII value is %q-escaped. The escaping exists to stop control bytes from forging report lines. Multibyte UTF-8 is not a control byte.

This also affects real data. A path, branch name, or remote with non-ASCII characters (for example accented directory names) prints as an unreadable $'...' literal.

Fix

Add a test with a non-ASCII branch name and a repository with no findings.

Observed in repo-fleet-hygiene 0.23.29.

Activity

  1. added
    needs-triage
    on Sep 19, 2026
  2. added
    agent-ready
    status: ready
    and removed
    needs-triage
    on Sep 23, 2026
  3. added theissue type on Sep 23, 2026
  4. kyle-sexton commented on Sep 23, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Agent Brief

    Type: Bug
    Summary: Stop the fleet report's value-display formatting from %q-escaping ordinary non-ASCII (UTF-8 multibyte) values; escape only values that contain actual control bytes.

    Current behavior:
    The function that renders values into the fleet audit report tests each value against a printable-character class evaluated in a fixed byte-oriented locale. In that locale, every byte above the 7-bit ASCII range fails the printable test, so any value containing a multibyte UTF-8 character (an em dash, an accented letter, etc.) is rendered as a shell-quoted escape sequence instead of the readable character. This affects both a placeholder value shown when a repository has no findings (intended to display as a plain em dash) and any real report field containing non-ASCII text, such as a path or branch name with an accented character.

    Desired behavior:
    A value is escaped only when it contains an actual control character (the C0 control range and DEL). A value containing only printable non-ASCII UTF-8 bytes is rendered as-is, through the same path-normalization step every other value already gets, and is never escaped solely for containing valid multibyte UTF-8. The no-findings placeholder for a repository's finding-kind summary renders as a plain, readable value with no escape sequence.

    Key interfaces:

    • The report's value-display function must switch its escape trigger from a printable-character test evaluated in a byte-oriented locale to an explicit control-character test, so a value is escaped exactly when it contains bytes in the control range, and never solely because it contains valid multibyte UTF-8.

    Acceptance criteria:

    • Running the fleet audit over a repository with zero findings displays its finding-kind summary as a readable placeholder value with no shell-quoted escape sequence in the output.
    • Running the fleet audit over a repository whose branch name or path contains a non-ASCII UTF-8 character (for example, an accented letter) displays that value unescaped and readable in the report.
    • Running the fleet audit over a repository whose branch name or path contains an embedded control character (for example, a newline injected into a ref name) still displays that value escaped in the report, unchanged from current behavior.
    • A test exercising a non-ASCII branch name and a no-findings repository passes.

    Out of scope:

    • Any other report-formatting behavior (drive-letter path normalization, field labels, etc.) beyond the escape-trigger condition.
    • The broader project-wide stance on em dashes in prose elsewhere in the codebase; this issue is scoped to the report's own value rendering.
  5. added
    needs-owner-decision
    and removed
    status: ready
    agent-ready
    on Sep 29, 2026
  6. kyle-sexton commented on Sep 29, 2026

    @kyle-sexton
    MemberAuthor

    From the 2026-09-29 audit of the unattended Cursor run. The issue stays closed; this is a decision packet.

    What the audit found. The fix grew from the brief's one-line control test into a UTF-8 validator (PR #4634, audit-fleet.sh:158-204, utf8_printable): an RFC 3629 byte walk, Bidi_Control, U+2028/U+2029, and escaping of malformed bytes. The brief said to escape "exactly when it contains bytes in the control range" and listed other formatting as out of scope. Shipped in CHANGELOG 0.23.33.

    Owner decision needed.

    • Question: keep the wider validator, or reduce it to what the brief asked for?
    • Option A: keep the allowlist validator and record it on this issue as the accepted scope.
    • Option B: reduce to a control test that includes C1 and drop the bidi and malformed-byte escaping.
    • Recommendation: A. Basis: it blocks the terminal-control and bidi spoofing the brief warned about, and fix(repo-fleet-hygiene): keep UTF-8 printable in display_value (#4208) #4616's [[:cntrl:]] under LC_ALL=C shipped exactly that regression. This is security-adjacent, so the owner decides.
    • Unblocks: whether any display_value simplification is wanted.

    The fix branch (#5289, T7) records the C-locale limit either way. No code changes until this is answered. Added status: needs-decision.

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

    needs-owner-decision

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions