Repository navigation
feat(context): lean always-on prompt — Rules-exempt truncation, skill_load, tool_describe, /context (CLEAN-153) - #27
Open
maksymhryzodub-prog wants to merge 1 commit into
Conversation
…_load, tool_describe, /context (CLEAN-153) US2 of the ECC harness principles (specs/001-ecc-agent-principles, T029-T044), plus the fixes from the US1 security review. - SOUL.md's `## Rules` section is never truncated to fit memory.limits.soul: reference material is dropped first and start-up logs which file was cut and whether the rules alone overflow. - Skills enter a turn when the model calls `skill_load` (catalogue descriptions say when). The body rides in the history ahead of the conversation, not in the system prompt, so the cached prefix stays stable; it stays for skills.retainTurns turns and is refreshed per turn. Unmet requires.env/bins mark a skill `(unavailable: …)` and refuse the load. The keyword matcher stays behind skills.selection: "keyword". - Tools outside tools.coreCatalogue are one-line stubs; `tool_describe` returns description, parameter schema, effect and admin flag. - Per-turn prompt accounting records on-demand loads; `/context` (admin) and agent_status.context show section sizes vs contextBudget. - Catalogue wording (SKILL_CATALOGUE_INSTRUCTIONS) is shared with the skill-selection eval: 100 messages, 96% correct, 0 false loads over the 5% cap, run against the live model. - Security review of US1: streamed replies are redacted chunk by chunk with a hold-back for a credential still being typed; thinking-step and debug text are redacted; the matcher also tests dequoted and `..`-normalised forms so `cat 'data/sec'rets/../secrets/x` is caught. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Oct 12, 2026
feat(loop): verified completion and delegation with a completion contract (CLEAN-156, CLEAN-157)
#30
Open
maksymhryzodub-prog
added this pull request to stack #32
October 12, 2026 15:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
truncateKeepingRulesdrops reference sections ofSOUL.mdbefore any line under## Rules; if the rules alone exceedmemory.limits.soulthey are kept and start-up logsover..agent.example/SOUL.mdnow uses the## Rulesheading.skill_loadwhen a catalogue description fits. The body goes into the history ahead of the conversation (as a taggedsummaryevent), not the system prompt, so the 1h prompt-cache prefix is untouched; it stays forskills.retainTurnsturns (refreshed each turn, extended on reuse) and is never persisted.requires.env/requires.binsunmet →(unavailable: missing env X)in the catalogue and a refused load. Keyword selection kept behindskills.selection: "keyword"for one release.tools.coreCatalogueare one-line stubs (first sentence ≤ 80 chars) with a pointer totool_describe, which returns description, JSON schema,effect,adminOnly. Provider schemas are unchanged.skill_load,tool_describe) land in the turn'sIPromptBreakdown;/context(admin) renders sections vscontextBudgetwithovermarkers;agent_status.contextcarries the same.SKILL_CATALOGUE_INSTRUCTIONSis used by the prompt builder and by the eval, so what is measured is what ships.Security-review fixes (US1)
redactStreaming); the streamer's final text is redacted too.detailand the bridle debug payload text are redacted.',", backslash escapes removed) and with..segments normalised, socat 'data/sec'rets/keyandcat workspace/../data/secrets/keymatch. Globs and$VARexpansion are not simulated — documented.Tests / evals
bun test: 254 pass (+24: truncation 5, skill service 10, tool catalogue 4, loop skill_load 1, streaming redaction 3, matcher 1), 1 pre-existing Windows-only failure.bun run eval: guardrails 31/31; skill-selection 96/100 (SC-003 ≥ 90 %), 0 false loads over the 5 % cap — run live against the configured model. WithoutLLM_API_KEYthe set reportspending.tsc --noEmit: clean apart from the pre-existingbridleAttachments.spec.ts.Note
The ranch admin agent's 12k-char
SOUL.mdlives in the platform template, not in this repo — moving its endpoint table into theranchskill (quickstart §US2 step 2) is a ranch-side follow-up; the runtime now protects its## Ruleseither way.Jira: https://dreamvention.atlassian.net/browse/CLEAN-153
🤖 Generated with Claude Code