Skip to content

PHP keyword families: bitwise_ops, io, debug_prints, time_date_logic count only their own construct (Part of #8863, #9337) - #9370

Merged
squid-shepherd[bot] merged 9 commits into
mainfrom
churn/9337-20261126T0515Z
Nov 26, 2026
Merged

squid-shepherd[bot] merged 9 commits into
mainfrom
churn/9337-20261126T0515Z

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Part of #8863. Implements #9337.

Checklist: done [c:925158e3]

What changed

PHP rules in languages/php.py now count only their own construct. Pinned crucible (language-crucible, 1721 PHP functions), weaker of recall / precision, before -> after:

cell before after
bitwise_ops precision 0.13 (190 fire) 0.89 / recall 1.00 (27 fire)
io 0.27 / 0.61 1.00 / 1.00
debug_prints precision 0.77 0.90 / recall 0.94
time_date_logic recall 0.79 0.92 / recall 1.00
decorators (wordpress, unpinned) precision 0.54 (80 fire vs 43) 0.97 / recall 1.00 (78 vs 76)
  • bitwise_ops: operator position only (operand before, space-separated, &&/|| excluded); by-reference &$x, as &$v, int|string union types and <<< heredocs no longer count; ~$x kept.
  • io: a static PDO::method( call (the keyword-rosetta plant) counts, PDO::ATTR_* does not; call-form list of the oracle's file/stream/DB functions plus new PDO / new mysqli; header, setcookie, bare socket, $_GET-style reads and PDO type hints no longer count.
  • debug_prints: echo/print statements and dump functions as calls; ->dump(), $print, Foo::print() and dl|dd|dt in regex strings no longer count.
  • time_date_logic: adds gmdate, mktime, gmmktime, microtime, hrtime, idate, getdate, strftime, date_diff/add/sub, DateInterval, DateTimeZone, DatePeriod; method calls and $time variables excluded.
  • decorators: #[ must not follow a quote, operand, # or / and must start with a name, so '#[0-9]{2}#' inside a regex string no longer counts (checked on the engine's stream: line-start and in-parameter attributes both count).

Goldens re-blessed with golden-lock.sh (both legs). Diff is PHP signal files only (bitwise, decorators, io, print, time) plus the repo-wide archetype rollups that follow from them. Baseline and validity charts regenerated. test_php_strict.py: the date_diff negative case became a method-call negative, and $_GET is no longer an io hit (see sibling gaps).

Class / Sibling gaps

  • decorators (wordpress, unpinned; the pinned crucible has under 10 attributed functions): the remaining 'false positives' were #[\SensitiveParameter] on a PARAMETER, which the engine counted and the PHP oracle ignored. A parameter attribute is an attribute on the declaration it precedes (the C# oracle already counts it), so the oracle was wrong: family_oracle_specs_b.py now counts it (closure parameters in the body still excluded; test in test_php_family_validity_8863.py). Re-measured on the wordpress scan: 78 fire vs 76 oracle, precision 0.97, recall 1.00.
  • Contract question for Epic: keyword-family validity -- do the per-function signals measure what their names say? #8863: is a superglobal read ($_GET, $_POST) or header()/setcookie() io? The oracle says no; the rule now agrees.
  • print_r($x, true) / var_export($x, true) return strings but still count (no argument parsing in a bounded regex); echo inside a heredoc template counts.
  • Line-start #[ attributes survive the prism stream (verified); no prism change needed.

Not in this PR: other languages, oracle changes.

Family-validity checklist

  • Cause class named per cell (another construct counted; missing callees)
  • Rules fixed at the construct, not the corpus; positive and false-positive forms in tests/test_php_family_validity_8863.py
  • Re-measured on the pinned crucible (table above); other PHP cells unchanged (branch, closures, args, doc, regex_execution, short_circuit green)
  • Goldens re-blessed and attributed to PHP
  • Rules linear on adversarial inputs (50k-char runs, under 0.2 s)

Facts checked

  • Four pinned red cells are green after family_oracle_sweep.py --write; family_red_cells.py --lang php lists only the hatched decorators cell.
  • ruff format --check, audit_check.py (all clear), pr_gates.py --fast (9/9) and --ratchets (9/9) pass. ruff check reports S101 on the new test, same as the C# template (baselined).
  • Merged origin/main (C keyword families C keyword families: bitwise counts & and |, debug_prints console only, panics call form, io oracle reads stream/fs calls (Part of #8863) #9367) and re-blessed on top.
  • Merged origin/main a second time (generated-file conflicts only: took main's, re-blessed both goldens with golden-lock.sh, regenerated the family-validity SVGs); pr_gates --ratchets 9/9 after it.
  • family_rosetta_consistency.py --live: PHP io now agrees with the manifest (the old 3-of-2 gap was PDO::query(, now counted). CPU: the five PHP rules over 600 wordpress files take 0.1-0.5 s each; 25k-char adversarial runs under 5 ms.
  • Merged origin/main a third time (generated-file conflicts only: took main's, re-blessed both goldens, regenerated baseline and charts); pr_gates --fast 9/9 and --ratchets 9/9 after it. The pinned sweep also moved one unrelated rust baseline row from tokio to the pinned crucible (tool output, not hand-edited).

Remaining slices

none: every PHP red cell is 0.8 or better (pinned cells on the crucible, decorators on wordpress).

Lessons for agents

  • scope_check.py diffs against a freshly fetched origin/main: a sibling merge in between shows up as "outside --expect"; git fetch and merge first, then re-bless.
  • A red cell whose corpus is hatched (not pinned) needs that corpus scanned locally (galaxyscope <data/wordpress> --db-only --file-speed --splicing-speed, then family_oracle.py DB --src DIR --lang X --corpus NAME --update-baseline); the cause can be the oracle (a parameter attribute), not the rule.
  • A strict test that pins an old behavior ($_GET as io, date_diff as negative) lives in tests/extraction/languages/test_<lang>_strict.py; run it after any rule change.

🤖 Generated with Claude Code

squid-protocol and others added 4 commits November 26, 2026 00:21
…and decorators count only their own construct (Part of #8863, #9337)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rts (Part of #8863, #9337)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and time_date_logic contract (Part of #8863, #9337)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ldens (Part of #8863, #9337)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 26, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 26, 2026 06:01
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 26, 2026 06:01
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd
squid-shepherd Bot disabled auto-merge November 26, 2026 06:06
@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #9370 @ b20aeb8: 1 failed check(s)

== rosetta-audit (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/45765321481/job/139724719966
repro: no local equivalent; read the check page
errors:
pre csharp FAIL csharp: 1 mismatch(es)
pre go FAIL go: 5 mismatch(es)
REG php FAIL php: 1 mismatch(es)
pre typescript FAIL typescript: 1 mismatch(es)
##[error]php: this build moves the control corpus -- FAIL php: 1 mismatch(es)
##[error]Process completed with exit code 1.
log tail:
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.1
Temporarily overriding HOME='/home/runner/work/_temp/fbd0ff1b-dc7c-423d-bc60-02b61dde227a' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy-baseline
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.1
Temporarily overriding HOME='/home/runner/work/_temp/fd39392b-b31c-4422-a06d-ffa9fa8d37e2' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@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 26, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Nov 26, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 26, 2026 06:06
@squid-shepherd squid-shepherd Bot added shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). 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 26, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot disabled auto-merge November 26, 2026 06:08
@squid-shepherd squid-shepherd Bot added shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md and removed shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md labels Nov 26, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

Waiting on an owner decision (asked privately, 2026-11-26). Nothing is needed from contributors; work resumes once it is answered.

@squid-shepherd squid-shepherd Bot added shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md and removed shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md labels Nov 26, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Nov 26, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 26, 2026 09:55
@squid-shepherd squid-shepherd Bot added the shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md label Nov 26, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 26, 2026 09:58
@squid-shepherd
squid-shepherd Bot disabled auto-merge November 26, 2026 10:03
@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #9370 @ 7e70322: 10 failed check(s)

== crucible (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/45795825826/job/139826447033
repro: tests/tools/box/heavy-run.sh python -m pytest -q tests/cics_crucible && tests/tools/box/heavy-run.sh python tests/tools/cics_crucible.py --ci --out /tmp/gitgalaxy-scratch/ci-digest/cics
log tail:
(log unavailable: gh: HTTP 404)

== db2 ${{ matrix.shard }} (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/45795825769/job/139826344534
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== full-suite (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/45795825911/job/139826346678
repro: python -m pytest -q tests
log tail:
(log unavailable: gh: HTTP 404)

== full-suite part ${{ matrix.group }}/${{ needs.shard-plan.outputs.splits }} (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/45795825911/job/139826346917
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== ground-truth (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/45795825567/job/139826417623
repro: python tests/tools/pr_gates.py --ratchets --only-ratchets ground-truth (when a ground-truth part failed too, run that part's repro)
log tail:
(log unavailable: gh: HTTP 404)

== publish-history (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/45795825567/job/139826417770
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== rosetta-audit (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/45796413820/job/139828090073
repro: no local equivalent; read the check page
errors:
pre csharp FAIL csharp: 1 mismatch(es)
pre go FAIL go: 5 mismatch(es)
REG php FAIL php: 1 mismatch(es)
pre scala FAIL scala: 1 mismatch(es)
pre typescript FAIL typescript: 1 mismatch(es)
##[error]php: this build moves the control corpus -- FAIL php: 1 mismatch(es)
##[error]Process completed with exit code 1.
log tail:
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.1
Temporarily overriding HOME='/home/runner/work/_temp/5d73a355-9087-462a-8f4e-6a3fc233b17b' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy-baseline
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.1
Temporarily overriding HOME='/home/runner/work/_temp/680f8fe1-482c-4fdd-954d-12deee9c4b9a' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

== shard ${{ matrix.shard }} (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/45795825769/job/139826345124
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== store the suite's durations (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/45795825911/job/139826346685
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== suite time budget (#5166) (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/45795825911/job/139826346856
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

@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 26, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 26, 2026 10:06
@squid-shepherd squid-shepherd Bot added shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). 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 26, 2026
@squid-shepherd
squid-shepherd Bot disabled auto-merge November 26, 2026 10:07
@squid-shepherd squid-shepherd Bot added shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md and removed shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md labels Nov 26, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 26, 2026 10:09
@squid-shepherd squid-shepherd Bot added shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). 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 26, 2026
@squid-shepherd
squid-shepherd Bot disabled auto-merge November 26, 2026 10:11
@squid-shepherd squid-shepherd Bot added shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md and removed shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md labels Nov 26, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 26, 2026 10:11
@squid-shepherd squid-shepherd Bot added the shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md label Nov 26, 2026
squid-protocol and others added 2 commits November 26, 2026 05:41
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…utes; decorators wordpress cell re-measured 0.97; re-bless (Part of #8863, #9337)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: shepherd:merge was added by @squid-protocol, who has no write access to this repository, so it was removed. Maintainers set these labels (docs/ci.md).

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant