Commit Graph
38 Commits
Author SHA1 Message Date
dev 2bbbd2135c rfc: 0015 scalar atomics and the Aji memory model accepted (revision 2) and integrated into the spec
The Aji RC11 profile (RC11 with NO-THIN-AIR; stronger than ISO C11/C++20) as
normative axioms in spec 04 §20; DRF-SC; linear atomic<T> for AtomicScalar
with atomic.new/atomic.take; ref<atomic<T>> operands; ordering tables incl.
cmpxchg failure table and two results; effects [atomic] / [atomic, atomic.weak];
target atomic_widths and E4203; E4202; enumerator as oracle (observed ⊆ allowed,
exact equality on the normative litmus corpus). Feature atomics stays reserved
until P5-2a. Q-015 resolved; record/replay and Q-017 moved to Phase 8.
RFC 0003 superseded. AIR bundle +1.9 %.
2026-10-06 00:30:35 +03:00
dev c699529fec Phase 4: islands, frozen graphs and arc through every layer (RFC 0014)
AIR: types island<T>, frozen<T>, arc<T>, iref<T>; 16 instructions
(island.create/alloc/root/borrow/freeze/destroy, frozen.root/borrow/
release, arc.from_frozen/new/clone/release/root/borrow, iref.eq); features
islands (depends on heap) and arc (depends on islands) published.
Verifier: IslandSafe/ArcSafe (E2111 at the owner type), container child
borrows (one mut access per island), Send/Share rows (island not Share),
linear owners, mem.alloc effect, element rules (recursion through iref).
Interpreter: graphs with never-reused identities, T0010 for a foreign
iref, O(1) freeze/conversion/transfer, arc counts in a trace hook
(Options.arc_events), budgets per the quota table, collector support.
.aji layer 9: types, operations, island.at/frozen.at/arc.at as borrow
places with explicit container borrows, iref ==/!=.
Frontend fix: joins carry only variables the construct assigns (and that
are read again), so an unchanged linear value is never a block argument
while borrowed.

Tests: 10 AIR (phase4), 6 .aji run + 12 rejects (layer9), the reference
program island-pipeline in .aji, equivalent to an independently
hand-written AIR program (36 on 30 schedule seeds); unit tests for the
arc count trace and O(1) transfer. Quick Reference §7 graphs (checked
excerpt of quickref/graphs.aji); coverage 61/61. Bundle growth: AIR
+7.0%, Quick Reference +0.6k, source docs +4.2k (recorded).
Spec: quota rows match the header-reserved count; idioms and iref
recursion in spec 03 §22; P4-11 (air-text.ebnf gaps) recorded.
2026-10-05 22:14:05 +03:00
dev ca84ab4348 rfc: 0014 accepted (revision 2) and integrated into the spec
Owner review: D1-D4, D7-D9 accepted; D5 frozen.release, no thaw; D6
arc.from_frozen (island -> frozen -> arc, one graph identity), ArcSafe
(not Share alone; no arc<mutex>, no nested arc); D7 island Send, not
Share; D10 islands -> heap, arc -> islands; added: never-reused graph
identity, IslandSafe, the quota lifecycle, iref equality.

Integrated: spec 02 §6 (IslandSafe, ArcSafe), 03 §12-§14 and new
§22-§24 (instruction contracts, quota), 04 §13/§35/§38.1, 07a (features
islands, arc), 15 §8 (layer 9 syntax, explicit container borrows),
error codes (T0010, registered in src/diag.zig), type-properties. Phase 4
plan: P4-0, P4-1 done.
2026-10-05 21:57:08 +03:00
dev 7d8f147d1d rfc: 0014 islands, frozen graphs and arc (Proposed); Phase 4 tasks made vertical 2026-10-05 21:47:02 +03:00
dev a18f149216 docs: features are vertical through .aji; source-side complexity budget; M/C as regression corpus (owner decisions after P6A-9) 2026-10-05 21:43:16 +03:00
dev 65b10e3fb5 spec: accept RFC 0013 and add spec 15, the .aji source language 0.1
Owner decisions D1-D7 and the boundary rule (source may hide
representation mechanics, never authority, allocation, ownership
transfer, synchronization, external effects or recoverable failure).
spec 15 normative: items, types, statements, expressions, places and
borrows, explicit move (named values), outcome matches and 'or trap',
scope/shield/lock blocks (lock lowering defined exactly), select,
channels, allocation, frame storage, lexical borrow scopes, inferred
features, one canonical spelling per construct. grammar.ebnf replaced;
E7001-E7007; E3101 gains suggested_effects; spec 01 examples updated.
2026-10-05 10:35:55 +03:00
dev 0e25a17e9d rfc: 0013 the .aji source language, Phase 6A (Proposed)
Removes SSA, block parameters, CFG, borrow ends, frame-storage
placement and the features header; keeps move, borrows, allocation,
resources, capabilities, effects, tasks, channels, locking, cancellation
and every fallible outcome explicit. Lowers to the same AIR and verifier.
Decisions D1-D7 requested (lock block, lexical borrows, explicit move,
frontend frame storage, explicit effects, familiar surface, E7xxx).
2026-10-05 10:12:38 +03:00
dev 929132c81d Phase 3: owner decisions on RFC 0012 implementation
- spec 04 §40: mutex<T> always linear, never copyable; mutex.take is the
  only way to dismantle it and needs no live borrow (hence no guard and
  no waiter); no unlock or destructor
- P3-10 (async buffer claims, E4303) moved to P7-10 with task-aware
  I/O; E4303 stays reserved; Phase 3 scope closed
- RFC 0012 erratum: consumption after send is E2002, use is E2001
- tests: take while borrowed (E2101), use after take (E3001)
2026-10-04 16:57:59 +03:00
dev b82bc35c5f spec: accept RFC 0012 and integrate waits, channels, select and mutex
revision 2 per owner review: reserved-feature dependencies may change
until publication (general rule, DD-014); task.join.cancel returns the
handle on cancelled with loans still LOANED; channel.sender.dup from
ref<sender<T>> (MPSC, receiver_dup reserved); task.wait required by
every suspending operation, task.join included, only in modules
declaring cancellation; sent values and handles come back as block
parameters on closed/cancelled edges; explicit channel states

spec 04 §37-§41 and pointers in §11-§16, §35, §36; spec 05 §9, 07
§8.11, 07a, 08 §14, 11 §6-§7; features cancellation, channels, sync
published (implementation pending); rwlock, channel_transfer,
receiver_dup, guard_transfer reserved; effect task.wait; E4304, E4305;
Q-013 resolved; bundle +15.8 % tokens (recorded)
2026-10-04 16:27:38 +03:00
dev 4230c78dd1 rfc: 0012 channels, mutex, select and cancellation points (Proposed)
features cancellation, channels, sync; bounded/rendezvous channels with
separate linear endpoints and a drain-then-close receiver protocol;
waiting-operation rule with ok/closed/cancelled edges; shields with
innermost-first nesting (E4305); mutex with function-bound guard and the
no-wait-while-locked rule (E4304); select over channel operations with
seeded choice among ready arms and per-edge ownership (Q-013); rwlock,
channel_transfer, guard_transfer reserved; owner decisions D1-D3
2026-10-04 16:17:59 +03:00
dev ab5814a7bb Phase 3: structured tasks and the deterministic scheduler (RFC 0011)
- interpreter core rewritten around explicit per-task frame stacks so a
  task can be suspended at any instruction; behavior of all existing
  tests unchanged
- tasks: scope and task<T> (function-bound; task_transfer and
  task_borrow_returns reserved), spawn/join/cancel/cancelled/scope.end;
  cooperative scheduler with seeded choice rule, separate schedule seed,
  quantum = fuel unit, task limit (limit_exceeded kind tasks), global
  quiescence over waiting tasks; schedule field in the run record
- verifier: Send/Share table (E4001, E4002), loans as task-owned borrows
  (E4302 on early end, E4101 on conflicts), E4301 at scope end, task
  effects (E3101)
- CLI --quantum, --task-limit, --schedule-seed; runner schedules:,
  quantum:, task_limit:, limit_exceeded:
- fixed: schedule seed default used orelse/^ precedence wrongly
- 15 phase-3 conformance tests; 4000 mutants without a crash
- Agent Reference Bundle +10.9 % tokens (recorded)
2026-10-04 16:02:03 +03:00
dev 2289917af3 spec: accept RFC 0011 and integrate structured tasks
spec 04 §33-§36 (tasks, loans, Send/Share table, scheduler with
separate schedule seed, quantum, task limit); spec 02 §6, 07a, 08, 11
updated; tasks published, task_transfer and task_borrow_returns
reserved; Q-014 resolved; bundle gains the task sections
2026-10-04 15:53:35 +03:00
dev 1eb446eedb rfc: 0011 revision 2 per owner review
function-bound task handles and scopes (task_transfer reserved); loan
state machine; task results Send and borrow-free (task_borrow_returns
reserved); spawn argument rules (E4001/E4002); cancel is a request only;
child trap terminates the execution; deterministic task limit
(limit_exceeded kind tasks); separate schedule seed; one instruction =
one fuel unit = one quantum step; narrowed native equivalence
2026-10-04 15:53:11 +03:00
dev a4ba255a1f rfc: 0011 structured tasks and the deterministic scheduler (Proposed)
Feature tasks: scope and task<T>, spawn/join/cancel/cancelled, borrows
lent to tasks until join (E4302, E4101), structural Send/Share with a
base table resolving Q-014 (E4001, E4002), cooperative scheduler with a
seeded choice rule, quantum, global fuel, schedule exploration.
2026-10-04 15:45:59 +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 72192c2331 spec: agent efficiency objectives and evaluation protocol
- spec 14: Model Capability Compression, design objectives (correctness
  externalization, small semantic surface, explicit semantics, local
  reasoning, machine repairability, deterministic feedback, bounded
  context / Agent Reference Bundle), economic objective, design review
  requirement, hypotheses H1-H6, non-goals, anti-overfitting rule
- docs/evaluation/protocol.md: Agent Language Evaluation Protocol 0.1
  (tasks T01-T10, maintenance and seeded-bug benchmarks, metrics,
  statistics, stages A-E, success and falsification criteria)
- docs/evaluation/README.md: integrity rules, stage readiness
- RFC process: mandatory Agent complexity impact section
- AGENTS.md: overarching objective and anti-overfitting rule
- plan: evaluation track E0-1..E-1; P8-7 integrates ajid with the
  scaffold; conformance plan points to the protocol
2026-10-04 15:36:32 +03:00
dev 0948eb7347 spec: accept RFC 0010 and integrate manifest capability grants
spec 12 §1 manifest format with strict TOML subset, [package] entry,
[capabilities] by parameter name, [metadata]; aji run --manifest with
operator precedence of --grant; spec 05 §10.2 and capabilities.md
updated.
2026-10-04 15:22:30 +03:00
dev 27fa98f39d rfc: 0010 capability grants in aji.toml (Proposed)
Manifest [capabilities] uses the --grant model (parameter = kind[:scope]);
the manifest requests and the operator grants via aji run --manifest;
command-line grants replace manifest entries per parameter; strict TOML
subset.
2026-10-04 15:10:42 +03:00
dev c510a37cf9 spec: accept RFC 0009 and integrate unsafe boundaries
- spec 13 §6-§8: unsafe operations (assume, borrow.index.unchecked),
  contagious unsafe effect, trusted boundary with obligation, E6001,
  unsafe report, profiles as policy
- spec 05 §9.3: trusted is the one discharging boundary; spec 07 §8.10
  trusted syntax; 07a, 08 stage order and assume facts
- T0009, E6001 reasons; feature unsafe published
2026-10-04 14:38:53 +03:00
dev 17ddb98597 rfc: 0009 unsafe operations and trusted boundaries (Proposed)
Feature unsafe: assume and borrow.index.unchecked as the first unsafe
operations, unsafe as a contagious flat effect, trusted functions with a
documented obligation as the only discharging boundary, E6001, T0009
detected precondition violations, unsafe report.
2026-10-04 14:30:59 +03:00
dev b8d4ab4d4c spec: accept RFC 0008 and integrate heap, regions and budgets
- spec 03 §18-§21: allocation authority and live-byte budgets, heap
  (own.new/array/take/free), regions (create/new/array/reset/destroy,
  static generations, E2104 on live references)
- spec 05 §11.2, 07 §8.9, 07a summary, 08 §11.2 region allocation paths
  and the ok-parameter exception to borrow_joins
- registries: alloc_error, mem.alloc budget form, mandatory deterministic
  budget; heap and regions published
2026-10-04 14:20:40 +03:00
dev d4d641ad84 rfc: 0008 revision 2 per owner review
- own.take added (T -> own<T> -> T); no take for own_array
- no region-specific limit: one quota mechanism, cap.narrow.budget
- no hidden destruction: own/own_array/region contents must not contain
  linear values until linear_aggregates
- live allocation vs live reference: borrow.end never returns quota;
  reset/destroy return all bytes; E2104 means a live reference would be
  invalidated
- narrowing reserves nothing; children compete for the parent budget
2026-10-04 14:20:11 +03:00
dev 75dfaac1a6 rfc: 0008 heap allocation, regions and allocation budgets (Proposed)
own<T>/own_array<T> (heap), region with shared-borrow allocation and
static generations (E2104 on reset/destroy with live allocations),
cap<mem.alloc> budgets limiting live bytes and shared by copies,
hierarchical cap.narrow.budget, alloc_error, mandatory deterministic
budget.
2026-10-04 14:09:27 +03:00
dev 571cc6e362 spec: accept RFC 0007 and integrate I/O and linear resources
- spec 06 §6-§7: feature resources, consumption and verifier rules,
  io_error
- spec 05 §11.1 fallible intrinsic form; spec 07 §8.7 frozen built-in
  enum variants, §8.9 resource types; spec 07a resources and run record
  fields; spec 11 §8 execution profiles, blocked outcome, result channel
- reference/intrinsics.md: formal catalogue; capabilities.md: io_error
  and fs prefix narrowing
- features: resources published, linear_aggregates reserved
2026-10-04 13:52:26 +03:00
dev c7bcea294e rfc: 0007 revision 2, remaining examples and diagnostics note 2026-10-04 13:51:32 +03:00
dev 67b228e547 rfc: 0007 revision 2 per owner review
- file<read|write|append>: mode in the type, wrong mode is E1001
- closing intrinsics consume on both edges; second close is E2002
- io_error.other carries no host errno; built-in enum variant sets are
  frozen once published (timed_out reserved for Phase 3 timers)
- no synthetic timed_out: deterministic quiescence ends the run with
  environment outcome blocked (exit 7)
- hosted run record goes to a separate result channel (--result-file);
  stderr summary is for humans only
2026-10-04 13:51:14 +03:00
dev c6acf42182 rfc: 0007 I/O intrinsics, I/O errors and linear resources (Proposed)
Feature resources (file, listener, stream: linear, borrowable, closed
explicitly); built-in io_error; fallible intrinsics as ok/err
terminators; catalogue for console, files, TCP, clock, random; fs
prefix narrowing; deterministic and hosted profiles.
2026-10-04 13:45:31 +03:00
dev fb4338cea6 spec: accept RFC 0006 and integrate effects and capabilities
- spec 05 §9-§12: flat effects, checking rule, capability model,
  instantiation by parameter name, lifetime, fallible narrowing,
  intrinsic calls, runtime
- spec 07 §8.9, 07a (cap.narrow, intrinsic, run result), 08 stage
  order, 11 not_instantiated outcome
- new reference/effects.md and reference/capabilities.md (kinds,
  scopes, built-in cap_error)
- features effects and capabilities published
- Q-011, Q-012 resolved
2026-10-04 13:36:46 +03:00
dev 3fd1513c86 rfc: 0006 revision 2 per owner review
1. capabilities are unforgeable references to one shared authority
   object; authority-bearing types are transitively non-serializable
2. effect -> authority registry; not every effect needs a capability
3. flat effects kept; effect sets must be part of future fn pointer types
4. grants bound by @main parameter name; missing, mismatched, unknown
   and invalid grants are not_instantiated reasons (exit 6)
5. cap.narrow is a fallible terminator (ok -> cap<K>, err -> cap_error);
   no empty capabilities
6. cap.narrow is the only authority transformation; no combine
7. startup data deferred and separate from authority; environment via
   cap<process.env>
8. capabilities live for one execution instance
2026-10-04 13:35:55 +03:00
dev 56728a534c rfc: 0006 effects and capabilities (Proposed)
Resolves Q-011 (flat effects, no discharge in format 0) and Q-012
(opaque copyable capabilities, origin only as @main parameters granted
by the host, explicit narrowing without widening, not_instantiated
environment outcome, intrinsic call mechanism).
2026-10-04 13:31:32 +03:00
dev 2ddf424c14 verifier: max_value_size and checked size accounting (Q-020, DD-015)
- spec 08 §7.1: platform-independent accounted size table shared by
  max_value_size and max_local_frame; enum tag is the smallest of
  1/2/4/8 bytes; borrows 8, slices 16; checked arithmetic, overflow is
  E5101 with found = "overflow"
- every materializable type in a module must be at most 1 MiB,
  checked before functions are verified; each oversized type reported
  once
- E5101 fields no longer truncate huge sizes
- conformance: frame_too_large, value_too_large, size_overflow
- Q-020 resolved; Phase 1 closed
2026-10-04 13:29:54 +03:00
dev be9dd0e1ed spec: spell the AIR array type array<T, N>
';' starts a comment in text AIR, so [T; N] cannot be parsed. Recorded
as an erratum in RFC 0005; source syntax may keep [T; N].
2026-10-04 13:11:07 +03:00
dev 48bb50724f spec: accept RFC 0005 and integrate Phase 1 memory model (P1-1, P1-2)
- RFC 0005 Accepted (revision 2)
- spec 07 §8.8 types and syntax; spec 07a contracts for features
  ownership and arrays; spec 08 §11-§14 borrows, facts, initialization,
  stage order; spec 03 frame storage, second-class borrows, static
  region generations
- grammar: from-returns, multi-result, new types and opcodes
- feature registry: ownership and arrays published; heap added and
  regions moved to Phase 2; borrow_joins reserved and unscheduled
- codes E2105-E2108, T0008
- Q-009, Q-010 resolved; Phase 1 and Phase 2 plans updated; Own test
  moved to phase 2
2026-10-04 13:10:08 +03:00
dev 2c84c0c7cf rfc: 0005 revision 2 per owner review
1. frame-derived borrows never escape (new E2108); aggregate escape
   impossible by the second-class rule
2. local.alloc only in the entry block (E5002); frame size limit with a
   normative accounting table (E5101)
3. path linearity of borrows; full borrow state compared at joins; only
   the accepted program set is normative
4. slice.sub takes (start, len) with overflow-free checks; slice.split
   ranges; slice.copy copies len(src) into the prefix of dst, no overlap
5. explicit fact table for borrow.index.proven
2026-10-04 13:07:32 +03:00
dev 210af812cf rfc: 0005 frame storage, second-class borrows and arrays (Proposed)
Phase 1 memory design for features ownership and arrays, recording the
owner's decisions on Q-009 (second-class borrows, `from` on returns),
Q-010 (static-only region generations) and phase order (no heap in
Phase 1; Own, heap and regions move to Phase 2).
2026-10-04 12:59:36 +03:00
dev 03dda1245a spec: single normative source, accept RFC 0004, freeze AIR format 0, fuel
Owner decisions after the Phase 0 review:

- precedence: docs/spec/ is the single normative source; RFCs are
  decision records whose accepted rules are integrated into the spec in
  the same change (AGENTS.md, docs/README.md, rfcs/README.md, DD-011)
- RFC 0004 Accepted (scope: AIR format 0, language 0.1)
- AIR format 0 frozen as the semantic baseline; spec 07 §8.7 defines the
  only permitted additive changes, everything else needs `air 1` (DD-012)
- Q-019 resolved: deterministic instruction fuel (spec 11 §7). Outcome
  `limit_exceeded` is a runner outcome, not a trap; `aji run --fuel N`,
  exit code 5; conformance runs always use fuel (default 1 000 000,
  `fuel:` header); fuel/schedule budget/quantum kept separate for P3
  (DD-013)
2026-10-04 12:40:32 +03:00
dev c7c5e4f521 plan: Phase 0 exit review (P0-13)
- all Phase 0 tasks done; exit criterion met (41 conformance tests,
  run records compared across two runs)
- RFC 0004 Amendment 1 documents format-0 additions; status stays
  Proposed pending owner acceptance
- open question Q-019: non-terminating programs in test tooling
- README/CONTRIBUTING: current state and `aji run`
2026-10-04 12:33:17 +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