- 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
101 lines
4.1 KiB
Zig
101 lines
4.1 KiB
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
// Library: verifier, AIR, interpreter. Everything the TCB contains lives here.
|
|
const mod = b.addModule("aji", .{
|
|
.root_source_file = b.path("src/root.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
// The error-code registry in docs/ is the source of truth; a test keeps
|
|
// src/diag.zig in sync with it.
|
|
mod.addAnonymousImport("error_codes_md", .{
|
|
.root_source_file = b.path("docs/reference/error-codes.md"),
|
|
});
|
|
mod.addAnonymousImport("air_features_md", .{
|
|
.root_source_file = b.path("docs/reference/air-features.md"),
|
|
});
|
|
mod.addAnonymousImport("effects_md", .{
|
|
.root_source_file = b.path("docs/reference/effects.md"),
|
|
});
|
|
mod.addAnonymousImport("capabilities_md", .{
|
|
.root_source_file = b.path("docs/reference/capabilities.md"),
|
|
});
|
|
mod.addAnonymousImport("intrinsics_md", .{
|
|
.root_source_file = b.path("docs/reference/intrinsics.md"),
|
|
});
|
|
|
|
// CLI: `aji`.
|
|
const exe = b.addExecutable(.{
|
|
.name = "aji",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("src/main.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{.{ .name = "aji", .module = mod }},
|
|
}),
|
|
});
|
|
b.installArtifact(exe);
|
|
|
|
const run_cmd = b.addRunArtifact(exe);
|
|
run_cmd.step.dependOn(b.getInstallStep());
|
|
run_cmd.addPassthruArgs();
|
|
b.step("run", "Run the aji CLI").dependOn(&run_cmd.step);
|
|
|
|
// Unit tests.
|
|
const test_step = b.step("test", "Run unit tests");
|
|
test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = mod })).step);
|
|
|
|
// Long-running tests kept out of `zig build test` (CI: a separate job).
|
|
const extended = b.addTest(.{ .root_module = b.createModule(.{
|
|
.root_source_file = b.path("tests/extended/memory.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{.{ .name = "aji", .module = mod }},
|
|
}) });
|
|
b.step("test-extended", "Run long-running tests (interpreter memory at millions of steps)").dependOn(&b.addRunArtifact(extended).step);
|
|
test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = exe.root_module })).step);
|
|
|
|
// Conformance suite runner (tests/conformance).
|
|
const conformance = b.addExecutable(.{
|
|
.name = "aji-conformance",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("tools/conformance.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{.{ .name = "aji", .module = mod }},
|
|
}),
|
|
});
|
|
const run_conformance = b.addRunArtifact(conformance);
|
|
run_conformance.addArg("tests/conformance");
|
|
run_conformance.addPassthruArgs();
|
|
b.step("conformance", "Run the conformance suite").dependOn(&run_conformance.step);
|
|
test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = conformance.root_module })).step);
|
|
|
|
// Agent Reference Bundle (spec 14 §3.7): zig-out/agent/{reference-bundle.md,report.json}.
|
|
const bundle = b.addExecutable(.{
|
|
.name = "aji-agent-bundle",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("tools/agent_bundle.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{.{ .name = "aji", .module = mod }},
|
|
}),
|
|
});
|
|
const run_bundle = b.addRunArtifact(bundle);
|
|
run_bundle.setCwd(b.path("."));
|
|
run_bundle.addArgs(&.{ ".", "zig-out/agent" });
|
|
run_bundle.has_side_effects = true;
|
|
b.step("agent-reference", "Build the Agent Reference Bundle and report its size").dependOn(&run_bundle.step);
|
|
test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = bundle.root_module })).step);
|
|
// Every Quick Reference example is an excerpt of a checked program.
|
|
const check_quickref = b.addRunArtifact(bundle);
|
|
check_quickref.setCwd(b.path("."));
|
|
check_quickref.addArgs(&.{ "--check", "." });
|
|
check_quickref.has_side_effects = true;
|
|
test_step.dependOn(&check_quickref.step);
|
|
}
|