dsh-env-facts
其他 活跃维护

dsh-env-facts

zszzlzm/dsh-env-facts

在运行时上下文快照中写入结构化环境事实,每条记录附带时间戳。插件化接入,自动采集系统与运行时参数,输出机器可读格式,按时间线回溯环境差异,排查问题更快。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
8 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:zszzlzm/dsh-env-facts
git clone https://github.com/zszzlzm/dsh-env-facts.git
git clone git@github.com:zszzlzm/dsh-env-facts.git
README.md master

env-facts — DSH plugin: structured environment facts with an as-of stamp

A DeepSeek Harness (DSH) Host plugin that adds a machine-readable fact block with its
capture time to the runtime-context snapshot:

As of 2026-10-25T12:34:56.789Z
<env>
cwd: "F:\\workspace"
file_policy: danger-full-access
approval_policy: never
gui_url: http://127.0.0.1:3442
session: 019...
</env>

The built-in snapshot lists these facts as prose and carries no timestamp; this plugin adds
both a structured form and an As of time without touching the DSH installation.

Why the as-of stamp is computed this way

The snapshot text participates in DSH's dedupe: while the environment is stable the snapshot
is not re-sent (an audit of dsh-v0.2.1-rc.3 measured 186 model steps producing a single
snapshot). Writing a fresh timestamp every step would defeat that dedupe and emit one message
per step.

This plugin caches per session and only recomputes the text when the facts change. As of is
the moment those facts last changed (or were first captured), so the text stays byte-identical
while the environment is stable and the snapshot dedupe keeps working.

Facts and their sources

Field Source
cwd workingDirectory.get(session)
file_policy sandboxPolicy.resolve({ session }).mode
approval_policy approval.overrideOf(session) (omitted when unset)
gui_url webApp.getAdvertisedUrl()
session session.id

A missing service or fact is simply omitted; it never fails assembly.

Install

Install the package directory as a local bundle with plugin_manager (install_bundle).
The package declares dsh.bundle.patch, which inserts the env-facts row.

upstream-patch/

This directory contains two patches against deepseek-ai/deepseek-harness tag
dsh-v0.2.1-rc.3 that move the same idea into the core (snapshot header constant + stamp at
emission, dedupe by body). They are provided for reference and for the upstream project; see
upstream-patch/PR.md.

License

MIT — see LICENSE.