跳过主要内容
G

spine-plugin (dsh)

ghabix/spine-plugin/packages/dsh

DSH 子任务树上下文管理插件(@spinejit/dsh-spinejit):提供 spine_open、spine_close、spine_next 与 spine_spawn 工具维护持久化 SpineTree,在保留当前活跃步骤与前序前缀不变的同时将已闭合子任务折叠为提交结论,并在 Web/Desktop 输入栏与 dsh-tui 状态行实时展示任务树。

安装

dsh plugin --profile web add github:ghabix/spine-plugin

该插件位于仓库的 packages/dsh 子路径下。

README

Spine for Pi & DeepSeek Harness

arXiv pi-spinejit dsh-spinejit License

English | 简体中文

Your agent's context, shaped like its task.

Long-horizon tasks unfold as nested subtasks, yet an agent's context is a flat linear stream where finished explorations and dead ends pile up alongside unfinished work. Spine places execution under a persistent work tree (SpineTree, acting as the structural spine of long-horizon work): the agent opens subtasks with explicit goals, switches or closes them locally (Open, Close, Next), and delegates parallel subtrees when needed (Spawn). Before each model call, Spine compiles SpineTree into minimal effective context—keeping active work in full while folding finished subtasks into their returned conclusions.

In the Spine paper (arXiv:2610.37224), integrating Spine into Pi improves SWE-Milestone Score by 9.5%–17.5% across Gemini 3.8 Flash and open-weight Qwen 3.8 27B, while cutting average input tokens by 67.8% and commercial API cost by 45.4%.

Highlights

  • Unified work-tree control. Sequential local steps (Open / Close / Next) and parallel child agents (Spawn) are managed together in one SpineTree, avoiding unnecessary cross-session subagent overhead on serial work.
  • No separate summarization pass. Closing a subtask folds its intermediate turns immediately using the conclusion written by the agent while full task context is still fresh; detailed history stays archived in the tree.
  • Prefix cache keeps hitting. Completed inner subtasks collapse at the active suffix, leaving preceding parent context byte-for-byte unchanged.
  • Portable Spine SDK. Shared Rust/WASM runtime core (@spinejit/spine-sdk) powering Pi, DeepSeek Harness, and SpineCodex.

Install & Use

1. Spine for Pi (@spinejit/pi-spinejit)

pi install npm:@spinejit/pi-spinejit

# Recommended companion: compact terminal process tree (supports regular & fullscreen modes)
pi install npm:@spinejit/pi-compact-tree

Start Pi and the agent organizes multi-step work on SpineTree automatically. The live tree widget above the input shows active progress (◉ active, ✓ completed); run /spine-tree at any time to browse the full tree and inspect any node's memory without disturbing the session. Package details: packages/plugin.

Upgrading from the legacy @spinejit/spine-plugin name? Run pi remove npm:@spinejit/spine-plugin first.

View Spine for Pi live demo (task tree & /spine-tree memory browser)

Spine for Pi live demo

2. Spine for DeepSeek Harness (@spinejit/dsh-spinejit)

Add the plugin to your DSH Web or Desktop profile—the bundle automatically configures Spine as the context manager (disabling built-in flat compaction and tool-result pruning):

# For DSH Web
dsh plugin --profile web add @spinejit/dsh-spinejit
dsh web

# For DSH Desktop (macOS bundled CLI; restart DeepSeek Harness.app and open a new chat)
"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop add @spinejit/dsh-spinejit

The live SpineTree renders in the input dock of the Web / Desktop clients and above the prompt in dsh-tui. Package details: packages/dsh.

View Spine for DeepSeek Harness live demo

Spine for DeepSeek Harness live demo

Spine Ecosystem & Companion Pi Extensions

  • SpineCodex — Standalone OpenAI Codex distribution with Spine built in (npm install -g @spinejit/spine-codex@latest).
  • Companion Pi extensions:

Source layout and architecture notes: doc/DESIGN.md. Licensed under Apache-2.0.

Citation

@misc{xiang2026spine,
  title         = {Spine: Compiling Subtask Trees into Structured Context for Long-Horizon Coding Agents},
  author        = {Jiahong Xiang and Kunqiu Chen and Lingming Zhang and Yuqun Zhang},
  year          = {2026},
  eprint        = {2610.37224},
  archivePrefix = {arXiv},
  primaryClass  = {cs.SE},
  url           = {https://arxiv.org/abs/2610.37224}
}

相关插件