CodeSampleX

Exemple

verify orjson in pkg:pypi/orjson@3.11.9

sha256:dfa11ced15e7231c7513060568f95b1f15b2829ea98b6bc45771c47b1738f211

Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré. Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes. MIT-0

Preuves d'exécution

L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.

Base de preuve
Contrat signé réussi
Reçus de vérification
1
Clés de signature qui l’ont compilé
1
Environnement déclaré python linux x64 python python pip

Environnements des exécutions de vérification

Environnement Contrat Étapes Exécution
python 3.12 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1python:3.12-alpine@sha256:d09d15e60962…
2026-08-28

Cas

HOW
Objectif
verify orjson in pkg:pypi/orjson@3.11.9
Paquets
Symboles
  • orjson
  • orjson.dumps
  • orjson.loads
  • orjson.OPT_INDENT_2
  • orjson.OPT_SORT_KEYS
  • orjson.OPT_NON_STR_KEYS
  • orjson.OPT_UTC_Z
  • orjson.OPT_APPEND_NEWLINE
  • orjson.OPT_PASSTHROUGH_SUBCLASS
  • orjson.OPT_PASSTHROUGH_DATACLASS
  • orjson.OPT_PASSTHROUGH_DATETIME
  • orjson.OPT_STRICT_INTEGER
  • orjson.Fragment
  • orjson.JSONDecodeError
  • orjson.JSONEncodeError
Environnement
python
Créé
2026-08-28T06:45:20Z

Contrat

  1. assert orjson.dumps strictly returns bytes and rejects standard library keyword arguments with TypeError
  2. assert formatting and sorting require bitwise-ORed option integer bitmasks (OPT_INDENT_2, OPT_SORT_KEYS, OPT_APPEND_NEWLINE)
  3. assert non-string dict keys raise JSONEncodeError/TypeError by default and require OPT_NON_STR_KEYS
  4. assert dataclasses, datetime, and uuid.UUID are natively serialized without custom serializers
  5. assert primitive subclasses, dataclasses, and datetimes bypass the default serializer hook unless OPT_PASSTHROUGH_* flags are enabled
  6. assert non-finite floats (NaN, Inf, -Inf) are serialized to JSON null conforming to RFC 8259
  7. assert OPT_STRICT_INTEGER allows integers within 53-bit range while integers exceeding 2**53-1 raise JSONEncodeError/TypeError
  8. assert orjson.Fragment embeds pre-serialized JSON buffers and raises TypeError during dumps if content is not bytes or str
  9. assert orjson.loads accepts bytes, bytearray, memoryview, and str while rejecting streams and UTF-8 BOM headers with JSONDecodeError
  10. assert orjson.JSONDecodeError subclasses ValueError and json.JSONDecodeError, and JSONEncodeError subclasses TypeError

Fichiers

  • NOTES.md
  • PROMPT.md
  • csx.json
  • requirements.txt
  • spec.json
  • src/__init__.py
  • src/serializer.py
  • test/contract.py

Télécharger l’artefact source (tar.gz)

Seeder d'origine

anonyme