Skip to content

portability-lint: is_comment anchor doesn't recognize Markdown-list/blockquote-nested block comments (found on PR #1338, fixes #611) #1342

Closed

Description

@kyle-sexton

This was generated by AI during work-loop execution.

Context

Found during the post-green review pass on PR #1338 (fixes #611). A chatgpt-codex-connector[bot]
inline review comment on that PR flagged that #611's fix — anchoring is_comment()'s HTML-comment
branch in scripts/check-skill-portability.sh to ^[[:space:]]*<!-- (block-level only, whitespace
before the marker) — does not recognize a block-level comment nested inside a Markdown list item or
blockquote container, e.g. a portability-ok exemption written as - <!-- portability-ok: reason --> or > <!-- portability-ok: reason -->. The opener is still the first content in that Markdown
container, but the raw-line anchor classifies the line as non-comment, which clears
pending_annot instead of setting it — so a legitimately-annotated block-comment-above exemption
written in that style would fail to carry forward to the content line it is meant to exempt, and the
gate would wrongly flag that line.

Verified empirically (not merely asserted): echo '- <!-- portability-ok: nested list annotation -->' | awk '{ if ($0 ~ /^[[:space:]]*<!--/) print "true"; else print "false" }' prints false.

Not currently a live regression: grep -rn "portability-ok:" --include="*.md" plugins/ over the full
corpus returns zero hits today, so no existing annotation uses this nested-container shape. This is a
forward-looking hardening gap, not an active false-positive.

Deferred out of PR #1338 (fixes #611) rather than fixed inline: #611's acceptance criteria was the
exact ^[[:space:]]*<!-- anchor already recorded in that issue's body (itself the reviewer's
suggested fix from PR #609), so widening the anchor to recognize Markdown container prefixes is new
scope beyond that fix, and needs its own design decision (which prefixes to recognize — -, *,
+, ordered-list markers, >, nesting/combinations — without loosening the anchor back toward the
original bug's "any line containing <!--" over-match).

Proposed work

  • Widen is_comment()'s HTML-comment branch (or add a second branch) to recognize a <!-- opener
    immediately following a Markdown list/blockquote prefix (- , * , + , an ordered-list marker,
    or > , optionally repeated/nested), while continuing to reject a <!-- that opens mid-sentence in
    prose content (the original source-control(ci):portability-lint: pending_annot carry-forward doesn't distinguish inline vs block HTML comments #611 failure mode).
  • Add self-test cases to scripts/check-skill-portability.test.sh covering both the newly-recognized
    container-prefixed comment lines and continued rejection of mid-sentence inline comments.

Acceptance criteria

References

Metadata

Activity

  1. added
    needs-triage
    needs-human
    on Jul 25, 2026
  2. added theissue type on Jul 25, 2026
  3. added and removed
    needs-triage
    on Jul 25, 2026
  4. kyle-sexton commented on Jul 25, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage — raw marker retired, routed human-gated

    Contradiction resolved. This item carried both the raw-intake marker (priority: needs-triage) and a routing label (needs-human). Per the triage closing invariant, the routed state is the truth and the stale raw marker is cleared — otherwise the open-only attention view re-selects an already-routed item every cycle.

    Verified against current code (not the title). The reported gap reproduces at HEAD:

    $ echo '- <!-- portability-ok: nested list annotation -->' \
        | awk '{ if ($0 ~ /^[[:space:]]*<!--/) print "true"; else print "false" }'
    false
    

    The is_comment() HTML-comment branch anchors on ^[[:space:]]*<!--, so a block-level comment nested in a Markdown list or blockquote container classifies as non-comment and clears pending_annot instead of setting it. The report's "not a live regression" claim also holds — no portability-ok: annotation in the plugin corpus currently uses the nested-container shape, so this is forward-looking hardening rather than an active false positive.

    Classification: work-class: scoped (C3). Per the work-classes contract, C3 is "a briefed fix or small feature — blast radius bounded by the brief; tests exist, so reversal is a bounded revert." This is a grammar widening in one script plus cases in its existing self-test suite, with acceptance criteria already stated in the body. Not C2 (the widening is a judgment call about which container prefixes to admit, not a deterministic mechanical edit) and not C4 (no cross-cutting contract change).

    Priority: low. Latent, zero live occurrences; the report self-describes as "latent, low-likelihood / hardening."

    Routing: stays needs-human — not decision-defaulted. The body states the widening "needs its own design decision (which prefixes to recognize ... without loosening the anchor back toward the original bug's over-match)". The open fork is the grammar's boundary — which of -, *, +, ordered-list markers, >, and their nestings to admit — and getting it wrong re-opens the over-match bug that #611 was filed to close. That is open design space rather than a single reversible fork, so it fails closed to human-gated rather than riding in as a default.

    Related, unchanged: #611 (the carry-forward fix this was raised against, PR #1338), #624 (sibling escape-hatch grammar-rigor pair, same file, also needs-human).

  5. kyle-sexton commented on Aug 12, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI in the decide-and-implement lane (operator authorization: human gates become decision work for frontier consensus). Decision: recognize the standard Markdown container prefixes — list markers (-, *, +, N., N)) and blockquote (>), each required to be followed by whitespace, optionally repeated for nesting — and nothing else. The design question this issue deferred was which prefixes to admit without loosening the anchor back toward #611's any-line-containing-<!-- over-match; requiring every container marker to be whitespace-terminated and the whole prefix chain to start at line start (modulo indentation) keeps that boundary: prose carrying a dash, digit, or > mid-sentence before an inline comment still fails the anchor, which the new negative test asserts. The widening applies to both consumers of the anchor — is_comment()'s pending_annot carry-forward and the whole-file portability-scope: declaration grep — since the issue's acceptance criteria name both annotation kinds in container style. Implemented with seven positive fixture shapes (including nested > - <!--), one negative (list-item content line with an inline comment must not carry the annotation), and a blockquote-nested portability-scope case; the full suite is green at 88 passing.

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-human

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions