Skip to content

python serialization_parsing: cover the contract's codecs (JSON/YAML/XML/CSV/protobuf) - #8894

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/8882-20261121T1342Z
Nov 21, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/8882-20261121T1342Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #8882

What changed

The Python serialization_parsing rule matched only pickle.load(s), pickle.Unpickler, marshal.load(s) and ast.literal_eval, so json.dumps / json.loads / yaml.safe_load fired 0 times against a contract that names JSON, XML, YAML, CSV, protobuf and marshal (encode and decode). The rule now covers the contract (decision: widen the rule, not narrow the contract; this also settles question 1 in #8862):

  • JSON (json/ujson/orjson/simplejson .load(s) / .dump(s)), YAML (yaml.[safe_|full_|unsafe_]load/dump[_all]), XML (ElementTree/ET/etree/minidom parse, fromstring, tostring, parseString), CSV (reader, writer, DictReader, DictWriter), protobuf (ParseFromString, SerializeToString, json_format.*), pickle/marshal load and dump, ast.literal_eval.
  • Call-anchored on the module name: myjson.loads, json_data, import json do not match. Flat alternation, no nested quantifiers.
  • embedded_python (same family, same mechanism) gains json.loads?/dumps? beside its ujson forms.

Class / Sibling gaps

Class: a serialization_parsing rule narrower than its declared contract. Members handled here: python and embedded_python (each with positive tests per format and direction, and negatives for aliases and non-calls).
Sibling gaps: about 40 other languages' serialization_parsing rules are unscored against the contract (for example ruby JSON.parse|YAML.load|Marshal.load|Nokogiri lacks encode and CSV, lua, javascript JSON.* only, shell jq|yq|xmlstarlet); the keyword-family grid (#8876) shows them as untested. No burned-estate program needs them (these are non-mainframe languages): scope is sweep, one language-family audit each. Why not here: different languages, different libraries, and the 5-file limit.

Golden re-bless (why output changed)

Blessed via golden-lock.sh crucible_check.py --update --yes (both legs). The drift is arch_serialization counts in the Python corpus (fastapi tests and others: Expected 0, Got N) plus the derived function and file cluster centroids, drift-centroid distance, and the llm_brief/gpu_json/graph_sqlite snapshots that carry them. rosetta:rebless-owed if the keyword-rosetta python counts move.

Gates

  • strict tests: 272 passed (python and embedded_python)
  • pr_gates --fast: 9/9 pass; --ratchets: 9 pass, 0 fail, 0 skipped
  • Timing: the change replaces one four-name alternation with a flat alternation; no nesting, no new quantifiers. I did not measure keyword-rosetta CPU seconds separately.

🤖 Generated with Claude Code

…protobuf codecs (Closes #8882)

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 Nov 21, 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 21, 2026 14:13
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 21, 2026 14:16
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd
squid-shepherd Bot merged commit 73e02ab into main Nov 21, 2026
123 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/8882-20261121T1342Z branch November 21, 2026 15:35
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

1 participant