From f9dcec7369d83c9935cbdd69f6764f7570d54d11 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 01:11:35 +0000 Subject: [PATCH] fix(infra): restore canonical_json_bytes non-ASCII behavior and dataset_ingest list safety - canonical_json_bytes now delegates to canonical_json (ensure_ascii=False) matching the original per-file implementations in emitter and loopback - dataset_ingest_rds.py restores isinstance(data, list) safety check from original load_jsonl, wrapping lib.jsonl.load_json Co-Authored-By: Allaun Silverfox --- 4-Infrastructure/lib/jsonl.py | 2 +- 4-Infrastructure/shim/dataset_ingest_rds.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/4-Infrastructure/lib/jsonl.py b/4-Infrastructure/lib/jsonl.py index 025361b3..614e2b2e 100644 --- a/4-Infrastructure/lib/jsonl.py +++ b/4-Infrastructure/lib/jsonl.py @@ -42,4 +42,4 @@ def canonical_json(obj: Any) -> str: def canonical_json_bytes(obj: Any) -> bytes: """Deterministic JSON as bytes — suitable for hashing.""" - return stable_json(obj).encode("utf-8") + return canonical_json(obj).encode("utf-8") diff --git a/4-Infrastructure/shim/dataset_ingest_rds.py b/4-Infrastructure/shim/dataset_ingest_rds.py index afc71d49..6adaa67d 100644 --- a/4-Infrastructure/shim/dataset_ingest_rds.py +++ b/4-Infrastructure/shim/dataset_ingest_rds.py @@ -30,7 +30,13 @@ import psycopg2.extras from rds_connect import connect_rds sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) -from lib.jsonl import load_json as load_jsonl +from lib.jsonl import load_json + + +def load_jsonl(path: Path) -> list: + """Load a JSON file; return its contents if a list, else [].""" + data = load_json(path) + return data if isinstance(data, list) else [] logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")