Pre-publish docs sweep: README, AGENTS.md, licenses, inline doc fixes

- Add README.md reflecting the v0.1.0 state: 19 AlkType kinds, two
  layout modes, builder + AlkTypeEngine usage example (verified to
  compile and run), validation entry points, crate independence,
  untrusted-schemas guarantee, docs pointers. Mirrors the alkvault
  README structure.
- Add AGENTS.md with alktype-specific git workflow, project
  conventions (no comments, AlkTypeError, untrusted schemas, overflow
  safety, no async, no feature flags, wasm-clean, preserve_order
  load-bearing, no unsafe), verification commands, and ADR/OQ index.
  Blocks auto-commit on semver-relevant public API changes per the
  crates.io 0.1.0 contract.
- Add LICENSE-MIT and LICENSE-APACHE (dual MIT/Apache-2.0, matching
  alkvault and the Cargo.toml license field).
- Cargo.toml: add readme, keywords, categories, rust-version = "1.85".
- Fix broken intra-doc link in builder.rs: DiscriminatorKind ->
  crate::schema::DiscriminatorKind (cargo doc now warning-free).
- N1 (review #002): document is_rfc3339_timestamp as non-strict in the
  function doc comment. Lists the specific gaps (day-of-month per
  month, seconds range, leap seconds) and points consumers needing
  strict validation to chrono/time.
- N2 (review #002): document the FieldValue::Bytes-for-Record API
  asymmetry in the FieldValue enum doc and on read_record_value.
- .opencode/agents/implementation-specialist.md: point to AGENTS.md
  for full convention details (matches the alkvault pattern).
- review #002: mark N1/N2 resolved; all 7 findings now closed.

Verification:
- cargo test --release: 396 tests pass (310 crate + 86 integration)
- cargo clippy --all-targets -- -D warnings: clean
- cargo doc --no-deps: clean (no broken intra-doc link warnings)
- cargo build --target wasm32-unknown-unknown --release: clean
- cargo publish --dry-run --allow-dirty: clean
This commit is contained in:
glm-5.2 committed 2026-08-11 09:33:33 +00:00
1 parent 5f88bca0d8
commit fb3a27f974
10 files changed
+641 -13

No files matched your search

+2 -1
View File
@@ -431,7 +431,8 @@ impl Schema {
}
/// TUnion discriminator, builder-friendly form. Mirrors
/// [`DiscriminatorKind`] but constructed via the builder API.
/// [`crate::schema::DiscriminatorKind`] but constructed via the builder
/// API.
#[derive(Debug, Clone)]
pub enum Discriminator {
/// Byte-offset discriminator. `offset` is the byte position; `disc_type`
+12
View File
@@ -21,6 +21,14 @@ use serde_json::Value;
/// [`FieldValue::Array`]) return layout descriptors; the consumer
/// recurses with a fresh [`SequentialReader`] scoped to the
/// reported byte range.
///
/// **Known asymmetry**: `AlkType:Record` returns
/// [`FieldValue::Bytes`] covering the record's byte range, not a typed
/// `Record { ... }` variant. The consumer recurses into the record's
/// value schema by walking the borrowed slice. Every other composite
/// kind returns a typed descriptor; `Record` is the exception (review
/// #002, N2). A future revision may add a `FieldValue::Record`
/// variant; for v0.1.0 the `Bytes` form is stable.
#[derive(Debug, PartialEq)]
pub enum FieldValue<'a> {
/// `AlkType:Int8`.
@@ -684,6 +692,10 @@ fn walk_variable_array_size(
/// entries of `[key_len: u32][key_bytes][value]`. Returns the total size
/// consumed. The reader does not decode the entries — the consumer
/// recurses into the record's value schema.
///
/// Returns the record's byte range as [`FieldValue::Bytes`] (the one
/// composite kind that does not return a typed descriptor — see the
/// `FieldValue` enum doc for the known asymmetry).
fn read_record_value<'a>(
buffer: &'a [u8],
root_schema: &Value,
+11
View File
@@ -348,6 +348,17 @@ impl Keyword for TimestampValidator {
/// Simple RFC 3339 / ISO 8601 datetime check: `YYYY-MM-DDTHH:MM:SS`
/// optionally followed by `Z` or a timezone offset.
///
/// **Non-strict.** This is a structural sanity check, not a strict RFC 3339
/// validator. It does NOT validate:
/// - Day-of-month per month (Feb 31, Apr 31 pass).
/// - Seconds range (only hour and minute are range-checked).
/// - Leap seconds.
///
/// For strict RFC 3339 validation, use a dedicated crate (`chrono`, `time`).
/// `AlkType:Timestamp` is a length-prefixed string at the binary level;
/// strict datetime validation is the consumer's responsibility if they
/// need it. See review #002, N1.
fn is_rfc3339_timestamp(s: &str) -> bool {
let parts: Vec<&str> = s.splitn(2, 'T').collect();
if parts.len() != 2 {