Skip to content

ci: check-skill-portability.sh's awk operand shares the identifier=value edge case fixed in check-shell-portability.sh (#1513) #1531

Closed

Description

@kyle-sexton

This was generated by AI during work-loop execution.

Context

While implementing #1513 (harden shell-portability-lint detection precision), item 3 of that issue
identified that scripts/check-shell-portability.sh's scan_file() passes "$TOKENS" "$file"
positionally to awk, and a scanned file whose relative path is shaped like an identifier=value
assignment (e.g. a top-level file literally named FOO=bar.sh) is silently consumed by awk as a
command-line variable assignment instead of opened as a file -- dropping it from the scan with no
error (empirically verified: awk '{print}' "FOO=bar.sh" exits 0 with no output; awk '{print}' "./FOO=bar.sh" correctly prints the file's contents). #1513 fixed this in
check-shell-portability.sh by prefixing an unrooted file operand with ./ before it reaches awk.

scripts/check-skill-portability.sh's scan_file() has the textually identical pattern --
awk '...' "$TOKENS" "$file" -- and so has the identical latent vulnerability, but #1513's brief
scoped the awk-operand fix to check-shell-portability.sh only (the issue that named it never
mentioned the skill gate for this specific item, unlike item 2 in the same issue, which explicitly
called out a shared fix across both gates). Fixing it there too was out of scope for #1513's PR.

Proposed work

Acceptance criteria

  • check-skill-portability.sh's scan_file() no longer risks silently dropping a scanned file
    whose name is shaped like an awk variable assignment.
  • A regression test proves the fix (file not silently skipped).
  • bash scripts/check-skill-portability.test.sh passes.

References

Metadata

Field Value
Category unspecified
Area security
Ecosystem unspecified

Activity

  1. added
    needs-triage
    area: security
    on Jul 26, 2026
  2. added
    status: ready
    agent-ready
    and removed
    needs-triage
    on Jul 26, 2026
  3. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage

    Verification: confirmed by direct source read. scripts/check-skill-portability.sh's
    scan_file() (current main, post-#1511/#1519/#1533) still passes the scanned file positionally to
    awk exactly as described: awk '...' "$TOKENS" "$file", with no ./-rooting of an unrooted $file
    operand — the identical shape #1513 fixed in the sibling check-shell-portability.sh (that fix is
    in PR #1534, not yet merged, so check-shell-portability.sh itself is currently in the same
    pre-fix state on main too). PR #1534's own "Related" section independently names this exact gap
    and points at #1532 (this issue's now-closed duplicate) as the follow-up — corroborating, not
    undermining, this issue's premise.

    Classification

    Agent Brief

    Type: Bug
    Summary: check-skill-portability.sh's file-scanning helper can silently drop a scanned file
    from the portability scan when the file's path is shaped like an identifier=value token, because
    the path reaches awk unrooted and awk consumes it as a variable assignment instead of opening it.

    Current behavior: A skill file whose relative path matches an identifier=value shape (e.g. a
    top-level file named FOO=bar.md) is silently excluded from the skill-portability scan — the scan
    exits clean with no error, and no violation is reported for that file even if it contains a flagged
    construct.

    Desired behavior: Every file passed to the scan is genuinely opened and scanned, regardless of
    whether its path happens to be shaped like a shell variable assignment. The fix already proven for
    the sibling shell-portability scanner is: root an unrooted file operand (prefix with ./ when it
    does not already start with ./ or /) before it reaches awk.

    Key interfaces:

    • The skill-portability scanner's per-file scan routine — the function that builds the awk
      invocation and passes it the target file path.

    Acceptance criteria:

    • A skill file whose name is shaped like an awk identifier=value token is no longer silently
      dropped from the skill-portability scan.
    • A regression test (mirroring the sibling shell-portability scanner's equivalent case) proves a
      violation in such a file is detected, not silently skipped.
    • The skill-portability test suite passes in full.

    Out of scope:

    Labels applied: agent-ready (autonomous-eligible role label), status: ready, priority: low.
    Role label resolved from tracker defaults — .work-item-tracker.json carries no role_labels
    remap, so the default string applies (noting per the taxonomy's loud-warning rule).

    Related: #1513 (origin finding), PR #1534 (sibling fix, unmerged), #1532 (closed duplicate of this
    issue).

  4. added theissue type on Jul 26, 2026
  5. self-assigned this
    on Jul 26, 2026
  6. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor
    No description provided.
  7. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during work-loop execution.

    Claimed and worked via the /work-items:work autonomous worker lane. Applied the same ./-prefix
    awk-operand disambiguation #1513/#1534 used in the sibling check-shell-portability.sh to
    check-skill-portability.sh's scan_file(), and added a mirrored regression test
    (FOO=bar.md-shaped filename, confirmed present in violation output rather than silently dropped).

    Verified the new test is meaningful (fails without the fix, passes with it), full
    check-skill-portability.test.sh (20/20) and check-shell-portability.test.sh (56/56) suites
    green, shellcheck clean.

    PR: #1538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: securitystatus: ready

Type

Fields

No fields configured for Bug.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions