Skip to main content

Module serialization

Module serialization 

Source
Expand description

Callee-text classification for serialization boundary calls.

Detects (de)serialization calls with anchored receiver names:

  • TypeScript / JavaScript: JSON.parse(…), JSON.stringify(…), structuredClone(…).
  • Python: json.loads(…), json.dumps(…), json.load(…), json.dump(…), pickle.loads(…), pickle.dumps(…).
  • Go: json.Marshal(…), json.Unmarshal(…), json.MarshalIndent(…), json.NewEncoder(…), json.NewDecoder(…).

§CALL_DISPATCH slot

Registered at P3 — below testing (P2) and above schema_validation (P4). Receiver-anchored and specific: resolves before broader categories.

§Design: receiver-anchored only

Bare .parse( is intentionally not matched — it collides with schema validators (schema.parse) and config parsers. Only calls whose receiver is JSON, json, or pickle are classified here.

§Seeds forward

Protobuf/Avro/MessagePack codecs and ORM serialize hooks are adjacent; defer until requested.

Constants§

NODE_KINDS
Tree-sitter node kinds for serialization patterns.

Functions§

matches_callee
Return true when text looks like a (de)serialization boundary call.