Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Auto-detect text files and normalize line endings to LF on commit and checkout
* text=auto eol=lf

# Conformance vector fixtures must preserve exact byte stability across
# platforms. Scope -text to the generated corpus only (packs/, capsules/,
# and the two JSON indexes) so the Python gates and README that enforce
# that stability stay under LF normalization themselves.
spec/vectors/packs/** -text
spec/vectors/capsules/** -text
spec/vectors/index.json -text
spec/vectors/capsules.json -text
6 changes: 3 additions & 3 deletions spec/vectors/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ def write_pack(
correct = pack_integrity(hashed_manifest, engram_bytes)

if integrity is True:
(d / "INTEGRITY").write_text(correct + "\n")
(d / "INTEGRITY").write_bytes((correct + "\n").encode("utf-8"))
shipped = correct
elif integrity is None:
shipped = None
else:
(d / "INTEGRITY").write_text(str(integrity) + "\n")
(d / "INTEGRITY").write_bytes((str(integrity) + "\n").encode("utf-8"))
shipped = str(integrity)

for rel, content in (extra_files or {}).items():
Expand Down Expand Up @@ -527,7 +527,7 @@ def main() -> int:

PACKS.mkdir(exist_ok=True)
vectors = build(PACKS)
INDEX.write_text(index_document(vectors), encoding="utf-8")
INDEX.write_bytes(index_document(vectors).encode("utf-8"))
print(f"Built {len(vectors)} vectors into {PACKS}")
return 0

Expand Down
2 changes: 1 addition & 1 deletion spec/vectors/build_capsules.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def main() -> int:
return 0

index = build(OUT)
INDEX.write_text(capsules_document(index), encoding="utf-8")
INDEX.write_bytes(capsules_document(index).encode("utf-8"))
print(f"Built {len(index)} capsule fixtures into {OUT}")
return 0

Expand Down
Loading