Skip to content

[experiment B] powershell functions missed in build scripts (Part of #4479) - #6385

Closed
squid-protocol wants to merge 1 commit into
mainfrom
experiment-b-3303
Closed

squid-protocol wants to merge 1 commit into
mainfrom
experiment-b-3303

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #3303. This PR is an A/B experiment arm (ARM B of #4479); it is not intended to merge as-is.

Root cause

The func_start and args rules in powershell.py required whitespace after a class method's return-type bracket (\]\s+). PowerShell allows [string]ToString() { and [array]GetTests() { with no space, so those methods were invisible. Reproduced against the pinned crucible with tests/tools/tree_sitter_accuracy_audit.py --lang powershell: core/build.psm1 and core/PowerShell__build.psm1 missed GetTests / ToString.

Fix

\]\s+ becomes \]\s* in both rules (2 lines). Audit result (current checkout, not regenerated): args_comparable 457 -> 473, args_exact_match 444 -> 460, extra_functions 0 -> 0, "no regressions".

Class / Sibling gaps

Class: a return-type bracket directly abutting the method name, for plain, generic, hidden, static and combined forms, in both func_start and args. Tests added to test_powershell_strict.py cover all of those forms plus negatives ([regex]::Match(...) {, [int]$x = Foo() {, [int]if (...) {, attributes). Sibling gap NOT fixed: 14 remaining audit "missing" entries are function script:Name declarations (script:Use-MSBuild, script:Write-Log, ...). GitGalaxy does extract them, under the scope-stripped name (Use-MSBuild), while tree-sitter names them script:Use-MSBuild, so the audit pairs them by name and calls them missing. That is a name-normalisation question in the audit, not an extraction miss, and needs its own decision (strip the scope in the audit, or keep it in the engine name).

Not run

Golden bless, crucible_check.py, the baseline regeneration for the tree-sitter accuracy baseline, and the full pr_gates ratchets were NOT run (experiment cost cap). The golden masters and tests/tree_sitter_accuracy_baseline_powershell.json will need a re-bless/regenerate before any real merge.

Tests: pytest tests/extraction/languages/test_powershell_strict.py test_powershell.py -> 164 passed; ruff format --check clean.

🤖 Generated with Claude Code

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