Repository navigation
feat(instinct): teachable memory with confidence — review retarget, bands, decay, /learned (CLEAN-154) - #28
Open
maksymhryzodub-prog wants to merge 1 commit into
Conversation
…ands, decay, /learned (CLEAN-154) US3 of the ECC harness principles (specs/001-ecc-agent-principles, T045-T062), plus the second security-review fix for US1. - New agent/instinct slice: one markdown file per learned behaviour under memory/instincts/ (trigger, action, confidence, source, evidence, pinned, reinforced). Starting confidence per source (correction 0.6, error resolution / repetition 0.5, explicit admin rule 0.9 pinned); +0.05 on reinforcement, -0.2 on correction, -0.05 per decayDays idle; bands suggested/apply/core decide visibility; conflicts keep the stronger one. - The background memory review now answers in JSON: facts for MEMORY.md plus instincts to create, reinforce or correct, with session evidence refs. Same trigger learned twice reinforces instead of duplicating. - Core behaviours render as standing rules and apply-band ones as learned behaviours in the prompt (capped by maxInjected); daily decay rides the heartbeat; /learned show|pin|unpin|prune|promote|export for the operator; agent_status.learned counts. - Promotion writes skills/learned-<slug>/SKILL.md for review and marks the behaviours; behaviours never reach the guard. - Eval: tests/evals/corrections.jsonl — one correction, next matching message follows it: 13/13 against the live model. - Security review: persisted tool_call params and tool_result payloads are credential-masked too, not only the model's copy. 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
agent/instinctslice — a learned behaviour is one markdown file in.agent/memory/instincts/: trigger, action, confidence, source, evidence refs, pinned, reinforced. Starting confidence by source: explicit admin rule 0.9 (pinned, core), correction 0.6, error-resolution / repetition 0.5.reinforce+0.05 (cap 0.95),correct−0.2 (floor 0.1), decay −0.05 perdecayDayswithout reinforcement (pinned exempt), once a day on the heartbeat. Bandssuggested 0.3 / apply 0.5 / core 0.8; prune removes unpinned behaviours below suggested for > 2×decayDays. A contradicting pair keeps the higher confidence in the prompt and lists the conflict.MEMORY.md ## Learnedplus instincts to create / reinforce / correct, withsession:<id>#<eventId>evidence. Malformed output teaches nothing. The same trigger learned again reinforces instead of duplicating (stable id = slug + hash).## Standing rules, apply-band under## Learned behaviours, capped bymaxInjected; newinstinctssection in the breakdown./learned(by band, evidence counts, conflicts),show,pin/unpin,prune [id],promote <id…>(writesskills/learned-<slug>/SKILL.mdfor review, reloads skills),export.agent_status.learned.Plan deviation
T056 ("reinforce on use") is implemented through the review pass's
reinforceitems rather than by crediting every rendered behaviour after every turn — the latter would push everything to core within a handful of turns regardless of whether the trigger ever occurred. The curator is asked to reportreinforceonly when the conversation actually applied the behaviour without complaint.Security-review fix (US1)
Persisted
tool_callparams andtool_resultpayloads are credential-masked as well, not only the model's copy — the transcript syncs to S3. The size cap keeps its CLEAN-124 full-on-disk / trimmed-in-context split.Tests / evals
bun test: 279 pass (+25: instinct service 15, gateway 4, memory review 3, loop persisted-redaction 1, …), 1 pre-existing Windows-only failure.bun run eval: guardrails 31/31, skill-selection 96/100, corrections 13/13 — one instinct at 0.6 rendered, the next matching message follows it (SC-004).tsc --noEmit: clean apart from the pre-existingbridleAttachments.spec.ts.Jira: https://dreamvention.atlassian.net/browse/CLEAN-154
🤖 Generated with Claude Code