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
This commit is contained in:
1 parent
61be766634
commit
3e2d9b63a7
35 files changed
+1170
-106
No files matched your search
@@ -18,11 +18,14 @@ def build():
|
||||
return subprocess.run(["cargo", "build", "-q", "--offline"], cwd=ws, capture_output=True).returncode == 0
|
||||
if lang == "zig":
|
||||
return subprocess.run(["zig", "build-exe", "main.zig"], cwd=ws, capture_output=True).returncode == 0
|
||||
return subprocess.run([AJI, "check", "main.air"], cwd=ws, capture_output=True).returncode == 0
|
||||
src = "main.aji" if lang == "aji_source" else "main.air"
|
||||
return subprocess.run([AJI, "check", src], cwd=ws, capture_output=True).returncode == 0
|
||||
|
||||
def run(inp):
|
||||
if lang == "aji_air":
|
||||
p = subprocess.run([AJI, "run", "--grant", "in=io.read", "--grant", "out=io.write", "--stdin", inp, "main.air"], cwd=ws, capture_output=True, text=True, timeout=60)
|
||||
if lang in ("aji_air", "aji_source"):
|
||||
# `in` is a keyword in .aji, so the source entry point names it `input`.
|
||||
argv = ["--grant", "in=io.read", "main.air"] if lang == "aji_air" else ["--grant", "input=io.read", "main.aji"]
|
||||
p = subprocess.run([AJI, "run", argv[0], argv[1], "--grant", "out=io.write", "--stdin", inp, argv[2]], cwd=ws, capture_output=True, text=True, timeout=60)
|
||||
try:
|
||||
rec = json.loads(p.stdout)
|
||||
except json.JSONDecodeError:
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# Interface
|
||||
|
||||
- Source: `main.aji`, an `.aji` module.
|
||||
- Entry point: `main(input: cap<io.read>, out: cap<io.write>)`; any return type.
|
||||
- The program is run as `aji run --grant input=io.read --grant out=io.write --stdin TEXT main.aji`; the bytes written to standard output appear in the run record's `stdout` field.
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Public test: one input.
|
||||
out=$(aji run --grant input=io.read --grant out=io.write --stdin 'hello' main.aji) || { echo "FAIL: aji run failed"; echo "$out"; exit 1; }
|
||||
case "$out" in
|
||||
*'"stdout":"hello"'*) echo "PASS";;
|
||||
*) echo "FAIL: unexpected run record: $out"; exit 1;;
|
||||
esac
|
||||
@@ -6,6 +6,7 @@
|
||||
"prompt": "prompt.md",
|
||||
"languages": {
|
||||
"aji_air": {"workspace": "lang/aji_air", "test": "sh test.sh"},
|
||||
"aji_source": {"workspace": "lang/aji_source", "test": "sh test.sh"},
|
||||
"rust": {"workspace": "lang/rust", "test": "sh test.sh"},
|
||||
"zig": {"workspace": "lang/zig", "test": "sh test.sh"}
|
||||
},
|
||||
|
||||
@@ -99,7 +99,7 @@ The harness calls `CMD WORKSPACE LANGUAGE TASK_DIR` outside the agent's sandbox.
|
||||
|
||||
| Variable | Contents |
|
||||
|---|---|
|
||||
| `AJIEVAL_LANGUAGE` | `aji_air`, `rust` or `zig` |
|
||||
| `AJIEVAL_LANGUAGE` | `aji_air`, `aji_source`, `rust` or `zig` |
|
||||
| `AJIEVAL_TOOLCHAIN_PATH` | the toolchain's PATH entries, `:`-separated |
|
||||
| `AJIEVAL_TOOLCHAIN_DIRS` | the directories to bind read-only, one per line |
|
||||
|
||||
@@ -224,6 +224,21 @@ A first-generation snapshot is not available in Track B. There is no cost in dol
|
||||
| `cumulative_context_tokens` | the text returned to the agent through its tool loop (every tool output, plus the task message), counted each time it was returned |
|
||||
| `unique_reference_tokens` | the distinct documentation text the agent saw: distinct lines in the outputs of tool calls that touched `/docs` |
|
||||
| `reference_coverage` | for a single-file reference (the Aji bundle), the fraction of its lines that the agent saw |
|
||||
| `docs` | for a documentation directory (the Source Reference Bundle of `aji_source`), per file and per group of the profile's `doc_groups`; see below |
|
||||
|
||||
**Directory documentation (`metrics.context.docs`).**
|
||||
|
||||
| Field | Meaning |
|
||||
|---|---|
|
||||
| `quick_reference_tokens`, `source_docs_tokens`, `air_docs_tokens` | size of each group (`<group>_tokens`) |
|
||||
| `full_source_docs_tokens` | every group except `air_docs` |
|
||||
| `read_tokens_by_group` | tokens of the group's lines that the agent saw |
|
||||
| `coverage_by_section` | per file: the fraction of its distinctive lines that the agent saw |
|
||||
| `files_opened`, `unique_docs_read` | the files whose `/docs/…` path occurs in a tool input, and how many there are |
|
||||
|
||||
A line is *distinctive* when no other file of the mount contains it. A line seen in a tool output counts toward a group only if every file containing it belongs to that group. This keeps table rules, fences and sections copied into several files out of the attribution: the error-code table, for instance, is in both `diagnostics/` and `air/`.
|
||||
|
||||
**Task variants for `aji_source`.** A task supports the condition through a `languages.aji_source` entry: a starter workspace whose README names `main.aji` and the `main` signature, and a public test. `in` is a keyword in `.aji`, so a source entry point names that capability `input`, and the grant becomes `--grant input=io.read`. Example: [`dev-tasks/dev-echo/lang/aji_source/`](dev-tasks/dev-echo/lang/aji_source/). The evaluator gets `AJIEVAL_LANGUAGE=aji_source` and runs `aji check`/`aji run` on `main.aji`.
|
||||
|
||||
The gap between provider input and cumulative context is history resending, mostly cached. The gap between cumulative context and unique reference is rereading and verbose output. The tokenizer is `cl100k_base` if tiktoken is installed, otherwise bytes / 4. Each record names the one it used.
|
||||
|
||||
@@ -234,7 +249,7 @@ python3 -m ajieval freeze PLAN.json # PLAN.freeze.json: frozen state + rand
|
||||
python3 -m ajieval matrix PLAN.json # verifies the freeze, runs cells sequentially in frozen order
|
||||
python3 -m ajieval journal PLAN.json "observation" [--run RUN_ID]
|
||||
python3 -m ajieval summary RUNS_DIR # shareable: PASS/FAIL matrix, per-cell metrics, aggregates
|
||||
python3 -m ajieval profile RUNS_DIR # shareable: termination, output tokens, solution size, diagnostic-code occurrences
|
||||
python3 -m ajieval profile RUNS_DIR # shareable: termination, output tokens, tool calls, solution size, lowered AIR size (aji_source), docs files read, IR-form and type-mismatch diagnostic counts, diagnostic-code occurrences
|
||||
```
|
||||
|
||||
In Track B the repair metrics are derived from the transcript's shell commands, with their exit codes and outputs:
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"comment": "P6A-9 dev regression, Track B: the dev tasks M and C (former smoke tasks) in Aji/source x 3 native agents x 1 run = 6 runs, compared with the frozen Aji/AIR smoke runs of the same agents. Dev material only, never evidence for H4. The tasks need an `aji_source` variant first (harness.md, task variants). Run from tools/eval: python3 -m ajieval matrix plan.json; then python3 -m ajieval profile on both run directories.",
|
||||
"tasks": ["../aji-bench/tasks/<task-M>", "../aji-bench/tasks/<task-C>"],
|
||||
"languages": ["aji_source"],
|
||||
"models": [
|
||||
{"label": "N1", "agent": "codex", "model": "gpt-6.1-sol", "effort": "high"},
|
||||
{"label": "N2", "agent": "claude", "model": "claude-opus-5-5", "effort": "high"},
|
||||
{"label": "N3", "agent": "opencode", "model": "zai-coding-plan/glm-5.3-flash"}
|
||||
],
|
||||
"runs": 1,
|
||||
"evaluator": "../aji-bench/evaluate",
|
||||
"evaluator_hash_path": "../aji-bench/evaluators",
|
||||
"out": "runs-source-regression"
|
||||
}
|
||||
Reference in new issue
Block a user