Repository navigation
Phase 2: .theos v2 binary format - #4
Merged
Merged
Conversation
- docs/spec/theos-v2.md: signature, CRC-protected header and chunks, critical/ancillary chunk rule, fixed-width little-endian records, annotated hex example - Encoder/decoder in src/core/binary.cpp: deduplicated string table, expression DAG with children-before-parents ordering, nodes, edges, axioms, definitions, objections and proofs - Reader rejects any out-of-range offset or index, bad CRC, non-zero padding, repeated or unknown critical chunks, and over-deep nesting - theosc build / inspect / inspect --chunks (chunk table + hex view) - Tests: round trip of every example, byte-stable golden file, every single-byte corruption and every truncation detected, line-ending conversion caught by the signature, chunk forward-compatibility rules - libFuzzer targets for the decoder and the parser, run 60 s each in CI - Clang CI moves to Clang 19 (libstdc++ std::expected support) - context.md removed (superseded by the v2 spec) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019WEmxyo9CRKSbjbEdCuJTG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019WEmxyo9CRKSbjbEdCuJTG
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3. Implements Phase 2 of
ROADMAP.md.docs/spec/theos-v2.md: PNG-style signature, CRC-protected header and chunks, critical/ancillary chunk rule, fixed-width little-endian records referencing each other by index, and an annotated hex example checked against real output.src/core/binary.cpp): deduplicated strings, an expression DAG where children always come before parents (so decoding is one forward pass and cannot loop), plus nodes, edges, axioms, definitions, objections and proofs. Every offset and index is bounds-checked; padding must be zero; nesting depth is capped.theosc build,theosc inspect,theosc inspect --chunks(chunk table + hex view).Tests include flipping every byte of an encoded file and checking each corruption is detected. Verified: removing the padding check makes the test fail at a padding byte. They also cover every truncation, CRLF conversion caught by the signature, and the unknown-chunk rules.
Toolchain finding: Clang 18 cannot see
std::expectedin libstdc++ 13 (__cpp_concepts201907), and mixing libc++ with libFuzzer's libstdc++ runtime caused an ASan alloc-dealloc mismatch. The Clang CI job and the fuzzers therefore use Clang 19.Generated by Claude Code