Files
alktype/docs/research
glm-5.2 f371fe4e94 Add BAST-native validator POC for validate_bytes
Implements the D-BAST-006 validation model as a self-contained module
(`src/bast_poc.rs`) that does not touch the production schema /
materializer / validator paths. Reuses only `data_access`,
`AlkTypeError`, and `Endian` — the BAST parser, packed-mode
materializer, and native validator are all from scratch, which is the
point: prove the model works end-to-end before refactoring.

The POC confirms the hypothesis from the pivot doc: a recursive walker
over the BAST type tree fully replaces the 19 custom keyword
validators on the `validate_bytes` path, recovers the OQ-008 union
variant dispatch, and fixes the enum-membership dead constraint on the
bytes path — all without `jsonschema` custom keywords and without an
external JSON Schema.

Coverage (20 tests, all passing):
- basic: chunk header, int8/uint32 ranges, string/bytes maxLength,
  timestamp, bool, short buffer
- hard: union byte-offset disc + maxLength inside variant (OQ-008),
  union field-name disc + maxLength inside variant, enum index-bounds
  fix, nested struct→union→struct, array of structs with count,
  record, untrusted-schema error-not-panic

Verification:
- cargo test --release (416 tests: 330 lib + 86 integration)
- cargo clippy --all-targets -- -D warnings
- cargo build --target wasm32-unknown-unknown --release
- cargo doc --no-deps

Findings and verdict recorded in docs/research/bast-pivot.md
§"POC Result — BAST-native validator".
2026-08-15 09:29:14 +00:00
..