2026-06-25 17:30:42 +08:00
|
|
|
{
|
|
|
|
|
"name": "@deepseek-ai/dsh-compact-basic",
|
2026-07-15 14:47:29 +08:00
|
|
|
"description": "Token-meter-driven compaction policy and LLM summarization backend for the DeepSeek Harness",
|
2026-06-25 17:30:42 +08:00
|
|
|
"version": "0.0.1",
|
|
|
|
|
"private": true,
|
|
|
|
|
"type": "module",
|
|
|
|
|
"main": "lib/index.js",
|
|
|
|
|
"types": "lib/types/index.d.ts",
|
|
|
|
|
"exports": {
|
|
|
|
|
".": {
|
|
|
|
|
"types": "./lib/types/index.d.ts",
|
|
|
|
|
"default": "./lib/index.js"
|
|
|
|
|
},
|
|
|
|
|
"./src/*": "./src/*",
|
|
|
|
|
"./package.json": "./package.json"
|
|
|
|
|
},
|
|
|
|
|
"files": [
|
|
|
|
|
"lib/index.js",
|
|
|
|
|
"lib/types/**/*.d.ts",
|
|
|
|
|
"lib/types/**/*.d.ts.map",
|
|
|
|
|
"src"
|
|
|
|
|
],
|
|
|
|
|
"license": "BSD-3-Clause",
|
|
|
|
|
"peerDependencies": {
|
|
|
|
|
"@deepseek-ai/dsh-agent": "^0.0.1",
|
|
|
|
|
"@deepseek-ai/dsh-compact": "^0.0.1",
|
|
|
|
|
"@deepseek-ai/dsh-llm": "^0.0.1",
|
|
|
|
|
"@deepseek-ai/dsh-session": "^0.0.1",
|
2026-07-15 14:47:29 +08:00
|
|
|
"@deepseek-ai/dsh-token-meter": "^0.0.1",
|
2026-07-16 18:02:15 +08:00
|
|
|
"@deepseek-ai/dsh-tool-result-prune": "^0.0.1",
|
2026-07-15 11:28:45 +08:00
|
|
|
"cordis": "^4.0.0-rc.7"
|
2026-06-25 17:30:42 +08:00
|
|
|
},
|
2026-07-16 18:02:15 +08:00
|
|
|
"peerDependenciesMeta": {
|
|
|
|
|
"@deepseek-ai/dsh-tool-result-prune": {
|
|
|
|
|
"optional": true
|
|
|
|
|
}
|
|
|
|
|
},
|
2026-07-15 14:47:29 +08:00
|
|
|
"dependencies": {
|
|
|
|
|
"schemastery": "^3.18.0"
|
|
|
|
|
},
|
2026-06-25 17:30:42 +08:00
|
|
|
"devDependencies": {
|
2026-07-15 14:47:29 +08:00
|
|
|
"@cordisjs/plugin-include": "workspace:^",
|
|
|
|
|
"@cordisjs/plugin-loader": "workspace:^",
|
2026-06-25 17:30:42 +08:00
|
|
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
fix(compact): decide step-alignment from surface tool-pairing, fire compaction pre-step (CBR-001)
Codex round 1 CBR-001: a head-anchored compaction checkpoint was
mis-classified by the log-position step-alignment scan, so a second
auto-compaction over a checkpoint-headed surface silently failed.
Root cause: `isStepAlignedStart/End` scanned the LOG by seq, but a
`replace` op lands a checkpoint at a high log seq whose SURFACE position
is the head — its log neighbours (the open step's assistant/message) are
not its surface neighbours, so the forward scan wrongly reported mid-step.
Fix, per the agreed direction:
- Replace the two log-position predicates with one surface-anchored
helper `isToolPairingBalanced(nodes, events, beforeSeq)` in
`dsh-session` (renamed step-boundary.ts → tool-pairing.ts). A cut is
balanced when no unanswered tool-call precedes it on the surface; a
region is collapsible iff both edges are balanced cuts. The open-tail
and free-node cases fall out of the same counter. It also throws on a
corrupt surface (a tool/result with no matching call).
- Move compaction off the in-step seam to a new "pre-step" seam fired
after turn/start and before step/start, so a compaction's log-only
compact/* records and its replacement node land cleanly OUTSIDE any
step (the honest structure crash-safety relies on). Renamed the event
agent/pre-request → agent/pre-step and switched its dispatch from
parallel → serial (listeners mutate the surface as a side effect;
serial isolates them so concurrent appends can't interleave). Extended
the catalog generator to accept @mode serial.
Regression coverage: a real-loop test driving an auto-compaction asserts
the landed checkpoint is a balanced cut on both sides; unit tests pin the
checkpoint case, the mid-step injection case, multi-call steps, and the
corrupt-surface guard. Proven red on the old log-position logic.
2026-06-26 13:51:01 +08:00
|
|
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
2026-06-25 17:30:42 +08:00
|
|
|
"@deepseek-ai/dsh-compact": "workspace:^",
|
|
|
|
|
"@deepseek-ai/dsh-invariants": "workspace:^",
|
|
|
|
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
|
|
|
|
"@deepseek-ai/dsh-session": "workspace:^",
|
fix(compact): decide step-alignment from surface tool-pairing, fire compaction pre-step (CBR-001)
Codex round 1 CBR-001: a head-anchored compaction checkpoint was
mis-classified by the log-position step-alignment scan, so a second
auto-compaction over a checkpoint-headed surface silently failed.
Root cause: `isStepAlignedStart/End` scanned the LOG by seq, but a
`replace` op lands a checkpoint at a high log seq whose SURFACE position
is the head — its log neighbours (the open step's assistant/message) are
not its surface neighbours, so the forward scan wrongly reported mid-step.
Fix, per the agreed direction:
- Replace the two log-position predicates with one surface-anchored
helper `isToolPairingBalanced(nodes, events, beforeSeq)` in
`dsh-session` (renamed step-boundary.ts → tool-pairing.ts). A cut is
balanced when no unanswered tool-call precedes it on the surface; a
region is collapsible iff both edges are balanced cuts. The open-tail
and free-node cases fall out of the same counter. It also throws on a
corrupt surface (a tool/result with no matching call).
- Move compaction off the in-step seam to a new "pre-step" seam fired
after turn/start and before step/start, so a compaction's log-only
compact/* records and its replacement node land cleanly OUTSIDE any
step (the honest structure crash-safety relies on). Renamed the event
agent/pre-request → agent/pre-step and switched its dispatch from
parallel → serial (listeners mutate the surface as a side effect;
serial isolates them so concurrent appends can't interleave). Extended
the catalog generator to accept @mode serial.
Regression coverage: a real-loop test driving an auto-compaction asserts
the landed checkpoint is a balanced cut on both sides; unit tests pin the
checkpoint case, the mid-step injection case, multi-call steps, and the
corrupt-surface guard. Proven red on the old log-position logic.
2026-06-26 13:51:01 +08:00
|
|
|
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
2026-07-15 14:47:29 +08:00
|
|
|
"@deepseek-ai/dsh-token-meter": "workspace:^",
|
2026-07-16 18:02:15 +08:00
|
|
|
"@deepseek-ai/dsh-tool-result-prune": "workspace:^",
|
fix(compact): decide step-alignment from surface tool-pairing, fire compaction pre-step (CBR-001)
Codex round 1 CBR-001: a head-anchored compaction checkpoint was
mis-classified by the log-position step-alignment scan, so a second
auto-compaction over a checkpoint-headed surface silently failed.
Root cause: `isStepAlignedStart/End` scanned the LOG by seq, but a
`replace` op lands a checkpoint at a high log seq whose SURFACE position
is the head — its log neighbours (the open step's assistant/message) are
not its surface neighbours, so the forward scan wrongly reported mid-step.
Fix, per the agreed direction:
- Replace the two log-position predicates with one surface-anchored
helper `isToolPairingBalanced(nodes, events, beforeSeq)` in
`dsh-session` (renamed step-boundary.ts → tool-pairing.ts). A cut is
balanced when no unanswered tool-call precedes it on the surface; a
region is collapsible iff both edges are balanced cuts. The open-tail
and free-node cases fall out of the same counter. It also throws on a
corrupt surface (a tool/result with no matching call).
- Move compaction off the in-step seam to a new "pre-step" seam fired
after turn/start and before step/start, so a compaction's log-only
compact/* records and its replacement node land cleanly OUTSIDE any
step (the honest structure crash-safety relies on). Renamed the event
agent/pre-request → agent/pre-step and switched its dispatch from
parallel → serial (listeners mutate the surface as a side effect;
serial isolates them so concurrent appends can't interleave). Extended
the catalog generator to accept @mode serial.
Regression coverage: a real-loop test driving an auto-compaction asserts
the landed checkpoint is a balanced cut on both sides; unit tests pin the
checkpoint case, the mid-step injection case, multi-call steps, and the
corrupt-surface guard. Proven red on the old log-position logic.
2026-06-26 13:51:01 +08:00
|
|
|
"@deepseek-ai/dsh-tools": "workspace:^",
|
2026-07-15 11:28:45 +08:00
|
|
|
"cordis": "^4.0.0-rc.7"
|
2026-06-25 17:30:42 +08:00
|
|
|
}
|
|
|
|
|
}
|