hardening: a `forbids` practice whose answer is UNKNOWN falls through to FAIL with empty evidence under --allow-unknown ("runtime safety checks are compiled away: ")

オープン
#243 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python, swift
領域
cli, tooling

調査の方向性

Start in policy/practices.py around lines 66-71, where an UNKNOWN answer under allow_unknown falls through to the forbids branch and fails with empty found() evidence. Then check questions/practices.py lines 85-90 and the Swift validator in ecosystems/swift.py lines 282-294. Done means a forbids practice with UNKNOWN and no matches passes under --allow-unknown, with a regression test for the repro.

索引モデルが issue の本文から書いたものです。

説明

Swift projects whose CI has an unrelated unread reusable workflow (swift-argument-parser, swift-nio, vapor, SwiftLint, dart-lang/http, bloc) get FAIL "Swift's runtime safety checks are compiled away: " with nothing after the colon; grep -rn Ounchecked over each checkout returns nothing. policy/practices.py:70-71: for a forbids practice, UNKNOWN with --allow-unknown should pass on the readable evidence (nothing forbidden found), as drift gets.

Evidence from the corpus audit

dart-lang/http, felangel/bloc / hardening (Swift)
  • kind: FALSE_POSITIVE
  • actual: FAIL: Swift: Swift's runtime safety checks are compiled away: (nothing after the colon)
  • expected: PASS: "release builds keep Swift's runtime safety checks (no -Ounchecked)", as drift gets. No
    -Ounchecked or SWIFT_ENFORCE_EXCLUSIVE_ACCESS = off exists in either repo. The practice is a forbids one; its
    answer is "unknown" only because unrelated reusable workflows are unread, and --allow-unknown then turns
    "nothing forbidden found" into a failure with an empty list.
  • evidence: grep -rl Ounchecked over both checkouts: no file;
    pkgs/cupertino_http/ios_test/ios/Runner.xcodeproj/project.pbxproj:549: SWIFT_OPTIMIZATION_LEVEL = "-O";;
    --answers for http: {"language": "Swift", "unit": ".", "answer": "unknown", "compilers": [{"compiler": null, "found": {}, "missing": ["-Ounchecked", "unchecked exclusivity"]}], "unknowns": ["job tidy: ... reusable workflow ..."]};
    validator project_validator/ecosystems/swift.py:283-293: forbids=True, failed="Swift's runtime safety checks are compiled away".
  • repro: a Swift unit (any .xcodeproj) + a workflow job uses: owner/repo/.github/workflows/x.yml@sha; run with
    --allow-unknown --only hardening.
  • confidence: high
apple/swift-argument-parser, apple/swift-nio, vapor/vapor, realm/SwiftLint / hardening
  • kind: FALSE_POSITIVE
  • actual: FAIL: Swift: Swift's runtime safety checks are compiled away: (empty evidence after the colon) in all
    four .allow.txt; the three projects with no unknowns (Alamofire, TCA, SwiftFormat) PASS the same check.
  • expected: PASS: no -Ounchecked or -enforce-exclusivity=unchecked exists in any of the four repositories
    (grep -rn "Ounchecked\|enforce-exclusivity" over each checkout returns nothing); with --allow-unknown the
    readable evidence shows nothing forbidden.
  • evidence: project_validator/questions/practices.py:85-90: in_doubt = met if practice.forbids else not met /
    if in_doubt and unknown: return Answer.UNKNOWN; project_validator/policy/practices.py:66-71: the UNKNOWN answer
    with allow_unknown falls through to if practice.forbids: return Result.failed(f"{words.failed}: {joined(answer.found())}", words.hint)
    with found() empty; project_validator/ecosystems/swift.py:282-294 (HARDENING = Practice(... forbids=True ...)).
    Strict run confirms the cause: apple__swift-argument-parser.txt [ERROR] hardening: ... Swift: whether Swift's runtime safety checks are kept is unknown.
  • repro: a Package.swift (// swift-tools-version:5.9, one target) plus a workflow whose only job is
    uses: other/repo/.github/workflows/x.yml@v1; run with --allow-unknown: hardening FAILs with an empty list.
    Fix is in judge_settings: for a forbids practice an UNKNOWN judged permissively must pass.
  • confidence: high

Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

主要言語
Python
スター
4
フォーク
1
平均マージ
10時間 41分
マージ済み PR(30日)
79

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cpp-best-practices/project_validator のほかの issue

cpp-best-practices/project_validator の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。