Skip to content

fix(lint): close the misc gaps of #196 in the bash and yaml model rules and the Stop resume - #260

Merged
furedea merged 4 commits into
mainfrom
fix/196-misc-rules
Nov 20, 2026
Merged

furedea merged 4 commits into
mainfrom
fix/196-misc-rules

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

概要

#196 の misc グループ(bash / GitHub Actions,hook,共有の項目)を片付ける.bash・yaml のモデル規則 6 件で,見逃していた書き方を選ぶようにし,eval を取り直して cutoff を当て直した.Stop の resume が別の review 構成で再開してしまう不具合も直した.判断が必要な項目はない.

Refs #196

変更前と変更後

対象 変更前 変更後
workflow-default-shell / cache-key-and-trust flow 形式の step(- {run: …},steps: [{uses: …}])を選ばない 選ぶ
job-permissions-least-privilege 引用符付きの "jobs":,flow 形式の job の permissions を選ばない 選ぶ
usage-help-and-error-exits $# を調べる if,getopts の bare な h) を選ばない 選ぶ
function-variables-local-near-use : "$((count++))" を選ばない 代入を含む $(( )) を選ぶ($((1 + 2)) は選ばない)
tracing-not-left-on-for-secrets set -xe,set -euxo pipefail を選ばない(#243 の Limit) 選ぶ.bad fixture を 1 件追加
Stop の resume 失敗後にコミット構成が変わっても(git reset --soft),保存した位置から再開し,未実行の review を飛ばす resume に review 構成(base・rules・files)の digest を保存し,一致しなければ最初からやり直す

検証

  • tests/test_bash_and_yaml_model_rules.py(新規,dry-run の選択テスト 15 件):変更前は 11 件失敗,変更後はすべて成功
  • tests/hooks/test_model_rules_resume.py:別構成の resume で最初からやり直すテストを追加(変更前は失敗)
  • jev-lint eval --accept(ユーザーが実行,2026-11-19,3 passes):6 suite の baseline を記録
  • jev-lint eval --replay agents/hooks/lint/model-rules:74 suite がすべて as shipped
  • uv run pytest(jev-lint 0.7.0 を PATH に置く):6188 passed,2 skipped
  • ruff check,ruff format --check,ty check(pre-commit)

eval の結果(3 passes,中央値)

規則 tp / fp / fn 最高の clean 最低の bad cutoff
bash/usage-help-and-error-exits 4 / 0 / 0 0.45 0.83 0.64(据え置き)
bash/function-variables-local-near-use 4 / 0 / 0 0.17 0.79 0.49(据え置き,blind)
bash/tracing-not-left-on-for-secrets 4 / 0 / 1 0.16 0.16 0.5(分離しない)
yaml/cache-key-and-trust 4 / 0 / 0 0.20 0.94 0.57(据え置き,blind)
yaml/job-permissions-least-privilege 3 / 0 / 0 0.40 0.91 0.64 → 0.65(blind)
yaml/workflow-default-shell 4 / 0 / 0 0.41 0.86 0.62 → 0.63(inconclusive: を削除)
  • job-permissions-least-privilege の inconclusive: は,指示では削除だった.しかし margin が 0.26 / 0.25 で jev-lint の blind 判定(0.25 以上)に当たり,削除すると replay が失敗する.このため残し,数値だけ 0.28 から 0.25 に直した.
  • cost:eval 1 回(6 suite,ユーザー実行).このセッションでは model に問い合わせていない.

#196 の misc 項目

項目 状態
gha_workflow_permissions_deny_all:引用符付きの "jobs":,ルート全体が flow mapping 対応済み(#216.引用符は修正,flow は Scope: に記録)
bash_readonly_constant_name:関数内の readonly,declare -r 対応済み(#216.declare -r / -gr は検査,関数内の readonly は Scope: に記録)
gha_job_timeout_minutes:jobs が flow mapping,引用符付きの "jobs": 対応済み(#216.引用符は修正,flow は Scope: に記録)
gha_pinned_uses_version_comment:action.yml 対応済み(#216.files: に action.yml を追加)
gha_workflow_concurrency の 'on':,gha_workflow_default_shell,bash_strict_mode_header 不要(#194 でモデル規則に降格)
.bats を ast-grep で Bash として読むか 対応済み(#216.有効化しないと決定)
SUBJECT_CAP 対応済み(#246)
scripts/bootstrap_server.sh に ast-grep がない(#202) 対応済み(#216)
後段 review の失敗で毎ターン block する件,失敗理由,skipped_files,2 tier の順序のテスト(#191) 対応済み(#216)
resume が別の review 構成に当たる(#216 のレビュー) 修正(この PR)
workflow-default-shell の flow step 修正
job-permissions-least-privilege の引用符付き "jobs":,flow job 修正(jobs そのものが flow mapping の場合は対象外.下の Limits)
cache-key-and-trust の flow step 修正
usage-help-and-error-exits の $#,bare な h 修正
function-variables-local-near-use の : "$((count++))" 修正
tracing-not-left-on-for-secrets のフラグ連結(#243 の Limit) 修正
SKILL_NAMES が . で始まるディレクトリを拾う 対応済み(#214)
test_main_is_thin_selects_… を command-query-naming が指摘する 対応しない.advisory な余分の指摘で,テスト名が selects なのは matcher の選択を検証するため
error-message-names-operation が guard_git.py:46,herdr_ownership.py:26 を指摘する(#216) 対象外.guard 系 hook は #197 / #255 の担当
no-comment-restating-code,no-exposed-mutable-collection,no-reaching-through-collaborators,construction-separate-from-execution(言語ごと) 各言語レーンの担当.規則ファイルが言語ごとに分かれていて,共有ファイルがない
Limits と範囲
  • Limit:tracing-not-left-on-for-secrets は,set +x のあと秘密の前で再び set -x するケース(bad_retraced_before_secret.bash:10)を 0.16 と判定し,clean と分離しない.advisory のまま rule.yml に記録した.
  • Limit:job-permissions-least-privilege と workflow-default-shell は,jobs 自体が flow mapping(jobs: {build: {...}})の workflow を選ばない.実際にはほぼ書かれない形.
  • Limit:usage-help-and-error-exits の bare な h) は,getopts ではない case の h) も選ぶ.モデル規則の matcher は広く取る方針(fix(lint): address review findings deferred from the #74 migration PRs #196)なので,criteria で判定する.
  • Limit(レビュー指摘,P2):cache-key-and-trust は,別のアクションの入力(with: {uses: actions/cache@v4})も選ぶ.余分な subject で,block 形式にも以前からある.祖先の条件で step の mapping に限る修正は matcher を変えて eval の取り直しが要るため,次の eval で直す.
  • Limit(レビュー指摘,P3):function-variables-local-near-use は,$(( flags <<= 1 )) のように <<= / >>= で代入する $(( )) を選ばない.次の eval で (<<|>>)= を加える.
  • Limit(feat(lint): fit the bash and yaml model rule cutoffs #243 から継続):script-constants-readonly は,同じ変数をトップレベルで再代入するスクリプトで余分に指摘し得る.
  • 古い receipt(layout なし)の resume は,一致しないものとして扱い,最初からやり直す.
  • 範囲外:Jev 規則の昇格(ADR-0027),guard / permission hook,feat(agent-runtime): build persistent, isolated, provider-neutral agent infrastructure #181,release.

🤖 Generated with Claude Code

furedea and others added 4 commits November 19, 2026 20:12
…reviews

A resume records the position of the review that failed. When the commits
move after the failure (for example `git reset --soft`), the same inputs
regroup into other reviews, and the saved position skipped reviews that were
never judged. The resume now carries a digest of the reviews' bases, rules
and files, and a run of different reviews ignores it.

Refs #196

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sh and yaml model rules

The matchers missed forms recorded in #196: a step or job written as a flow
mapping (workflow-default-shell, job-permissions-least-privilege,
cache-key-and-trust), a quoted `"jobs":` key, an `if` that tests `$#`, the
bare `h` label of a getopts loop, and an assignment inside an arithmetic
expansion. Each form now has a dry-run selection test.

Refs #196

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t-on-for-secrets

`set -xe` and `set -euxo pipefail` turn tracing on but were not subjects,
because the matcher required `x` to end the flag cluster. Add a bad fixture
for the cluster form, as #243 left for the next eval.

Refs #196

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nges

Accept new eval baselines for the six suites whose matchers changed
(user-run eval of 2026-11-19, 3 passes) and move the cutoffs to the fitted
midpoints: job-permissions-least-privilege 0.65, workflow-default-shell
0.63; the others keep theirs. workflow-default-shell is no longer blind
and drops `inconclusive:`. tracing-not-left-on-for-secrets still misses the
re-traced case (0.16), recorded as a Limit.

Refs #196

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 19, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T12:30:05.516012Z 94df818 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

Review summary

No P0 or P1 findings.

What I checked

  • Resume layout digest (model_rules_run.py, model_rules_resume.py, model_rules_outcome.py):
    • A resume now carries a digest of each review's base, rules and files, and Reviews.judge ignores a resume whose digest differs.
    • Receipts written before this change have no layout. They load as "", never match, and restart from scratch, which is the safe outcome.
    • A malformed layout makes load return None, consistent with the other fields.
    • The tests cover the round trip, the same-layout resume and the changed-layout restart.
  • Matcher changes: the flow-mapping branches in workflow-default-shell and job-permissions-least-privilege, the $# and h) additions in usage-help-and-error-exits, and the broadened set -x flag-cluster regex all read correctly. I found no false-positive paths I could construct. set +x, set -euo pipefail and set -o errexit are still not selected.
  • Baselines and cutoffs: the baseline.json and cutoff updates match the eval table in the description. These are generated files, so I only skimmed them.

Findings

  • P3 (inline): the $(( )) assignment regex in function-variables-local-near-use misses <<= and >>=.

Observations, not findings

  • Review.scope leaves out root and the content of the rule files. Two repos with the same base, rules and paths, or a rule edited between a failure and its resume, would still count as the same layout. Both seem unlikely enough that I would leave them.
  • tracing-not-left-on-for-secrets still does not separate, as the description says. The new fixture scores 0.94 or more, so it does not make that worse.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94df8182d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@furedea
furedea merged commit 3dd759b into main Nov 20, 2026
29 checks passed
@furedea
furedea deleted the fix/196-misc-rules branch November 20, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant