Commit Graph
17 Commits
Author SHA1 Message Date
dev 4716cda0f1 cli: add safe owning general-key hash sets
Add std.hashset with explicit pure hash/equality policies and complete
owning keys. Duplicate/full insert returns the original input, while
remove/pop and nonempty free preserve explicit resource ownership.

Reuse safe HashMap storage and failure/peak/refund accounting. Integrate
normative contracts, RFC, references, complexity measurements, CLI/profile
checks and independent Copy/owner set traces.

Validation: 973 conformance cases; runtime set GC and schedule stress;
unit/Quick Reference, formatting, hosted smoke, 53 CLI checks, 106 source
coverage constructs and bundle generation.
2026-10-07 11:14:53 +03:00
dev 7bb5bd7931 cli: add safe owning general-key hash maps
Use explicit static hash/equality functions, dense complete key/value entries
and Copy probe indices. Preserve returned ownership and allocation failure
state without unsafe code or new runtime instructions.

Add normative contracts, API/reference budgets, 33 conformance cases, independent
Copy/owner dict traces and 55 CLI/package/profile checks. Full corpus: 947 passing.
Collection-every-step scheduler stress remains in progress, recorded in RFC/plan.
2026-10-07 10:55:09 +03:00
dev 57603860df cli: add safe owning numeric-key maps
Register std.map with bounded U64Map<V>, exact key equality and explicit
allocation/growth. Preserve returned ownership, old slots on reserve failure
and original-authority refunds; support Copy values, owners and resources.

Cover collision/tombstone/wrap behavior, independent dictionary traces,
quota/cleanup/borrow/task rules, source/AIR parity and hosted/package CLI.
Publish the API, roadmap and measured documentation cost. General key
hashing/equality remains Q-037; numeric maps do not satisfy that gate.
2026-10-07 08:36:23 +03:00
dev 89c63c306b cli: add standard hashes and propose owning map contract
Embed std.hash with four ordinary safe byte functions: FNV-1a 64 and
Castagnoli CRC-32C, each with fresh and numeric continuation forms.
Specify exact constants, empty/chunk semantics, arbitrary continuation
states, target-independent numeric results and explicit serialization.
No heap allocation, authority, AIR, verifier or runtime change.

Propose the next U64Map<V> contract: exact key equality, bounded insert,
returned replacement/full ownership, tombstones, moving drain and
failure-preserving peak-charged rehash. Keep general HashMap<K,V> key
hash/equality policy open as Q-037. A checked slot prerequisite confirms
read-only Copy key/state fields over Option<V>, with explicit accounting
for both tags and owning payload cleanup; no map module is registered.

Validation: unit tests, 797 full conformance cases, 12 new fixtures;
all 11 hash cases with per-instruction collection and 12 schedule seeds
across four quanta, plus owning slot collection; 84 source/AIR, package
and hosted CLI checks; independent forward-polynomial CRC and arbitrary
precision FNV oracles for 286 inputs / 1144 results; 95/95 source coverage;
Zig formatting, whitespace and reference generation. Published vectors
come from RFC 9923 and RFC 3720, with explicit numeric/wire conventions.

Reference cost: source excluding AIR 53,993 -> 55,281 cl100k (+2.4%);
Quick Reference 7,747 -> 7,806 (+0.8%); AIR remains 175,736 bytes.
Map design remains outside both bundles. No empirical MCC or native
throughput claim; CRC initially uses eight bit steps per byte.
2026-10-07 00:53:50 +03:00
dev 93405f69ce cli: add safe owning deque standard module
Embed std.deque with eleven generic operations implemented entirely in
safe Aji over initialized Option<T> buffer slots. Bounded pushes and
moving pops work at both ends; full pushes, out-of-bounds replacements
and nonempty free return ownership to the caller. Explicit reserve
preserves order and all state on allocation failure, charges the old
and new slot capacities at the allocation peak, and rotates whole
values after successful growth. No AIR, verifier or runtime change.

Specify the visible representation invariant, tag-inclusive allocation
accounting and empty-only cleanup. Add RFC 0025, a runnable owning
example, source/CLI conformance and CI coverage. Complete STD-6c;
HashMap, HashSet and BinaryHeap remain STD-6d.

Validation: unit tests and 785 full conformance cases; 28 deque fixtures;
focused collection after every instruction and 12 schedule seeds over
four quanta; 136 source/package/hosted CLI checks; an independent Python
deque oracle for 128 operations and 71 small growth configurations;
93/93 source coverage; Zig formatting, staged whitespace and bundles.

Reference cost: full source excluding AIR grows 52,384 -> 53,993 cl100k
tokens (+3.1%); Quick Reference 7,667 -> 7,747 (+1.0%). AIR stays at
175,736 bytes. Construction/growth still incur interpreter prefix-copy
overhead; no native performance or empirical MCC benefit is claimed.
2026-10-07 00:08:42 +03:00
dev 4138a52af6 cli: add initialized buffers and safe owning vectors
Introduce linear_buffers through the specification, AIR parser/serializer,
verifier, deterministic interpreter and source lowering. A buffer owns an
initialized prefix with explicit reserve, bounded push, moving pop/views and
recoverable empty-only free. Growth charges old+new capacity; failed growth,
full push and nonempty free preserve or return complete ownership.

Implement compiler-pinned safe std.vec with nine operations for Copy values,
owners, files and channel endpoints. Permit complete Copy moves inside
specialized generic bodies without weakening monomorphic or borrow rules.
Update RFC 0024, Q-036, STD-6a/b, reference grammar, Quick Reference, bundles,
source coverage and CI. Remaining collections stay STD-6c.

Validation: unit tests and AIR round-trip; 757 conformance cases; 56 dedicated
buffer cases with per-instruction collection and 32-seed schedule stress;
extended memory test; hosted smoke; 36 module, 20 generic, 49 linear and
118 buffer CLI checks; 91/91 source constructs; Zig fmt and reference bundles.
Full source bundle: 49,589 -> 52,384 cl100k tokens (+5.6%); AIR 175,736 bytes.
The reference interpreter's push copies its initialized prefix; no native
performance or empirical MCC benefit is claimed.
2026-10-06 23:26:41 +03:00
dev 7eea31518d cli: add explicit source generics and Copy option/result
Specialize explicit function, struct and enum templates into deterministic
ordinary AIR, with structural constraints and bounded expansion. Preserve
source provenance and readable names in specialization diagnostics.

Add Copy-only std.option/std.result and vertical specification, grammar,
Quick Reference, RFC and source coverage updates. Keep linear aggregates
and existing unsupported source from-returns explicit follow-up work.

Repair the finite-layout check through arrays under the existing E1003
contract, with positive and rejected source/AIR fixtures.

Validation: build, unit tests, 640 conformance cases, 82/82 source constructs,
32-seed generic task stress, agent-reference, formatting, hosted smoke,
20 generic and 36 package CLI checks. Record three-encoding documentation
budgets; AIR reference is unchanged.
2026-10-06 19:53:26 +03:00
dev 618b4b95c1 cli: add supplied-buffer decimal integer formatting to std 2026-10-06 17:18:33 +03:00
dev 3bb11e03b2 cli: add safe UTF-8 and supplied-buffer hex/base64 std modules 2026-10-06 17:06:39 +03:00
dev 10a370471b cli: bootstrap verified std bytes and math with source imports 2026-10-06 14:51:10 +03:00
dev c2c238d9b1 M checkpoints recorded; harness statuses; memory test split; P6A-12
- results note docs/evaluation/results/2026-10-06-m-checkpoints.md:
  both checkpoints, owner's assessment (IR-tax closed at the engineering
  level, layer 7 GO; cost hypothesis open); plan status and order
- P6A-12: source type-check completeness (E1001 reached the verifier
  from a source run); not a layer 7 blocker
- harness: metrics.agent_status (max_tokens for a reply cut at its
  length limit, provider_rate_limited for 429/usage limits) and
  metrics.evaluation_status (accepted/rejected/evaluator_error/
  infrastructure_failure/not_evaluated), kept apart; termination records
  max_tokens; checkpoint rows show both; evaluator contract: an
  infrastructure failure sets "infrastructure": true
- interpreter memory test: fast form (20k-320k iterations, 256 KiB
  threshold via Options.collect_threshold) in zig build test; full form
  (100k/1M/4M) in zig build test-extended; CI job 'extended' also runs
  conformance with --collect-every-step
2026-10-05 17:43:55 +03:00
dev 3e2d9b63a7 P6A-8: Source Reference Bundle and harness profile aji_source
- source bundle: a /docs directory with QUICK.md (Quick Reference plus a
  where-to-read table), language/*.md, diagnostics/errors.md and the AIR
  bundle only under air/; built from docs/agent/source-bundle.txt
  (> output files, @manifest includes) by zig build agent-reference
- Quick Reference examples are checked: every aji block must be an
  excerpt of a conformance program in tests/conformance/source/quickref
  (zig build test fails otherwise); QR fixes found by the check
  (mut d = data, region not auto-borrowed, statement/borrow blocks that
  could not verify, io_error match)
- frontend: task.*/channel.*/mutex.* are not-yet-implemented, not E7006
- aji lower --stats: mechanical_air_eliminated_raw and _normalized (each
  byte-string materialization counted as one constant; spec 15 §11)
- harness: profile aji_source (doc_groups), per-file and per-group docs
  metrics on distinctive lines, profile columns (tool calls, lowered AIR
  raw/normalized, docs files read, IR-form and type-mismatch counts),
  dev-echo aji_source variant, scripted run and test, source token report
- plan: P6A-8 done, P6A-9 criteria; Q-021/Q-022 resolved; unsafe block
  deferred
2026-10-05 13:16:51 +03:00
dev 6eceb4405b E0-1: Agent Reference Bundle and Phase 2 baseline
- docs/agent/bundle.txt: minimal AIR reference by file and section
  (grammar, instructions, types, traps, verifier rules, resources,
  effects, capabilities, intrinsics, heap/regions, unsafe, runtime
  contract, diagnostics and registries); syntax-example.air verifies
  and runs
- zig build agent-reference: deterministic bundle and report (files,
  sections, bytes, lines, words); section extraction ignores fenced code
- tools/agent_bundle_tokens.py: cl100k_base, o200k_base and Qwen2.5 BPE
  counts; growth warnings >10 % and review >20 % against history.json
- baseline after Phase 2: 104 250 bytes, 16 197 words, ~27.3k tokens
- CI builds the bundle and counts tokens (non-blocking)
- evaluation protocol 0.2: benchmark families, Aji/AIR and Aji/source
  conditions, 36-run engineering smoke test, order of work
- RFC template and AGENTS.md: report bundle growth
2026-10-04 15:44:26 +03:00
dev d405d4ea50 Phase 2: I/O intrinsics, linear resources, deterministic profile (RFC 0007)
- air: resource types file<read|write|append>, listener, stream; io_error;
  intrinsic registry (19 intrinsics) synced with reference/intrinsics.md;
  fallible intrinsics as ok/err terminators; fs prefix narrowing;
  linear_aggregates gating
- verifier: intrinsic form, operand, result and capability-kind checks
  (E1001, E3201, E5002); intrinsic effects (E3101); resource linearity
  in the borrow walker with per-edge moves: E3002 leaks and join
  mismatches, E3001, E2001, E2002, E2101 for close while borrowed;
  resources as borrow roots
- interp: deterministic world (captured console, VFS, loopback TCP,
  instruction clock, pinned xoshiro256 PRNG), blocked outcome, run
  record with stdout/stderr/files
- CLI: --stdin, --vfs, --seed, --result-file, --profile (hosted: exit 3),
  exit code 7; runner: stdin/vfs/seed/stdout/stderr/file/blocked headers
- conformance: hello, file copy and TCP echo exit programs; 37 new tests;
  4000 mutants without a crash
2026-10-04 14:02:17 +03:00
dev 9c29a80b72 Phase 2: effects and capabilities (RFC 0006)
- air: cap<K> and built-in enums (cap_error) as types; enum.switch over
  built-in enums; cap.narrow terminator with ok/err targets; intrinsic
  syntax (registry still empty: E0004); registries for effects,
  capability kinds and built-in enums, synced with reference docs
- verifier: effect stage (E3101, flat, direct callees); cap.narrow form
  check (E3202) and ok/err parameter rules (E5002, E1001); capabilities
  are copyable, not zeroable, not comparable; sizes cap 8, built-in tag
- interp: host authority table; @main instantiation from grants by
  parameter name with not_instantiated reasons; capabilities render as
  opaque
- CLI: --grant P=KIND[:SCOPE], exit code 6; runner: grant: and
  not_instantiated: headers, pending only for unsupported features
- conformance: 18 Phase 2 tests; 4000 mutants without a crash
2026-10-04 13:42:35 +03:00
dev 19dff5dd52 air: feature negotiation for AIR format 0 (DD-014)
- reference/air-features.md: normative feature registry (arrays,
  atomics, capabilities, channels, effects, islands, ownership, regions,
  sync, tasks; all reserved), dependency closures, reasons for E0006
- spec 07 §8.1/§8.5/§8.7: features are mandatory, validated before the
  body, full dependency closure declared, sorted canonically; every
  extension belongs to a feature; published feature semantics immutable
- spec 05 §8: features vs effects vs capabilities
- src/air/features.zig: registry, validation, sync test with the docs
- parser validates features first; E0006 carries `reason`
- `aji features` prints supported AIR format, language and features
- conformance: unknown, reserved and duplicate feature tests
- plan: feature publication tasks in phases 1-5
2026-10-04 12:49:29 +03:00
dev 17a55a7fef Initial import: Aji 0.1 draft spec and Zig scaffolding
Draft specification, RFCs, reference registries and examples, plus the
reference-implementation skeleton: build.zig, diagnostic envelope with
error-code registry synced to docs, aji CLI, conformance runner with seed
tests, CI and contributor docs.
2026-10-04 11:59:13 +03:00