zman406986/Agent-Memory-CREMATOR--packages-adapters-dsh ↗★ 1
cremator-dsh
CREMATOR adapter for the dsh harness. Thin seam mapping, no policy.
インストール
検証済み bundle がないか、互換性チェックに失敗しています。先にリポジトリの説明を読んでください。 README 全文を読む ↗
ドキュメント
README 全文を読む ↗cremator-dsh
CREMATOR adapter for the dsh harness. Thin seam mapping, no policy: it translates dsh session
events into the public seams of @cremator/core and applies what the core guard approved. Every
removal is recorded in the trash ledger under a recall id. Project:
https://github.com/zman406986/Agent-Memory-CREMATOR.
Install
The packages are not published to npm. Build from this repo, then point the mount row at the built file:
npm install
npm run build
dist/plugin.js is the entry. A bare cremator-dsh/plugin specifier works only after the package is
installed into the dsh profile; a file:/// name needs no install. Requires Node
>=22.13.0 =23.4.0; @cremator/core resolves from the repo's workspace.
Use
The mount entry is the subpath export; the package's default entry has no host dependency.
dsh --patch row:
- insert:
- id: cremator-mount
name: 'file:///path/to/Agent-Memory-CREMATOR/packages/adapters/dsh/dist/plugin.js'
config:
barBytes: 512
enforcement: apply
contextWindowTokens: 400000
pruneThresholdTokens: 60000
entryAskTrigger: { mode: 'off' }
entryAskGrammar: jsonl-20
nativeCompactionBackstop: true
The entry is a Cordis plugin (name, inject, apply) and also exports a default instance, so a
file:/// specifier or a bare package specifier both work. Replace the example URL with the
path of your own checkout:
file:///path/to/Agent-Memory-CREMATOR/packages/adapters/dsh/dist/plugin.js. Config keys are the
mount's flat knobs:
barBytes, floorBytes, episodeNoNewPathSteps, sealMaxLatencyTurns, minCutFreedBytes,
enforcement, recordName, anchors, judgeTimeoutMs, crematorStorageRoot,
contextWindowTokens, pruneThresholdTokens, nativeCompactionBackstop, entryAskTrigger,
entryAskGrammar, pruneAskGrammar, entryAskBatchSize, dedupeSupersededByReread,
dedupeCallEcho.
Defaults that matter: barBytes 512, enforcement apply (record-only is the explicit opt-out),
entryAskGrammar jsonl-20, pruneAskGrammar nokeepall, and
nativeCompactionBackstop true. contextWindowTokens is the host window the apply leg plans
against; pruneThresholdTokens is the absolute depth bar (test value 60,000) and requires the window.
entryAskTrigger: { mode: "off" } is the product configuration: the per-result entry ask is retired
and the entry seam stays for compatibility.
capBytes and capHeadBytes are accepted and ignored: the entry-time size cap was scrapped, so an
old config file still mounts and neither value is read. Remove them from new rows.
minCutFreedBytes is also accepted and ignored: the cut is the earliest forgotten node.
Durable storage
Storage is durable per session: session N's trash ledger is
/sessions/N/ledger.sqlite with its blobs in the sibling blobs/
directory. Removals survive a restart via the durable ledger; a host-confirmed
conflict blocks and journals.
Only the storage root is configurable; a per-session path pair (databasePath + blobRoot) is
refused with explicit-storage-paths, because one shared ledger would break the per-session rule.
crematorStorageRoot is the config key. It must be absolute. Absent, it resolves to
/storages/cremator, where DSH_HOME defaults to ~/.dsh. The storages level
is dsh's own storage root; cremator is a subdirectory, so no dsh file
is ever shared — CREMATOR stamps its own application_id and user_version, and a shared file
would be unreadable by both sides.
A host that owns durable storage may pass its own openLedger instead:
import { createRacoonsPlugin } from 'cremator-dsh';
const plugin = createRacoonsPlugin({
config: { enforcement: 'apply', barBytes: 512,
crematorStorageRoot: '~/.dsh/storages/cremator' },
journal: (record) => console.error(record.kind),
});
// mount: await plugin.apply(ctx)
The mount journals one mounted record carrying ledgerSource
('durable' | 'host' | 'memory'), node (process.version) and, for the durable source,
storageRoot — runtime evidence of where the ledger actually landed.
':memory:' is for tests only, through the programmatic storage option; no config value
selects it.
Degradation
- The ledger cannot open (the path is unreadable, occupied, or otherwise failing): the mount retries
the open once at the next step boundary, warning and journaling
storage-retryfor the first failure. If the retry also fails, it installs a refusing ledger and journalsstorage-unavailableonce with the code, path and runtime; every removal is then refused with a typedstorageerror. The session degrades torecovery-pending, the transcript is never touched, and recall of ids this process never minted fails asnot-found. A retry that succeeds journalsstorage-recoveredand the mount is fully live. - A restart keeps removals live. The durable ledger's
appliedreceipts are the record of record: a fresh port answersunknownfor an intent it never saw, and the removal still counts as applied. A host that positively answersnot-appliedcontradicts the ledger: the pass blocks and journals areceipt-conflict. Recall is a read of the durable ledger and keeps working either way. - Retention. Archived bytes live until the user deletes the session directory. There is no automatic deletion and no expiry in v1.
- Scope. A recall id resolves within the session that minted it, including after a restart or resume of that session. Cross-session recall is out of scope.
The necromancy model-facing tool returns the projected output (recallId, text, byteLength,
parts), never the ledger record's Uint8Array parts: dsh requires every tool value to be
lossless JSON. The forget tool answers from the session's live snapshot and the mount applies an
admitted request at its next step or turn-end boundary, as one revert plus one receipt.
Status
Append-mode Seal is enforced; the entry-time cap is scrapped. Verdict
enforcement defaults to apply; record-only is the explicit opt-out. The
stale-read and superseded-read proof rules ship and run in the mount's at-rest pass. Per-call usage reconciliation from the host's assistant/message row is wired. The per-path coverage meter's rows ride SessionSnapshot.pathCoverage, and the recall source-fallback reader is wired (recallReader, recallFromSource).
License
Apache-2.0.