Skip to content

#8868 Batches A, B and C: Go/C/Rust/JS/TS rules count what their contracts name (Part of #8868) - #9267

Merged
squid-protocol merged 12 commits into
mainfrom
fix/batch-b-8868
Nov 25, 2026
Merged

squid-protocol merged 12 commits into
mainfrom
fix/batch-b-8868

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

What this does

Batches A, B and C of #8868 (this PR now includes #9265, folded in because both edit go.py and the same golden fixtures and would conflict with each other), after re-measuring every row against current origin/main (many #8868 gaps were already fixed or were the oracle's error). One PR so the golden masters are blessed once.

Measured (real repositories, parser oracle; recall / precision)

row before after
C panics_and_aborts (redis) 0.98 / 0.48 1.00 / 0.92
Go io (prometheus) 0.93 / 0.82 1.00 / 0.82
Rust io (tokio) 0.84 / 0.30 0.90 / 0.31 (precision: next batch)
Go closures 1.00 / 0.36 1.00 / 1.00
Rust closures 0.52 / 0.98 0.99 / 0.97
Rust short_circuit 1.00 / 0.12 0.99 / 0.78
TypeScript time_date_logic (vue) 1.00 / 0.02 1.00 / 1.00
TypeScript io 1.00 / 0.21 1.00 / 0.50
JavaScript thread_sleeps (express) dead (0 of 2 setImmediate) 1.00 / 1.00
Rust panics_and_aborts exit 0.97 miss exit x20 1.00 (the 20 were .exit() method calls: oracle error)

Already fixed on main (no change here): Rust unreachable! / sleep / time, TS regex literals, Java and C time recall, Rust branch.

Batch A (from #9265)

  • Go thread_sleeps counts time.AfterFunc / Tick / NewTimer / NewTicker (prometheus recall 0.89 -> 1.00, precision 0.99).
  • Go time_date_logic no longer counts time.Sleep (owner decision: a sleep is a timed wait; precision 0.69 -> 0.79, recall 1.00). The Go oracle's time reading is clock, calendar and duration forms only.
  • Re-measured and no change needed: Rust time (tokio 1.00 / 0.93), Java and C time recall (1.00).

Changes

  • Rules: c.py, go.py, rust.py, javascript.py, typescript.py (causes in the commit message).
  • Oracle (family_oracle_ts.py): C close/fclose are cleanup's, not io; no bare Rust exit.
  • tests/test_batch_b_rules.py: regression cases for each rule change; the 402 oracle + rule tests pass.

Cost and side effects

  • Scan CPU on language-crucible, 3 alternating runs (main -> branch, mean user s): C 10.30 -> 10.26, Go 5.47 -> 5.48, JS 7.22 -> 7.28, Rust 27.65 -> 27.49, TS 39.48 -> 39.63. No cost.
  • keyword-rosetta: C, Go, Rust rebless.py --dry-run nothing moved; TypeScript and JavaScript verify_language.py PASS against both main and this branch (their manifests do not round-trip under rebless.py on main, a rosetta-repo formatting issue, not touched). No rosetta:rebless-owed.
  • Goldens: re-blessed in clean venvs on the merged base (main + Python cleanup rule reads the whole contract; telemetry oracle reads self.logger (Part of #8863) #9263 + the Go branch; 34 files per fixture). Unmodified origin/main re-blesses with 0 changed files, so every difference is from this change. File-level differences: go 2,602, rs 3,882, ts 768, c 536, js 206. Also php 42 / py 28 / java 16: coordinate and cluster-distance nudges (e.g. 3878.66 -> 3878.52) that follow when repo-wide layout numbers move, plus php/wordpress/wp-login.php, whose inline <script>setTimeout(...) is scanned with the JS rules.

Not in this PR (listed on #8868)

TS/JS doc over-count (is_documented is a core header-anchor mechanism, not a keyword rule); Go/TS decorators firing (Go struct tags are a decision); Rust io precision 0.31 and Rust panics precision 0.78 (causes untraced); TS/JS closures (mixed); Java/C time precision; Java io (one URL function).

🤖 Generated with Claude Code

https://claude.ai/code/session_018srRvgGYqVYmsdY3wcgsrQ

squid-protocol and others added 3 commits November 24, 2026 20:44
…e contract (Part of #8868, #8863)

Re-measured the Batch A rows of #8868 against origin/main (tokio, retrofit, redis, prometheus):
Rust, Java and C `time_date_logic` recall are already 1.00 (the old gaps were fixed since).
Go `time_date_logic`'s 0.77 recall was the oracle reading `time.After` / `NewTicker` / `Tick` /
`NewTimer` as time; the contract puts timed waits under thread_sleeps, so the oracle now lists
clock, calendar and duration forms only (Go time recall 1.00).

The real gap was Go `thread_sleeps` (#8868 contract: "a sleep, a timed wait, a timeout-driven
deferral"): it missed `time.NewTicker`, `Tick`, `NewTimer`, `AfterFunc`. Now counted:
prometheus recall 0.89 -> 1.00, precision 0.99. language-crucible Go: 2 -> 3 functions fire.
Scan CPU unchanged (5.5 s user, three alternating runs).

Goldens re-blessed with crucible_check.py --update --yes in clean venvs: 6 files per fixture,
all 18 file-level differences are .go.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
#8868)

The contract files a sleep under thread_sleeps ("a sleep, a timed wait"); a clock, calendar value or
duration is time_date_logic. prometheus Go time_date_logic precision 0.69 -> 0.79 (recall 1.00).
Goldens re-blessed in clean venvs.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ts name (Part of #8868, #8863)

Batch B (contract-named misses), after re-measuring each row on origin/main:
- C panics_and_aborts: `return -1` (an error return, not an abort) no longer counts; `_exit` does.
- Go io: http.Get/Post/..., net.Listen/Dial.
- Rust io: `fs::read/write/...` after `use std::fs;`.
- Oracle: C no longer reads close/fclose as io (cleanup's, per the contract and the rule's own comment);
  Rust no longer reads a bare `exit` (`span.exit()` is a method call, not a process exit).

Batch C (precision, causes traced):
- Go closures: the rule matched method declarations `func (s *S) Name() {`; now function literals only.
- Rust closures: also `|x| x + 1` and `move |x|`, anchored where an expression starts.
- Rust short_circuit: `||` after `(`/`,`/`=`/`move` is a no-argument closure and `&&T` is a reference type;
  an operator counts when an operand ends right before it.
- JS/TS time_date_logic: setTimeout/setInterval/clearTimeout/clearInterval are timed waits (thread_sleeps),
  not clock values (same ruling as Go time.Sleep); setImmediate joins thread_sleeps.
- TS io: same operative-form rule as JS (bare path/http/sql/database are everyday words).

Goldens re-blessed with crucible_check.py --update --yes in clean venvs; unmodified origin/main
re-blesses with 0 changed files, so every moved entry is attributable to this change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvgGYqVYmsdY3wcgsrQ
squid-protocol and others added 3 commits November 25, 2026 06:21
# Conflicts:
#	tests/golden_master_audit/12_scan_output_snapshots/gpu_json.json
#	tests/golden_master_audit/12_scan_output_snapshots/graph_sqlite.json
#	tests/golden_master_audit/12_scan_output_snapshots/llm_brief.json
#	tests/golden_master_audit/2_global_ecosystem_summary/directory_groups.json
#	tests/golden_master_audit/2_global_ecosystem_summary/file_composition_distribution.json
#	tests/golden_master_audit/2_global_ecosystem_summary/function_archetype_distribution.json
#	tests/golden_master_audit/2_global_ecosystem_summary/summary.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/_groups.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/3_architectural_profile/raw_cognitive_density.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/3_architectural_profile/repository_drift_centroid_distance.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/3_architectural_profile/repository_fingerprint.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/4_vulnerability_risk_exposures/cognitive_load_exposure.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/gpu_json.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/graph_sqlite.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/llm_brief.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/directory_groups.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/file_composition_distribution.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/function_archetype_distribution.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/summary.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/_groups.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/3_architectural_profile/raw_cognitive_density.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/3_architectural_profile/repository_drift_centroid_distance.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/3_architectural_profile/repository_fingerprint.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/4_vulnerability_risk_exposures/cognitive_load_exposure.json
…ch-b-8868

# Conflicts:
#	tests/golden_master_audit/12_scan_output_snapshots/gpu_json.json
#	tests/golden_master_audit/12_scan_output_snapshots/llm_brief.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/gpu_json.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/llm_brief.json
Merged origin/main (incl. #9263's Python bless) and the Go time/sleep branch (#9265), took main's
fixtures for the conflicts, and regenerated with crucible_check.py --update --yes in clean venvs.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvgGYqVYmsdY3wcgsrQ
@squid-protocol squid-protocol changed the title #8868 Batches B and C: Go/C/Rust/JS/TS rules count what their contracts name (Part of #8868) #8868 Batches A, B and C: Go/C/Rust/JS/TS rules count what their contracts name (Part of #8868) Nov 25, 2026
# Conflicts:
#	tests/golden_master_audit/12_scan_output_snapshots/gpu_json.json
#	tests/golden_master_audit/12_scan_output_snapshots/graph_sqlite.json
#	tests/golden_master_audit/2_global_ecosystem_summary/file_composition_distribution.json
#	tests/golden_master_audit/2_global_ecosystem_summary/function_archetype_distribution.json
#	tests/golden_master_audit/2_global_ecosystem_summary/summary.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/2_topological_coordinates/x.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/2_topological_coordinates/z.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/5_function_analysis/_values.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/gpu_json.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/graph_sqlite.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/file_composition_distribution.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/function_archetype_distribution.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/summary.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/2_topological_coordinates/x.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/2_topological_coordinates/z.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/5_function_analysis/_values.json
@squid-protocol
squid-protocol marked this pull request as ready for review November 25, 2026 12:19
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

This PR conflicts with main, so no checks ran. Merge origin/main into it and regenerate generated files with their tools (never hand-merge them), then push.

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Nov 25, 2026
Main moved four commits; only the golden fixtures conflicted, so main's were taken and regenerated with
crucible_check.py --update --yes in clean venvs. Same files and languages as the previous bless.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvgGYqVYmsdY3wcgsrQ
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (352388a) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then). Until then it is a draft and runs the cheap audits only; re-adding the label marks it ready, which starts the full set on that head.

@squid-shepherd
squid-shepherd Bot marked this pull request as draft November 25, 2026 12:21
@squid-shepherd squid-shepherd Bot added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md labels Nov 25, 2026
@squid-protocol
squid-protocol marked this pull request as ready for review November 25, 2026 12:55
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

squid-protocol and others added 4 commits November 25, 2026 08:14
…he two Rust DOOM ports (Part of #8868)

CI on #9267 found four real consequences of the intended rule changes:
- test_go_java_leading_boundary_4108: time.Sleep no longer counts as time (it is a timed wait); the case moves to a
  "timed waits are not time" test (time.Sleep, time.After, NewTicker).
- test_rule_overlap_guard_8010: setTimeout is now shared by concurrency+thread_sleeps only (it left time_date_logic).
- test_typescript_strict (double-classification sweep): clearTimeout is cleanup alone; setTimeout is not time.
- DOOM-rosetta goldens for room4doom and rust-doom: the Rust closure / short_circuit rules change the complexity inputs,
  so 56+ function hashes move (109 file-level changes, no verdict change). Unmodified origin/main checks clean on both
  ports, so the drift is this change's. Blessed with doom_rosetta_check.py --only room4doom,rust-doom --update --yes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvgGYqVYmsdY3wcgsrQ
…ses (Part of #8863)

#9291 merged with `bash heavy-run.sh` in a subprocess and no platform check, so
tests/test_shell_tests_platform_guard.py fails on main and on every PR's merge ref. The nightly is a Linux-box
job (heavy-run.sh needs flock(1)); on any other platform it now says so and exits 0.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvgGYqVYmsdY3wcgsrQ
(cherry picked from commit 0177861)
# Conflicts:
#	tests/tools/family_sweep_nightly.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant