Skip to content

test(model-rules): add boundary clean fixtures to the Go M-05 and M-60 suites - #178

Merged
furedea merged 5 commits into
mainfrom
test/164-go-boundary-fixtures
Nov 12, 2026
Merged

furedea merged 5 commits into
mainfrom
test/164-go-boundary-fixtures

Conversation

@furedea-agent

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

Copy link
Copy Markdown
Contributor

概要

Go の command-query-naming(M-05)と known-defect-marker-names-removal(M-60)に,違反に近い見た目の「本当に準拠している」境界フィクスチャを足し,inconclusive: を外しました.残っていた inconclusive: はこの 2 つだけで,これで 3 スイートすべてが外れます(Rust M-21 と Go M-21 は #158 / #175 で対応済み).

Closes #164

変更

スイート 追加した clean 理由(ルールの基準に照らして)
go/command-query-naming FindLargest 読み取りの名前で,ソートするのは自分のコピーだけ.引数は変えない
go/command-query-naming (*Review).Refresh 効果を示す名前で,ファイルを読むが,効果は自分のフィールドの置き換え
go/known-defect-marker-names-removal TestNeedsNewerToolchain 既知の不具合ではなく,ツールチェーンの不足による skip
go/known-defect-marker-names-removal TestUntilRelease コメントが,修正を含むリリースを示している
go/known-defect-marker-names-removal TestPinnedTransport 削除条件が依存のバージョン更新
go/known-defect-marker-names-removal TestUpstreamTicket 削除条件が外部 issue のクローズ

ルール文(criteria)は変えていません.フィクスチャの import を 1 行足したため,既存 clean の行番号を +1 しました.

評価(user が実行した eval,--no-config)

スイート tp / fp / fn cleanTop fitted 以前の cleanTop
go/command-query-naming 4 / 0 / 0 0.30 0.63 0.24
go/known-defect-marker-names-removal 8 / 0 / 0 0.27(conforming_test.go:31) 0.56 0.24
  • 新しい M-60 の clean は 0.03〜0.20 で,境界には届きませんでした.境界は既存の conforming_test.go:31 に依存しており,このケースのスコアの揺れ(spread)は 0.16 です.今後 replay が blind と判定する場合は,この揺れが原因として疑われます.
  • Go の M-05 の境界は,まだ端にあります.最高の clean は約 0.26 で,閾値からの余白は約 0.24 と,blind と判定される 0.25 の線ぎりぎりです.新しい 2 件の clean(FindLargest,Refresh)は 0.07〜0.12 で境界には届いていません.なお,レビューの指摘を受けて,意図せず 0.40〜0.48 になっていた helper reload は Refresh に inline しました.
  • 新しい M-60 の clean を境界に当てるために,ルール文を曲げることはしていません.
  • baseline の last.json は他のスイートと同様にコミットしていません.

検証

  • uv run --frozen pytest:4718 passed,1 skipped
  • jev-lint eval --replay --no-config agents/hooks/lint/model-rules/go:3 スイートすべて「same decisions」

#164 の受け入れ条件

🤖 Generated with Claude Code

@furedea

furedea commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 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-12T06:03:58.352444Z fb8799f 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.

@@ -10,7 +10,6 @@ subject: node
# The comment sits above the call statement, outside the call, so the arm that sends the file is used.
state: located
threshold: 0.5

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 — The inconclusive: line came out, but the condition it described is still there. The removed note said replay flips between blind and not blind because the top clean score sits near 0.25 (a 0.25 margin from the 0.5 cutoff). In the new baseline, the top clean is still the old conforming_test.go:31 (TestAfterRewrite), which scored 0.30, 0.23 and 0.29 across the three runs. The 0.23 run is below 0.25. None of the four new boundary fixtures scored above 0.14, so they don't move the margin. The PR body says as much: the boundary still depends on line 31, whose spread is 0.16. So this suite can still flip to blind on a later re-record, and the note that warned about it is gone. Either keep inconclusive: until a clean case reliably scores well above 0.25, or add a fixture that does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Kept on purpose. The user decided to drop it because jev-lint eval --replay no longer calls the suite blind (FN-margin 0.33 with spread 0.02, FP-margin 0.19 with spread 0.16), and the replay test in tests/test_model_rule_files.py would fail if it did. The 0.16 spread of conforming_test.go:31 is now recorded in the rule.yml header and in the PR body, so a later flip has a stated cause. None of the four new M-60 clean cases reached the boundary (0.03 to 0.20) and I did not bend the rule prose to make one.

# The cutoff is the 0.5 starting value, not fitted: on this folder's fixtures the highest conforming case scored 0.25
# and the fit would be 0.61, so the eval separates them with a wide margin.
# The cutoff is the 0.5 starting value, not fitted: on this folder's fixtures the highest conforming case scored 0.45
# and the fit would be 0.71, so the eval separates them with a margin.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 — The top clean case (0.45) is conforming.go:67, which is the unlabeled helper reload. It is not either of the new boundary fixtures: FindLargest scored 0.08–0.12 and Refresh scored 0.07–0.09. Across the three baseline runs reload scored 0.40, 0.48 and 0.46, which leaves only 0.02 below the 0.5 cutoff. A small drift on a re-record or a model bump would turn it into a false positive, so this suite went from blind-flapping to FP-flapping. Two options: soften the helper so it sits around 0.3–0.4, or add it to expect.yml explicitly so the boundary is intentional, and record the thin margin in this comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Checked. The top clean case is the unlabelled helper reload at conforming.go:67 (0.40 to 0.48), as you say. I tried labelling it in expect.yml: replay then reports command-query-naming as unstable on the FP side (FP-margin 0.05 below the clean spread 0.08), so a label would add a failing check without a better fixture. I reverted it and recorded the numbers and the reason in the rule.yml header. FindLargest and Refresh (0.07 to 0.12) are honest cleans but low, so a quieter near-cutoff clean for M-05 remains a possible follow-up.

@github-actions

Copy link
Copy Markdown

Review summary

No P0/P1 findings. The fixture line numbers in both expect.yml files match the new fixtures (import +1 shift, new entries at conforming.go:54/63 and conforming_test.go:41/47/52/56). The baselines line up with them.

P2 (2):

  • M-60 known-defect-marker-names-removal: inconclusive: was removed, but the top clean case is still the old conforming_test.go:31. Its scores were 0.30, 0.23 and 0.29, and the 0.23 run is below the 0.25 margin the removed note warned about. The new boundary fixtures score 0.14 or less, so they don't move the margin, and the suite can still flip to blind.
  • M-05 command-query-naming: the top clean case is the unlabeled helper reload (conforming.go:67), not either of the new boundary fixtures. It scored up to 0.48 against the 0.5 cutoff, so a small drift would make it a false positive.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 131dbdfde1

ℹ️ 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".

… in the Go rule headers

Refs #164

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

return r.reload(path)
}

func (r *Review) reload(path string) error {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 — The new unlabelled helper reload has become the suite's highest-scoring clean case. Across the three recorded passes it scored 0.40, 0.48 and 0.46 against a 0.5 cutoff. Because default: clean applies, it is still judged as a clean subject. With a spread of about 0.08, a future replay or baseline refresh could push it over 0.5 and record a false positive.

That would bring back the run-to-run instability that removing inconclusive: was meant to fix. The cause is a different case: one that was added by accident rather than chosen as a boundary. The new rule.yml comment says labelling it makes replay report the FP side as unstable. That suggests the margin is really too thin, and leaving it unlabelled only hides the problem.

Possible fixes:

  • Make the effect visible in reload's name or shape, for example loadScores.
  • Inline it so that Refresh itself is the boundary subject.

Either way, the boundary should be a case that expect.yml deliberately labels.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, it was an accidental boundary. I inlined reload into Refresh so the boundary subject is a case that expect.yml labels on purpose. The scores change, so this needs a new eval and baseline from the user before the push; the rule prose stays as is.

@github-actions

Copy link
Copy Markdown

Review summary

Blocking findings (P0/P1): 0

What I checked

  • Line numbers: expect.yml line numbers in both suites match the fixtures after the new import line. In M-05, FindLargest is at 54 and Refresh at 63. In M-60, the t.Skip calls are at 41, 47, 52 and 56, and the existing cleans each moved down one line.
  • Baselines: the regenerated baseline.json files list the new subjects at the right lines. The violating cases still score between 0.81 and 0.97.
  • Removed inconclusive: keys: nothing else in the repo reads them.

Finding

  • P2 go/command-query-naming/fixtures/conforming.go:67: the unlabelled helper reload is now the highest-scoring clean case, at 0.40 to 0.48 against a 0.5 cutoff. A future replay could record it as a false positive, which would bring back flaky results through a case nobody chose as a boundary. Details are in the inline comment.

Not flagged

  • TestNeedsNewerToolchain compares Go versions as strings (runtime.Version() < "go1.23"), which would be wrong in real code. CI doesn't compile these fixtures, so it doesn't affect anything here.

@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: 12fa080b4d

ℹ️ 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".

Comment on lines +5 to +6
# `reload` (conforming.go:67), which scored 0.40 to 0.48 across passes; labelling it makes replay report the FP side
# as unstable (margin 0.05, spread 0.08), so it stays a subject judged by default.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 不安定な既定ラベルを境界評価から隠さないでください

reload は各パスで 0.40/0.48/0.46 と閾値 0.5 の直下まで変動しており,このコメント自身も明示ラベルにすると FP 側が不安定になると認めています.一方,今回明示的に追加した境界例は FindLargest が 0.08~0.12,Refresh が 0.07~0.09 に留まり,境界の安定性を検証できていません.この状態で reload を既定ラベルにして inconclusive を削除すると,リプレイの安定性診断を回避したままスイートを確定的に見せるため,reload を明示して不安定性を解消するか,実際に閾値近傍で安定する明示フィクスチャが得られるまで inconclusive を残す必要があります.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed on the cause: reload was an unlabelled accident. It is now inlined into Refresh, which expect.yml labels clean, and the rule.yml note about it is removed. A new eval and baseline follow; the inconclusive stays dropped only if replay then reports no instability for the labelled case.

Comment on lines +4 to +5
# is the 0.5 starting value, not fitted: on this folder's fixtures the highest conforming case scored 0.27
# (conforming_test.go:31, whose score spread across passes is 0.16).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge M-60 の境界が安定するまで inconclusive を維持してください

追加した4件の clean はベースライン上で最大でも 0.14 であり,閾値 0.5 近傍の境界例になっていません.最高値は既存の conforming_test.go:31 の 0.23~0.30 のままで,コメントにあるとおり spread は 0.16 です.したがって,従来 inconclusive が説明していた blind/not-blind の揺れを今回のフィクスチャは解消しておらず,このフィールドを削除すると不安定な評価結果を確定的なものとして扱ってしまいます.安定した境界フィクスチャを追加するまでは inconclusive を残してください.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Kept dropped by the user decision: replay no longer calls this suite blind (FN-margin 0.33 spread 0.02, FP-margin 0.19 spread 0.16), and the replay test fails if that changes. The 0.16 spread of conforming_test.go:31 is stated in the rule.yml header and the PR body. Four more clean cases scored 0.03 to 0.20 and I did not bend the rule prose to raise them.

…ase is a labelled one

Refs #164

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

# Lines are the first line of each function; a window of 1 keeps neighbouring functions apart.
# violating.go: the verb promises a pure read or an effect and the body does the other.
# conforming.go: the explicit cleans are the hard ones, whose verb promises neither (check, judge, load).
# conforming.go: the explicit cleans are the hard ones, whose verb promises neither (check, judge, load), and the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This comment is out of date. It says a boundary fixture is "an effect done by a helper", but the PR inlined the reload helper into Refresh, so conforming.go has no helper now. The why: on line 63 already gives the correct reason (the effect replaces the function's own field). Someone tuning this suite later could misread what the fixture is meant to test. Suggest rewording to something like "an effect-named method that reads a file but only replaces its own field".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in fb8799f: the header now says an effect-named method that reads a file but only replaces its own field.

# Lines are the t.Skip call. violating_test.go: a skip for a known defect with no removal condition.
# conforming_test.go: a condition in a comment or in the message, and skips that are not for a defect.
# conforming_test.go: a condition in a comment or in the message, and skips that are not for a defect; the last two
# are boundary cases that look like a violation (a toolchain gap with a version in the message, a comment that names

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The comment says "the last two are boundary cases", but this PR adds four boundary cleans (lines 41, 47, 52, 56). The dependency-bump case and the external-issue case aren't mentioned. Suggest "the last four" plus those two descriptions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in fb8799f: the header now says the last four and lists the dependency bump and external issue cases.

@github-actions

Copy link
Copy Markdown

Review summary

No blocking findings (0 × P0/P1).

What I checked:

  • Fixture line numbers vs. expectations. Every expect.yml line matches the fixture at head:
    • conforming.go: 30, 39, 43, 54, 63
    • conforming_test.go: 11, 15, 20, 26, 31, 36, 41, 47, 52, 56
    • The +1 shift from the new imports is applied consistently.
    • The baseline.json entries use the same new line numbers.
  • New fixtures compile-wise. Review.scores exists, and the slices and runtime imports are used.
  • The new cleans really conform to the rule criteria.
    • FindLargest sorts only a clone, so it doesn't change its argument.
    • Refresh is an effect-named method whose effect is replacing its own field.
    • Each new M-60 skip either isn't for a defect or names its removal condition.
  • Removing inconclusive:. The rule.yml headers now record how close each suite is to the boundary. M-05 is still near the 0.25 blind line, as the PR says.

Two P3 inline comments: the expect.yml header comments are out of date. One still mentions a helper that was inlined; the other says "last two" boundary cases when four were added.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: e045806e77

ℹ️ 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 commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

No blocking findings.

Checked:

  • The new expect.yml line numbers point at the right lines. In conforming.go, line 54 is FindLargest and line 63 is Refresh. In conforming_test.go, lines 41, 47, 52 and 56 are the new t.Skip/t.Skipf calls. The existing cleans were shifted by +1 to account for the added import.
  • The new fixtures compile against what the files already declare (Review.scores, and the slices/runtime imports were added).
  • The baseline entries match the new line ranges. The rule.yml comments match what baseline.json records: M-05's highest clean is about 0.30 at line 39, and M-60's is about 0.27 at line 31.
  • Nothing else in the repo reads the removed inconclusive: keys.

Note (not blocking): in the committed M-05 baseline, Refresh (line 63) scores 0.19, 0.28 and 0.27. The PR description says the new cleans score 0.07–0.12, so that part of the description looks out of date. The rule comment is consistent with the baseline.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: fb8799fbbf

ℹ️ 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 d6f2e7d into main Nov 12, 2026
27 checks passed
@furedea
furedea deleted the test/164-go-boundary-fixtures branch November 12, 2026 06:16
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.

Rust の M-21 が ok_or / map_err で作るエラーを選べない

1 participant