Skip to content

Haskell calls_out: juxtaposition and constructor application (Part of #6454) - #6499

Closed
squid-protocol wants to merge 4 commits into
mainfrom
churn/6454-20261024T1609Z
Closed

squid-protocol wants to merge 4 commits into
mainfrom
churn/6454-20261024T1609Z

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Part of #6454 (Haskell slice after the Dart slice, #6473).

What changed

Haskell calls have no parentheses, so the calls_out rule now also recognises juxtaposition application (f x y, f (g x); tree-sitter apply/variable, apply/apply) and constructor application (Just x; apply/constructor, contract C3). A head counts when it follows an operator, bracket, do/then/else/in/case, or starts a body line, and an argument-start token follows it. The rule now has two groups (paren-call name, juxtaposition head); the detector already takes the first non-empty group.

  • haskell.py: new rule; _calls_out_masked_blocks blanks type signatures (and continuation lines); the pattern guard (Left e -> ..., f (Foo a) = ...) stops patterns reading as calls; the head is anchored with a prime-aware lookbehind rather than \b (a long a'b'b'... identifier was quadratic, found by the ReDoS test).
  • detector.py: return, try, catch, finally are exempt from the global keyword ignore for haskell (they are ordinary functions).
  • Test: test_calls_out_haskell_juxtaposition_6454.py; test_haskell_strict.py::test_haskell_calls_out updated for two groups.
  • docs/calls_out_rule_contract.md haskell row; call_graph_accuracy_baseline.json regenerated; graph_comparison_ledger.json spliced for haskell/ entries only (timestamps unchanged elsewhere) to keep the overlap with Import graph: Swift rule (C7) and swift-argument-parser corpus entry (Part of #3798) #6486 small.

Measurement (call_graph_accuracy, haskell/pandoc, 142 functions)

Precision 44.2% -> 65.5%, recall 30.8% -> 78.4% (TP 103 -> 262, FP 138, FN 231 -> 72).

Golden drift

Only the haskell/pandoc group of calls_out_to moves (checked by key diff on both fixtures), plus the fan_in/fan_out/pagerank/graph/llm_brief values derived from it. Blessed via golden-lock.sh crucible_check.py --update --yes.

Gates

pr_gates --fast 7/7, --ratchets 9/9, audit_check.py clear, tree_sitter_accuracy_audit --lang haskell --ci OK, tri_comparison_chart --all --ci OK, call_graph_accuracy --ci OK, pinned ruff 0.17.1 format clean, new test passes under plain pytest from /tmp.

Class / Sibling gaps

Class: positional-application call heads in languages with no call parentheses (Haskell here). Fixed: apply/variable, apply/apply, apply/constructor shapes.
Sibling gaps (none needed by a burned estate):

  • infix/- and infix/-+generic: f $ x, E.throwIO $ X heads (16 FN on pandoc).
  • Names bound by patterns, let and where still count as callees (outside-ts-function 64, inner-named-function 50 FP); a separate defect.
  • apply/qualified residue (T.singleton '\n', BL.writeFile f x), guard-line heads (| null (f x)), heads after , in lists.
  • Other positional-application languages (ocaml, fsharp, elm, purescript) are unmeasured for this shape.
  • call_graph_accuracy_baseline.json also moved for dart (recall 95.0 -> 99.0) because Dart calls_out: generic invocations f<T>(x) and nullable type arguments (Part of #6454) #6473 did not refresh it; included since --regenerate rewrites the file. The dart/C ledger entries were left alone.

Cross-repo

keyword-rosetta (haskell control folder): this change makes calls_out_to find real calls in the planted probes (probeIo -> readFile, probeRisk -> die, probeTest -> hspec, probeSafety -> fromMaybe, probeState -> modifyIORef, probeBypass -> fromJust, probeTelemetry -> logInfo, probeCleanup -> hClose); the manifest still expects [], so rosetta-audit reports 8 haskell mismatches. They are correct under contract C2 (built-ins are calls). Merge order: this engine PR first (labelled rosetta:rebless-owed per docs/self_scan/ROSETTA_AUDIT.md; the audit's only regression is these 8 haskell probes, shell is pre-existing drift), then a keyword-rosetta PR against engine main re-blessing the haskell expected calls_out_to for data/haskell/{main,a,b,c}.hs (companion: to be opened after this merges, since its verify.yml checks out engine main). Re-run keyword-rosetta verify.yml after; nothing to re-run here.

Checklist

Checklist: partial [c:e595dbf8] -- infix/- (f $ x) heads, apply/qualified residue (T.singleton), guard-line and list-element heads (next: #6504)
Checklist: partial [c:39d03c20] -- constructor heads behind $ and qualified constructors (next: #6504)

Lessons for agents

  • A \b before an identifier that may contain ' is quadratic on a'b'b'...: anchor with (?<![ID_CONTINUE']) instead.
  • call_graph_accuracy.py --ledger rewrites every entry's last_reconciled_at and any other language's drift; splice only the language's entries to keep the diff small.
  • The literal shield turns backtick operators into "", so an infix a \div` blooks likea "" b` to a rule.

🤖 Generated with Claude Code

squid-protocol and others added 2 commits October 24, 2026 12:25
…6454)

The haskell rule now captures heads of `f x`, `f (g x)` and `Just x` by position
(after an operator, bracket, do/then/case, or at a body line start) plus an
argument-start token; type signatures are masked, return/try/catch/finally are
calls, and pattern lines bind rather than call. pandoc: P 44.2 -> 65.5, R 30.8 -> 78.4.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…6454)

Only the haskell/pandoc group of calls_out_to moves, plus the fan_in/fan_out/pagerank and
graph snapshots derived from it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 24, 2026 16:41
@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 16:50
@squid-protocol

Copy link
Copy Markdown
Owner Author

PR #6499 @ de1cd61: 2 failed check(s)

== crucible-audit (full-precision) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40112711519/job/120927597721
repro: tests/tools/box/golden-lock.sh python tests/tools/pr_gates.py --only golden
failing tests: tests/test_golden_crucible.py::test_golden_crucible_matches_baseline
errors:
FAILED tests/test_golden_crucible.py::test_golden_crucible_matches_baseline - Failed: Structural drift detected against golden_master_audit (132 differences):
##[error]Process completed with exit code 1.
log tail:
│   ├── gitgalaxy
│   ├── github-action-readme.md
│   ├── mkdocs.yml
│   ├── muninn.yml
│   ├── pyproject.toml
│   ├── scripts
│   ├── site
│   ├── templates
│   ├── tests
│   └── zizmor.yml
└── language-crucible
├── AGENTS.md
├── ANTIGRAVITY.md
├── CLAUDE.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASING.md
├── SECURITY.md
├── SOURCES.md
├── data
├── raw_output
└── tools
14 directories, 25 files
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/1474f752-1ce5-4da8-9b28-1a1063333802' 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

== crucible-audit (zero-dependency) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40112711519/job/120927597798
repro: tests/tools/box/golden-lock.sh python tests/tools/pr_gates.py --only golden
failing tests: tests/test_golden_crucible.py::test_golden_crucible_matches_baseline
errors:
⚠️ MISMATCH at /6. Parsed Files (Scanned Artifacts)/cobol/che-che4z_nist_ccvs85/Files/cobol/che-che4z_nist_ccvs85/NC2394.2.cbl/11. Scan DB Snapshot/PageRank/FAIL@231: Expected 0.000105, Got 0.000104
⚠️ MISMATCH at /6. Parsed Files (Scanned Artifacts)/cobol/che-che4z_nist_ccvs85/Files/cobol/che-che4z_nist_ccvs85/IC2344.2.cbl/11. Scan DB Snapshot/PageRank/FAIL-ROUTINE@307: Expected 1.9e-05, Got 1.8e-05
⚠️ MISMATCH at /6. Parsed Files (Scanned Artifacts)/zig/zig/Files/zig/zig/Compilation.zig/11. Scan DB Snapshot/PageRank/fail@1892: Expected 0.000741, Got 0.00074
2026-10-24 16:45:23,906 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
FAILED tests/test_golden_crucible.py::test_golden_crucible_matches_baseline - Failed: Structural drift detected against golden_master_zero_dep_audit (132 differences):
##[error]Process completed with exit code 1.
log tail:
│   ├── gitgalaxy
│   ├── github-action-readme.md
│   ├── mkdocs.yml
│   ├── muninn.yml
│   ├── pyproject.toml
│   ├── scripts
│   ├── site
│   ├── templates
│   ├── tests
│   └── zizmor.yml
└── language-crucible
├── AGENTS.md
├── ANTIGRAVITY.md
├── CLAUDE.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASING.md
├── SECURITY.md
├── SOURCES.md
├── data
├── raw_output
└── tools
14 directories, 25 files
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/169b770d-290f-4a11-b2d7-261f3a9e4ed0' 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-protocol squid-protocol added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

squid-protocol and others added 2 commits October 24, 2026 12:59
Merging origin/main (the cpp and powershell call-graph and class_start changes) moves
PageRank values in the 5th decimal across php/rust/etc; only pagerank.json changes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@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 Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol squid-protocol removed the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

PR #6499 @ 76b217f: 1 failed check(s)

== rosetta-audit (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40114431834/job/120932684888
repro: no local equivalent; read the check page
errors:
REG haskell FAIL haskell: 8 mismatch(es)
pre shell FAIL shell: 6 mismatch(es)
##[error]haskell: this build moves the control corpus -- FAIL haskell: 8 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.55.0
Temporarily overriding HOME='/home/runner/work/_temp/08b8f02b-c167-4430-9da9-88826bf0eb69' 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.55.0
Temporarily overriding HOME='/home/runner/work/_temp/8520e303-0f92-4da9-b7da-b3fd180f08f3' 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-protocol squid-protocol added shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md labels Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol squid-protocol added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

Closing as superseded by #6504 (merged 2026-10-24 as d4d136d). That PR was stacked on this branch and was squash-merged into main with all of this PR's commits in it: haskell.py, detector.py, test_calls_out_haskell_juxtaposition_6454.py, test_haskell_strict.py and the contract row are identical on main. Merging main into this branch leaves no hand-written diff, only generated-file noise (ledger, calls_out_to, fan_out and pagerank snapshots) that must not land. The conflicts the gate reported come from that overlap.

Still owed (from this PR's Cross-repo note, now owed by main): a keyword-rosetta PR against engine main that re-blesses the haskell expected calls_out_to for the 8 probes in data/haskell/{main,a,b,c}.hs (readFile, die, hspec, fromMaybe, modifyIORef, fromJust, logInfo, hClose). They are correct under contract C2. The checklist items [c:e595dbf8] and [c:39d03c20] stay partial on #6454; see #6504's sibling gaps.

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

Labels

rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant