Skip to content

fix(standards): io counts boundary operations — one owner, one statement, one boundary (#2841 contract, roadmap Phase 3) - #2844

Merged
squid-protocol merged 2 commits into
mainfrom
fix/2841-io-contract
Sep 7, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
fix/2841-io-contract

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

Phase 3 of the contract roadmap (docs/contract_roadmap.md, epic #2812): the io family. Closes #2841.

The contract

One hit is an operation that moves data between the program and a system outside its own runtime — a file, stream, socket, device, terminal, or external data store — expressed in a form an ordinary identifier cannot match.

Full sentence, five corollaries, the 46-language audit table and the ledger dispositions: docs/io_rule_contract.md. Sheet row io → stated (5/68); signal_contract_audit.py --ci green with a smaller baseline; cross-language pins in tests/extraction/languages/test_io_contract_2841.py (CASES / COUNTS / single-owner checks / ReDoS detonations).

What was wrong (the 4 open-defect cells, 4 different diseases)

cell was disease corollary
javascript 4 bare \bpath\b counted probeIo's own path parameter (ledger identifier-name-token-collision) ambiguity C1
jcl 5 one //DD1 DD DSN=…,DISP=SHR fired twice (DSN + DISP=), and the &&temp teardown DDs counted token-counting C4/C5
sqlite 9 every DML keyword was "io" — the decoys other signals plant leaked in — plus .read dual with import (ledger sqlite-dot-read-dual-import-io) boundary + dual C3/C2
tcl 7 source claimed by import+io, close by cleanup+io (ledger batch4-dual-keyword-overlaps) duals C2

17 rules edited. The close-family release forms leave io in abap, c, cobol, cpp, fortran, livecode, lua, matlab, perl, tcl, yacc — in every one, the language's cleanup rule already claimed the token, so each dual collapses to its owner with no mass lost (#2765's ENV/popdef shape). c and lua's ledgered probe-idiom io surpluses ("cannot be authored away") are authored away exactly there: close(0) / io.close(conn) are cleanup's hits alone.

Proof

  • rule_probe.py io all before → after: every corpus language reads io = 3 (was 4/5/9/7 on the four defects, 4/4 on c/lua). Crucible narrowings all attributed in the doc (assembly 230→90 is comment prose; sqlite 321→8 is DML; jcl 1590→884 is one-hit-per-DD).
  • rosetta_audit.py against the companion corpus branch: 46/46.
  • Golden masters blessed from the clean crucible; bless_scope.py: 482 diffs, all in per-file sections, leaf keys only I/O and Network Boundaries + Amplified Rce (the proximity pair that reads io positions) + its weighted view; newly parsed/excluded: none.
  • Full extraction suite 6904 passed (8 retired "intentional double-classification" pins flipped to the contract's semantics, each with a #2841 contract note). ruff/mypy/dead-key audits: no new findings; audit_check.py all clear.

Filed on the way

Cross-repo

Companion corpus PR: squid-protocol/keyword-rosetta#90 (rebless/gitgalaxy-2841-io) — manifests for the 6 moved languages, the jcl //DD5 DD SYSOUT=L and sqlite writefile/.output re-plants, ledger retirements (identifier-name-token-collision, sqlite-dot-read-dual-import-io), narrowing (probe-idiom-collides-with-measured-signal → haskell-only; batch4 loses tcl and the io token), and the new io-contract-2841 entry. This PR merges first (rosetta CI checks out engine main); the corpus PR goes green and merges after, and push-to-main regen republishes the bias report.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FCF3viid5wUh2dLqzfZ16v

…ent, one boundary (#2841 contract, roadmap Phase 3)

One io hit is an operation that moves data between the program and a
system outside its own runtime, in a form an ordinary identifier cannot
match (docs/io_rule_contract.md). 17 language rules edited on the five
corollaries:

- C1 ambiguity anchor: javascript bare path/https/database/sql out
  (probeIo's own `path` parameter was a hit), c calls paren-anchored,
  assembly in/out instruction-anchored, groovy lowercase generics out,
  dart types case-sensitive
- C2 one owner: source/.read/.import/ATTACH are import's; close-family
  release forms are cleanup's in abap/c/cobol/cpp/fortran/livecode/lua/
  matlab/perl/tcl/yacc (every one already claimed the token — the dual
  collapses, no mass lost)
- C3 boundary: sqlite DML is in-engine computation; io is readfile/
  writefile and the outbound dot-commands; abap's client DML stays
- C4 one statement one hit + C5 job-local temps: jcl counts DD
  statements allocating an external target, DSN=&& never counts

Sheet row io -> stated (5/68); signal_contract_audit baseline shrinks.
Cross-language pins: tests/extraction/languages/test_io_contract_2841.py.
Golden masters blessed; bless_scope: io + Amplified Rce (+ its weighted
view) only, no aperture crossing. rosetta_audit 46/46 against the
companion corpus branch: every language reads io = 3, closing the four
open-defect cells (javascript 4, jcl 5, sqlite 9, tcl 7) and the two
ledgered probe-idiom surpluses (c 4, lua 4).

Closes #2841

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FCF3viid5wUh2dLqzfZ16v
Golden masters re-blessed on the merged code (main's #2842 Mode E
function-population fix + this branch's io contract). bless_scope vs
main's masters: identical 482-diff scope — I/O and Network Boundaries +
Amplified Rce (+ weighted view) only, newly parsed/excluded none.
Extraction suite 6904 passed on the merge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FCF3viid5wUh2dLqzfZ16v
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol

Copy link
Copy Markdown
Owner Author

Conflicts with main resolved by merge commit 6055522: main's #2842 re-blessed the same golden masters. Resolution was a re-bless on the merged code, never a hand-merge — bless_scope against main's masters shows the identical 482-diff scope (I/O and Network Boundaries + Amplified Rce + its weighted view; newly parsed/excluded none). Extraction suite 6904 passed on the merge; rosetta_audit 46/46 against the refreshed corpus branch. Companion keyword-rosetta#90 refreshed the same way (report regenerated on the post-#2795 n/a base: open-defect share 38 → 34 of 2296, io zero ledgered cells).

@squid-protocol
squid-protocol merged commit 6f6a7d1 into main Sep 7, 2026
32 of 33 checks passed
@squid-protocol
squid-protocol deleted the fix/2841-io-contract branch September 7, 2026 14:25
squid-protocol added a commit to squid-protocol/keyword-rosetta that referenced this pull request Sep 7, 2026
…(roadmap Phase 3) (#90)

Every language now reads io = 3 (the median) under the stated contract
(gitgalaxy docs/io_rule_contract.md). Cells and plants:

- javascript main.js 4->3: bare `path` left the rule (C1); the collision
  probeIo's parameter documented is impossible now
- tcl 7->3: source is import's, close is cleanup's (C2)
- sqlite 9->3: DML is in-engine computation (C3), .read is import's;
  probe_io re-planted with writefile + .output beside readfile
- jcl 5->3: one DD statement is one hit (C4), DSN=&& temps are job-local
  (C5); third external allocation planted (//DD5 DD SYSOUT=L)
- c 4->3, lua 4->3: probe_cleanup's close idiom no longer double-counts

Ledger: `identifier-name-token-collision` and
`sqlite-dot-read-dual-import-io` resolved; `probe-idiom-collides-with-
measured-signal` narrowed to haskell's safety_bypasses slice; batch4
loses tcl and the io token; new `io-contract-2841` entry. Orphan
baseline regenerated.

Report regenerated at full precision against fix/2841-io-contract:
open-defect share 39 -> 35 of 2303 (1.5%), average consistency 92% ->
93%, io carries zero ledgered cells. rosetta_audit 46/46.

Cross-repo: engine PR squid-protocol/gitgalaxy#2844 merges first; this
branch goes green against engine main after.


Claude-Session: https://claude.ai/code/session_01FCF3viid5wUh2dLqzfZ16v

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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

Projects

None yet

1 participant