From f91f86742e6bf4965bd3817436cbcfea8d92df65 Mon Sep 17 00:00:00 2001 From: Denton Social Date: Thu, 24 Sep 2026 23:59:36 -0500 Subject: [PATCH] document codegen token budget, sampler, and degeneration config in AGENTS.md (guardrail item 8) --- AGENTS.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 5386258..a501c4e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -253,6 +253,33 @@ unit tests (24) + box integration tests (2). `idle_timeout` — instead of blocking on the 1200s total budget. A streaming stall with zero output usually means the ollama ROCm runner wedged; `sudo systemctl restart ollama` is the recovery. +- **Token budget + exact accounting.** The context window is auto-detected once + from ollama `/api/show` (`parameters.num_ctx`, falling back to + `model_info..context_length`, then the `context_window` config, then + default 100000). `codegen.smart_limit`/`warn_limit`/`max_fill_ratio`/ + `warn_fill_ratio` bound total fill (prompt + output); `max_output` caps + streamed output (>=1 = absolute tokens, 0= threshold` aborts the write with a graceful stub. + Recorded as **trace-only** events (kind `codegen`, with probs and + `stop_prob`) — never in the decision log. Disabled when no engine is + available (`enabled` defaults true; the runtime engine check is what gates + it off the box). ## Codegen guardrails backlog (one session per item) @@ -418,9 +445,16 @@ WARN 100–200K, DUMB>200K), so limits are a total-context budget - Test: the actually-sent HTTP payload's system message contains a SKILL.md phrase (harness already records request bodies). -- [ ] **8. Config + AGENTS.md docs** +- [x] **8. Config + AGENTS.md docs** - Update `config.example.json` codegen block and the AGENTS.md codegen section with every new key from items 2, 4, 5. + - Implemented on the dev machine (2026-09-24): `config.example.json` was + already complete — every key from items 2/4/5 landed incrementally with + those items and matches `cli.build_scheduler` defaults exactly — so the + only real gap was the AGENTS.md "### codegen (skill bodies, box)" section, + which gained three bullets (token budget + exact `include_usage` accounting + with SMART/WARN/DUMB zone; sampler params + escalation ladder; degeneration + watchdog block), all mirroring the `codegen` block of `config.example.json`. - [x] **9. Codegen prompt: code-for-reuse + self-generated mock data** (`codegen.py`, `SKILL.md`)