Skip to content

serialization_parsing: the contract says JSON/YAML/XML/CSV/protobuf, the Python rule matches only pickle/marshal/literal_eval (0 of 72,044 functions fire, 699 call a codec) #8882

Closed

Description

@squid-protocol

What is wrong

The contract for serialization_parsing (gitgalaxy/standards/signal_contracts.py, declared) is:

A call that encodes to or decodes from a structured interchange format -- JSON, XML, YAML, CSV, protocol buffers, a marshal or unmarshal -- at its invocation

The Python rule matches only pickle.load(s), pickle.Unpickler, marshal.load(s) and ast.literal_eval (the unsafe subset). So arch_serialization fires in 0 of 72,044 functions of GitGalaxy's own Python code, while a parser sees an encode or decode call in 699 of them (json.dumps 978 call sites, json.loads 416, yaml.safe_load 105, json.load 54, json.dump 30, ...).

Reproduce

import json

def encode(x):
    return json.dumps(x)      # arch_serialization == 0, the contract says it counts

def decode(s):
    return json.loads(s)      # 0

Expected

Either the rule covers the contract (JSON, XML, YAML, CSV, protobuf and marshal/pickle, per language's own libraries) or the contract is narrowed to what the rule does and a separate family is named for benign interchange. This also settles question 1 in #8862: the contract already says JSON counts.

Notes

Only Python was measured. The other languages' serialization_parsing rules have not been scored; the keyword-family grid (#8876) shows them as untested. The Python rule's comment calls the family unsafe deserialization, so the code and the contract disagree about what the family is for.

Part of #8863. Time the change (CPU seconds on keyword-rosetta and language-crucible); rosetta:rebless-owed if counts move; add the cases above as a test.

Activity

  1. added
    bug
    python
    core-engine
    on Nov 21, 2026
  2. squid-protocol commented on Nov 21, 2026

    @squid-protocol
    OwnerAuthor

    Claimed by promoter-bot host melek, lease renewed 2026-11-21T13:38Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:melek label.

  3. added a commit that references this issue on Nov 27, 2026
    73e02ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclaim:melekcore-enginepriority: mediumpython

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions