[Safe Outputs Conformance] TYPE-016: Conformance checker regex rejects valid enforceCommentLimits signature

Đã đóng Phù hợp với người mới
#71,365 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, javascript, shell
Lĩnh vực
ci-cd, testing

Hướng nghiên cứu

Đọc check_add_comment_max_links trong scripts/check-safe-outputs-conformance.sh và so sánh phần kiểm tra chữ ký của nó với enforceCommentLimits trong actions/setup/js/comment_limit_helpers.cjs. Cập nhật checker để xác minh maxLinks = MAX_LINKS và linkBody = body trong chữ ký options, đồng thời cho phép các tham số bổ sung. Chạy bash scripts/check-safe-outputs-conformance.sh và xác nhận TYPE-016 đạt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

automated conformance safe-outputs
Conformance Check Failure

Check ID: TYPE-016
Severity: HIGH (as reported by the checker; investigation below suggests this is a false positive in the checker itself, not the implementation)
Category: Specification/Implementation

Problem Description

scripts/check-safe-outputs-conformance.sh (around line 2503) asserts that actions/setup/js/comment_limit_helpers.cjs contains the exact literal signature:

function enforceCommentLimits(body, { maxLinks = MAX_LINKS, linkBody = body }

The actual, current signature is:

function enforceCommentLimits(body, { maxLinks = MAX_LINKS, linkBody = body, maxLength = MAX_COMMENT_LENGTH } = {}) {

A maxLength destructured parameter (with its own default) was added after linkBody = body, so the checkers strict regex — which expects the destructuring to close with \} immediately after linkBody = body — no longer matches, even though the feature required by TYPE-016 (configurable maxLinks, and an agent-only linkBody that excludes generated/footer links from the link count) is fully present and used correctly:

  • actions/setup/js/add_comment.cjs:918 calls enforceCommentLimits(processedBody, { maxLinks, linkBody }) — matches the handler-side regex check and correctly separates agent content (linkBody) from the full processedBody.
  • actions/setup/js/safe_outputs_handlers.cjs:2416 calls enforceCommentLimits(body, { maxLinks: addCommentConfig.max_links ?? addCommentConfig[\"max-links\"], maxLength: MAX_COMMENT_INPUT_LENGTH }) — matches the MCP-gateway-side regex check.
  • The schema (pkg/parser/schemas/main_workflow_schema.json) correctly declares max-links as a positive integer.

So three of the four TYPE-016 sub-checks pass; only the first sub-check (exact signature regex) fails, and only because it does not tolerate an additional trailing parameter in the destructuring.

Affected Components
  • Files: scripts/check-safe-outputs-conformance.sh (line ~2503, the check_add_comment_max_links function)
  • Reference implementation (believed correct, should NOT be changed to "fix" this): actions/setup/js/comment_limit_helpers.cjs
🔍 Current vs Expected Behavior
Current Behavior

The checkers regex for the helper signature is an exact literal match that breaks whenever an additional keyword parameter (here maxLength) is added to the destructured options object, producing a HIGH-severity false positive even though the semantic requirement (configurable maxLinks, agent-only linkBody) is satisfied.

Expected Behavior

The checker should verify the semantic presence of a configurable maxLinks parameter and a linkBody parameter that defaults to body (so callers may pass agent-only content), without being brittle to additional, unrelated parameters being added to the same destructuring (e.g. match on maxLinks = MAX_LINKS and linkBody = body as independent substrings rather than one contiguous literal sequence terminated by \}).

Remediation Steps

This task can be assigned to a Copilot coding agent with the following steps:

  1. In scripts/check-safe-outputs-conformance.sh, update the check_add_comment_max_links functions first regex (around line 2503) so it independently checks for maxLinks = MAX_LINKS and linkBody = body appearing within the enforceCommentLimits function signature, instead of requiring them to be immediately followed by } (e.g. two separate grep -q checks, or a regex that allows trailing , ... before the closing brace).
  2. Do NOT modify actions/setup/js/comment_limit_helpers.cjs, add_comment.cjs, or safe_outputs_handlers.cjs to "fix" this — their current behavior already satisfies the TYPE-016 requirement.
  3. Re-run the checker and confirm TYPE-016 reports PASS.
Verification

After remediation, verify the fix by running:

bash scripts/check-safe-outputs-conformance.sh

The check TYPE-016 should pass without errors.

References
  • Safe Outputs Specification: docs/src/content/docs/specs/safe-outputs-specification.md (Section 7.1 Enforced Constraints, Section 8.3 MCE5)
  • Conformance Checker: scripts/check-safe-outputs-conformance.sh
  • Run ID: 39907463914
  • Date: 2026-10-23

Generated by ✅ Daily Safe Outputs Conformance Checker · claude · agent · ~67 AIC · ⌖ ~1 AIC · ⊞ 5.4K · ◷

  • expires on Oct 23, 2026, 9:51 PM UTC-08:00
Ngôn ngữ chính
Go
Star
5.6k
Fork
615
Merge trung bình
5 giờ 36 phút
Pull request đã merge (30 ngày)
805

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/gh-aw

Tất cả issue của github/gh-aw

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.