Repository navigation
refactor(eviction): move the host-neutral eviction core out of the DeepSeek Harness adapter - #95
Merged
Xubqpanda merged 2 commits intoOct 2, 2026
Conversation
…SH adapter Move the host-neutral pieces of DeepSeek Harness eviction into @lightrsi/eviction (canonical-surface/): tool call/result closure, the independent safety policy, registry task-state classification, the estimate -> registry -> safety -> transaction cycle, and estimator construction helpers. Item ids are generic so transcript-based hosts (pi, OpenCode) can use entry ids instead of DSH event seqs. The DSH adapter keeps its public API and now delegates to the shared module; only DSH event parsing, native replacement envelopes and the surfaceOp transaction stay in the adapter. No behaviour change: DSH tests 110/110, eviction tests 62/62 (9 new). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S6it2Si8k8XNGMF8RdyMQz
…l-surface core Replace the initial smoke tests with one test file per module (tool closure, safety policy, eviction cycle, estimator config). Each file lists the input cases it covers at the top and has exactly one test per case, so a failure names the behaviour that changed. Pin the DeepSeek Harness wrappers to the shared core with a delegation test file: tool pairs, safety decisions (per oracle fixture and min-size boundary), pair classification, estimator construction, and the pre-refactor export surface. eviction: 119/119, deepseek-harness: 138/138. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S6it2Si8k8XNGMF8RdyMQz
boxabirds
force-pushed
the
claude/upstream-5-eviction-refactor
branch
from
October 1, 2026 01:35
b1aa908 to
93b9067
Compare
This was referenced Oct 2, 2026
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.
Summary
Groundwork for #93 (OpenCode support), with no behaviour change.
The DeepSeek Harness adapter contains eviction logic that has nothing DeepSeek-specific in it. This PR moves that logic into
@lightrsi/eviction(src/canonical-surface/), so other adapters can reuse it instead of copying it. The DeepSeek Harness adapter now calls the shared code through thin wrappers, and its public API is unchanged.What moved
tool-closure.tssafety-policy.tseviction-cycle.tsestimator-config.tsItem ids are generic, so a host can use its own ids instead of DeepSeek event sequence numbers. DeepSeek-specific parts stay in the adapter: event parsing, native replacement envelopes and the
surfaceOptransaction.Tests
This is a change protected by regression tests.
canonical-surface-*.test.ts), with one test per input case. The eviction suite goes from 53 to 119 tests.deepseek-harness/tests/shared-eviction-delegation.test.tschecks that the DeepSeek wrappers give the same results as the shared code. It covers tool pairs, safety decisions, pair classification, estimator setup and the pre-refactor exports.pnpm build,pnpm typecheckandcheck:boundariespass, as do the claude-code, codex, cli, history and preset suites.Prepared with help from Claude Code; the commits are marked
Co-Authored-By: Claude.