Repository navigation
build: align public text reporting - #5113
Conversation
Resolve the configured term file through one helper so health exposes the same file applied by the public-text checker.\n\nReport public-text violations against independently scanned title and body text, preserving each source's own line numbering.
jakildev
left a comment
There was a problem hiding this comment.
Review — build: align public text reporting
Verdict: approve
Does what #5095 asks, and the approach is sound. term_file_path() is now the single resolver (explicit arg, then FLEET_PUBLIC_TEXT_TERM_FILE, then ~/.fleet/public-text-terms). find_public_text, the module CLI and fleet-health all call it, so the health line and the checker cannot drift. fleet-pr-closes-lint now scans title and body separately, so body line numbers match the body file and each finding names its source.
Checked on head 6bfdd8eb9:
python3 scripts/fleet/tests/test_fleet_health.py— 77 tests OK (1 skipped, unrelated to this diff).python3 scripts/fleet/tests/test_fleet_pr_closes_lint.py— 40 tests OK.run_all.sh --only public_text— 2/2 suites pass.ruff check scripts/— clean.- No remaining references to the removed
DEFAULT_TERM_FILEinscripts/,docs/or.claude/. fleet-issueandfleet-pr-body-lintstill callformat_findingunchanged, so their output is unaffected.- The CLI's
--term-filedefault moved from an eager env read toNoneplus resolution interm_file_path. Behavior is the same, and an explicit flag still wins.
CI: all completed checks are green. fleet-tests (and the all-checks gate behind it) were still pending when I read them, so I did not read them as green.
Acceptance (issue #5095)
| Criterion | Status | Basis |
|---|---|---|
Health test: override path reported, configured true |
met | test_public_text_term_file_override_is_reported |
Health test: default under the suite's temp HOME |
met | test_public_text_term_file_is_informational now pins HOME and asserts the default path |
| One shared term-file resolver | met | term_file_path is used by fleet_public_text and fleet-health |
Closes-lint reports title line 1 / body line 1 |
met | test_public_text_findings_name_the_title_or_body_source |
| Positive controls red on master, green on head | unverified by me | the PR evidence table reports it (24/77 health assertions red on master; the closes-lint source-label case red). The assertions are shaped to fail against the old code, since the old output had neither a source label nor correct body numbering. |
run_all.sh --only fleet_health / closes_lint / public_text pass |
met for public_text (run here); the other two are covered by the direct suite runs above |
Nits (follow-up)
scripts/fleet/fleet-pr-closes-lint:255-262—find_public_textnow runs twice, so_ignored_creation_pathsshells out to git twice per PR. This is negligible for a lint, and the two runs are needed for per-source line numbers. Mentioning it only so a future refactor can fold the loop if the cost ever matters.
Test plan the author should run before merge
- Confirm
fleet-testsgoes green on the head.
Escalation: none. Safe for merge.
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Opus recheck not required.
Summary
Test plan
python3 scripts/fleet/tests/test_fleet_health.pypython3 scripts/fleet/tests/test_fleet_pr_closes_lint.pybash scripts/fleet/tests/run_all.sh --only fleet_healthbash scripts/fleet/tests/run_all.sh --only closes_lintbash scripts/fleet/tests/run_all.sh --only public_textruff check scripts/python3 scripts/light-verify.py --if-changedAcceptance evidence
python3 scripts/fleet/tests/test_fleet_health.pypython3 scripts/fleet/tests/test_fleet_health.pyterm_file_path.python3 scripts/fleet/tests/test_fleet_pr_closes_lint.pyfleet-positive-controlfor both affected suitesrun_all.sh --only fleet_health,--only closes_lint,--only public_textNotes for reviewer
fleet-pr-overlap --base master --repo enginereported clean shared paths with #5110 (scripts/fleet/fleet-healthand its test).Closes #5095
Authored with Codex (runtime: codex).