Skip to content

docs(adr): accept ADR-022, record three decisions (#1756) - #1758

Merged
ozand merged 1 commit into
mainfrom
adr-1756
Sep 18, 2026
Merged

ozand merged 1 commit into
mainfrom
adr-1756

Conversation

@ozand

@ozand ozand commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #1756. Flips docs/adr/ADR-022-context-ontology.md from status: proposed to accepted, following the acceptance procedure added under #1712 (docs/adr/README.md, "Acceptance" section, enforced by tests/test_adr_acceptance.py): every Test Contract item now names an existing test that cites ADR-022, and the README index row is updated to match the frontmatter.

What changed in the Status section (current truth, not the issue's snapshot)

The three decisions (7-9) added to the Decision section

  1. Budget unit (decision 7): the budget is stated in tokens (98,304-token serving window) but enforced in characters, because the i386 host has no tokenizer. Cites the eeepc measurement that closed Measure what llama-server does when prompt + max_tokens exceeds n_ctx before sizing the prompt budget #1754: 2,876 executor calls, prompt_tokens max 79,804, completion_tokens capped at exactly 8,192 (client max_tokens), prompt+completion max 83,836 against 98,304 — 14,468 tokens headroom.
  2. Scope of "code does not author" (decision 8): verified against nanobot/agent/context.pyContextBuilder._get_identity(loop_profile=False) (interactive profile) deliberately keeps the original nanobot template as a code literal (role sentence, ## Platform Policy, ## nanobot Guidelines, the closing message-tool line). Rule 2 binds only the loop-profile path. tests/test_ontology_loader.py::test_no_forbidden_loop_prose_in_context_or_subagent_source checks this scoping directly.
  3. SOUL.md/USER.md filename collision (decision 9): verified with rg -n "SOUL.md|USER.md" --type py .nanobot/templates/SOUL.md/USER.md are package-bundled interactive-workspace scaffolding (copied in by sync_workspace_templates only when missing), distinct from the operator-owned release-root SOUL.md/USER.md the loop reads. Decision: keep the collision (renaming is a stated non-goal); the two profiles disambiguate by directory/loader path, not filename. This matches the issue's own description of the collision — no discrepancy found.

Note on #1750

The principle from #1750 ("a bound introduced over existing content ships with either a migration commit or a ratchet clause") is not added by this PR — another agent is working #1750 against this same ADR concurrently (worktree T:/Code/.worktrees/ratchet-1750 already exists). Do not merge this PR in a way that discards that incoming section; it will need a rebase/merge reconciliation with whichever lands second.

Files changed

  • docs/adr/ADR-022-context-ontology.md
  • docs/adr/README.md

Test plan

Ran the four files the ADR's Test Contract requires, per the acceptance procedure, nothing else:

Also ran tests/test_adr_acceptance.py (not one of the four, but the mechanism that enforces the acceptance procedure this PR relies on) to confirm the flip doesn't regress it: 28 passed, 1 skipped, 4 xfailed — clean, no drift between the README index and ADR-022's frontmatter, no unmapped Test Contract item.

🤖 Generated with Claude Code

Flips ADR-022 from proposed to accepted per the acceptance procedure in
docs/adr/README.md: the Test Contract's four items now cite
tests/test_prompt_ontology.py directly (no longer deferred, since #1726
landed as 96a450a), and the README index row is updated to match.

Rewrites the Status section to name current truth instead of the
issue's 2026-09-18 snapshot: eleven follow-ups closed and deployed,
plus #1729/#1745/#1748 landed since, plus #1750-#1753 still open
(named, not claimed done).

Adds three decisions (7-9) the issue said were recorded nowhere:
- Budget unit: stated in tokens (98,304-token window), enforced in
  characters (no tokenizer on the i386 host); cites the #1754
  eeepc measurement (prompt+completion max 83,836 of 98,304 tokens).
- "Code does not author" scopes to the loop profile only; the
  interactive profile's ContextBuilder._get_identity(loop_profile=False)
  deliberately keeps its own template, verified against
  nanobot/agent/context.py.
- The SOUL.md/USER.md filename collision (release root vs.
  nanobot/templates/) is kept, not resolved; verified against the repo.

Does not add #1750's ratchet-vs-migration principle -- that section is
being written by another agent working #1750 concurrently.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ozand

ozand commented Sep 18, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto de20e708 (#1750, merged). Two things resolved in the rebase, both worth stating rather than burying:

  1. ADR conflict, resolved as a union, not a choice. Gate: the AGENTS.md scope bound locks the repair it demands — make it a ratchet #1750 added its principle to the same section this PR rewrote. Both are decisions and both stay: 7 (budget unit), 8 (loop-profile scope), 9 (SOUL/USER collision) from this PR, and the ratchet principle promoted to decision 10 with its own heading rather than left as a loose paragraph.
  2. The "Gate: the AGENTS.md scope bound locks the repair it demands — make it a ratchet #1750 is open / being added separately" wording is now false — it merged as de20e708 while this PR was in review. Both references updated: the Status line records it as closed with its sha, and the References entry points at decision 10.

75 passed, 1 skipped, 5 xfailed across test_adr_acceptance, test_prompt_ontology, test_operating_md, test_ontology_loader, test_mutation_policy.

Separately, for the record: this PR's working-tree edits also landed in the main checkout T:/Code/eeebot and had to be discarded there before main could fast-forward. They were byte-identical to the branch, so nothing was lost — but a worktree-isolated task should leave no trace in the main checkout, and this one did.

@ozand
ozand merged commit b11839e into main Sep 18, 2026
3 checks passed
@ozand
ozand deleted the adr-1756 branch September 18, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant