Repository navigation
feat(session): compaction at task boundaries — in-flight gate, reasons, idle sweep, /compact (CLEAN-155) - #29
Merged
maksymhryzodub-prog merged 1 commit intoOct 26, 2026
Conversation
This was referenced Oct 12, 2026
feat(loop): verified completion and delegation with a completion contract (CLEAN-156, CLEAN-157)
#30
Merged
maksymhryzodub-prog
force-pushed
the
feat/CLEAN-155-boundary-compaction
branch
from
October 26, 2026 14:24
469a79f to
5bdd882
Compare
…s, idle sweep, /compact (CLEAN-155)
US4 of the ECC harness principles (specs/001-ecc-agent-principles, T063-T070),
plus three security-review fixes for US3.
- CompactionService.compact takes { reason, inFlight, force, pending }:
with a task of the session still running it defers until the history
passes session.hardLimitPct of contextBudgetChars, then proceeds as
"hard-limit"; an operator request bypasses thresholds. Every archive
summary records its reason and an in-flight note (goal from the last
user message, last three tool calls, pending work) so the next phase
can pick up; the last compaction per session is kept for agent_status.
- Post-turn flush passes whether a sibling task is still in flight; the
heartbeat sweeps sessions idle for session.idleCompactMin and over
threshold, skipping in-flight ones; /compact (admin) compacts now and
reports before/after counts.
- Security review (US3): only an admin's session can teach behaviours —
a visitor phrasing a message as a standing rule installs nothing;
learned text is flattened to one bounded plain line before it is
rendered back into prompts; the learned-behaviour section and skill
unavailability reasons (env/binary names) are shown to admins only.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
maksymhryzodub-prog
force-pushed
the
feat/CLEAN-155-boundary-compaction
branch
from
October 26, 2026 14:26
5bdd882 to
32c9795
Compare
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
compact(sessionId, llm, { reason, inFlight, force, pending }). With a task of the session still running, size-triggered compaction waits; once the history passessession.hardLimitPctofcontextBudgetCharsit proceeds ashard-limit.force(operator) ignores thresholds; therecentKeepfloor always holds.summaryevent carriesreason(boundary | idle | hard-limit | operator) andinFlight: { goal, done, pending }(last user message, last three tool calls, owed work), also folded into the summary text so the model sees what was mid-flight.lastCompaction(sessionId)feedsagent_status.tasks.inFlight(sessionId)(a sibling task may still run); the heartbeat runscompactIdleover sessions idle ≥idleCompactMinand over threshold, skipping in-flight ones;/compact(admin) with before/after counts.SessionConfiggainscontextBudgetChars,hardLimitPct,idleCompactMin; config reload refreshes them.Security-review fixes (US3)
reviewMemory(..., { isAdmin })→ visitor sessions use the facts-only curator and never reach the instinct store), so "from now on always …" from a visitor installs nothing.(unavailable: missing env X)reasons are rendered for admin sessions only; visitors do not see unloadable skills at all.Tests
bun test: 288 pass (+9: compaction gate 6, idle sweep 2, visitor-teaches-nothing 1), 1 pre-existing Windows-only failure.tsc --noEmit: clean apart from the pre-existingbridleAttachments.spec.ts.Jira: https://dreamvention.atlassian.net/browse/CLEAN-155
🤖 Generated with Claude Code