Skip to content

TypeScript keyword families: io, closures, bitwise_ops, thread_sleeps read their contracts (Part of #8863) - #9318

Closed
squid-protocol wants to merge 12 commits into
mainfrom
churn/8863-20261125T1731Z
Closed

squid-protocol wants to merge 12 commits into
mainfrom
churn/8863-20261125T1731Z

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Part of #8863

Checklist: partial [c:typescript] (five red cells fixed; doc still reads 0.764 precision, see below)

What changed

TypeScript keyword families re-read against their contracts, scored on the pinned language-crucible (v1.9.0, re-swept after the pin bump #9307):

cell before (P / R) after (P / R) n oracle
bitwise_ops 0.805 / 0.071 0.935 / 0.911 1287
closures 0.598 / 0.498 0.832 / 0.978 910
io 0.054 / 0.429 1.0 / 1.0 7
thread_sleeps 0.643 / 1.0 1.0 / 1.0 18
decorators 0.0 / 0.0 0.5 / 0.5 2 (under the 10-function floor, no longer red)
doc 0.58 / 1.0 0.764 / 1.0 557 (still red, precision)
time_date_logic already green at re-measure (6 oracle functions)
  • io: operative forms only (fetch(, fs., axios, XMLHttpRequest, web storage, child_process, http.get/request/..., require('fs'|'net'|...), bare readFile/writeFile/createRead|WriteStream); path.* and the bare word fs no longer count.
  • closures: anonymous callables only; type-position arrows are excluded and the unit's own leading arrow is skipped via (?!\A).
  • decorators: a decorator in operative position (line start, or after ( , ; { }), so @ inside strings, emails and template literals no longer counts.
  • thread_sleeps: get delay() / set delay() / function delay declarations excluded; Atomics.wait added.
  • bitwise_ops: & and | count between value operands, not in type position (A | B, string | number).
  • Oracle (tests/tools/family_oracle_ts.py): reads a doc above export function / export const f = ..., and counts parameter decorators. Both were oracle misses, not engine faults.

Plan correction: time_date_logic was already green, and the oracle needed two fixes the plan did not list.

Evidence

  • 52 new rule and oracle tests in tests/test_typescript_family_validity_8863.py.
  • Baseline regenerated with family_oracle_sweep.py --write, restricted to the typescript cells; SVGs regenerated. No other language's cell moved.
  • Goldens blessed via golden-lock.sh crucible_check.py --update --yes, after merging main (Swift keyword families: closures, decorators and thread_sleeps read their contracts (Part of #8863) #9312 swift). The drift is TypeScript only: bitwise, closures, decorators, io and sleeps signal parts, plus the function-archetype distribution and repository fingerprint parts that read them.
  • CPU time on language-crucible/data/typescript, three alternating runs, one worker: base 30.86 / 31.69 / 31.57 s, branch 31.36 / 31.54 / 31.49 s. No slowdown.
  • audit_check.py clean; pr_gates.py --fast 9/9.

Cross-repo

Companion: keyword-rosetta. Its TypeScript plant data/typescript/main.ts probeIo uses the bare identifiers fetch, axios, fs (expects io 3); the branch reads 1 (axios). verify_language.py typescript shows that mismatch on this branch and not on main. Merge this PR first, then change the plant to operative forms (fetch(url), fs.readFileSync(p)); label rosetta:rebless-owed. The two calls_out_to mismatches it also prints (probeSafety, probeTest) are on main too.

Class / Sibling gaps

  • TypeScript doc precision is 0.764: the engine's doc anchor window is 5 lines above the unit, so a docblock over a field, a parameter or an enclosing export const is attributed to the next function. That is an engine constant shared by every language, not a TypeScript rule.
  • decorators has two oracle functions in the crucible; the cell is not measurable until a corpus with decorated TypeScript is pinned.
  • Known limits of the new rules: a type alias arrow (type X = (a) => T) still counts as a closure; a multi-line bitwise expression with a trailing | at line end is not caught; a decorator above a getter lies outside the function slice; the oracle's bitwise list lacks >>>.
  • JavaScript shares these shapes (closures, io, thread_sleeps) and was not touched.

Not in this PR

The doc window fix, the keyword-rosetta plant change, JavaScript.

Lessons for agents

  • The sweep's --db takes a scan of <crucible>/data, not a subtree: a scan of one language's folder scores 0 matched.
  • family_oracle_sweep.py --write rewrites every language's cells, including ones that moved on main since the baseline was written; keep only your language's cells and re-dump with indent=1, sort_keys=True.
  • Offline scoring runs on raw text, so it understates precision against the engine, which sees prism-stripped text.

🤖 Generated with Claude Code

@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
squid-shepherd Bot marked this pull request as ready for review November 25, 2026 19:55
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 25, 2026 19:56
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #9318 @ e03404f: 1 failed check(s)

== rosetta-audit (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/45690009888/job/139472634880
repro: no local equivalent; read the check page
errors:
pre python FAIL python: 1 mismatch(es)
REG typescript FAIL typescript: 1 mismatch(es)
##[error]typescript: this build moves the control corpus -- FAIL typescript: 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/9f5f867c-3d3b-4e9b-8574-9095c32aa235' 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/811d757b-1e59-405a-a5cb-46c6ab0403d2' 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 disabled auto-merge November 25, 2026 20:01
@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
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 25, 2026 20:02
@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 25, 2026
@squid-shepherd
squid-shepherd Bot disabled auto-merge November 25, 2026 20:02
@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 25, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 25, 2026 20:03
@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 25, 2026
@squid-shepherd
squid-shepherd Bot disabled auto-merge November 25, 2026 20:04
@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 25, 2026
@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 25, 2026
@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 25, 2026
@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 (4d48146) 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 20:50
@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 shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md labels Nov 25, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

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

squid-shepherd Bot pushed a commit that referenced this pull request Nov 25, 2026
…ersedes #9313 #9318 #9323) (#9325)

* fold #9313, #9318, #9323: hand-written changes (Go, TypeScript, Crystal); goldens follow in the bless commit

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

* rebless: one bless for the folded Go, TypeScript and Crystal changes

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

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
@squid-protocol

Copy link
Copy Markdown
Owner Author

Superseded by merged #9325 (one rebless for Go/TypeScript/Crystal).

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