@playform/hook-dsh-replay-suggester
v0.2.1 - UNPUBLISHED - plan:
SEARCH-SUGGESTER-PLUGIN
The role
The replay-suggester hook is a DeepSeek Harness plugin that answers the question "the last time
this was done, what did the model actually touch and how did it verify?"
(SEARCH-SUGGESTER-PLUGIN.md §9.3).
When the model searches with an intent it has pursued before, the hook recalls the matching record
from its history store and prepends ONE labeled additionalContexts notice: the files touched last
time and the verification command.
-
The history store. ~/.dsh/replay-suggester/history.json is the seed of the journal of the
search-suggester per §9.3, and the offline learner and the journal adapter are the end-phase
wiring.
It is loaded once at apply, and a missing or corrupt store degrades to silence with a ledger
line, never to a guess.
-
The recall store has a producer (the wave 2c re-spec,
03-SUGGESTERS.md).
Every judged call is recorded, and a later call recalls the paths that accompanied a similar
prior call.
The producer's store is its own (the replay_history storage domain, or the JSON fallback
beside the seeded store), and the seeded store still wins when it matches.
-
Without a recalled record the hook abstains (replay no-memory), because a replay answer
without a record is a guess and the plan forbids the guess (§2.4).
-
Privacy posture (plan §5.4). Repo-relative paths only, no file contents, no user text, local
only.
How it works
-
The post-execute listener.
The tools/post-execute listener (waterfall, plain registration, after the ccr's
{prepend: true} listener) calls next() first.
Then the hook runs record (the producer) -> recall (the seeded store, then the live history) ->
detect -> gate -> prepend ONE notice.
Content is never replaced.
-
The pre-step listener.
The agent/pre-step listener resets the note counter each turn when a user message enters.
The recall store (the producer)
On every judged call that names a path, the hook appends one entry
{ seq, path, intent, outcome, at, probe } to the recall history, in the per-agent ring plus the
durable tier.
The durable tier is the storage-domain KV domain replay_history (version 1, per-record, tables
history and meta) when the harness provides a storage facility, and the JSON fallback at
recordPath (~/.dsh/replay-suggester/replay_history.json) otherwise.
Both are bounded by historyDepth and both are awaited through State.Flush().
The recall matches the most recent prior entry with the same tool and either a contained probe
literal or the same path directory, then names the paths recorded within learnWindow calls of it
(the episode): "the last time this area was touched, these files were touched".
The recorded line, the recovery lines (store recovered <n> entries (replay_history|file) and
store empty (starting fresh)), and the failure lines are byte-exact in SCHEME.md.
The pack
The Repeat intent is pack-driven: the built-in pack (the default of this monorepo) lives in
@playform/ets-lib-dsh-pack and is projected here as the replay/ domain.
A repository that ships .dsh/pack.yml (or a user-layer pack at
~/.dsh/playform/workspaces/<slug>.yml) gets its OWN replay/ intent and caveat, and a repository
without a pack stays silent.
The recalled companion still comes from the history store, because the pack supplies the gate and
the caveat, never the companion.
The plan
The package, the Source, the smoke suites (five folders), and the build pass are complete, and the
producer of the recall store landed (the wave 2c re-spec of the completion spec).
The live activation (the profile row flip and the restart) is the remaining end-phase step
(POC-BRIEF.md §8).
Ships enabled: false in the bundle patch.
License
CC0-1.0.