Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- 提供一系列常驻高级工具,大约增加约1000token的系统提示词,可关闭。高级工具会使用 [Tranquillitatis-Lab/ops-ga](https://github.com/Tranquillitatis-Lab/ops-ga) ,以及其他方案进行持续优化,并跟进最新的模型进展
- 提供缓存友好的动态工具加载框架,可以按需加载面向具体场景的高级专项工具,可关闭
- 提供一个包含教师模型轨迹的预设,让AI学会单次调用多个工具以减少任务完成需要的轮数
- PTC SDK 目录包含 18 个 API:15 个文件/文档工具,加批处理、结果引用和加载器。
- 可与 [Tranquillitatis-Lab/dsh-live-compact](https://github.com/Tranquillitatis-Lab/dsh-live-compact) 搭配使用。两个插件都属于独立乘区,和上下文管理/记忆框架/上下文压缩/提示词注入等token节省方案乘算叠加

<p align="center">
Expand Down
19 changes: 19 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

- ops-ptc's batching teacher trajectory now teaches sandbox authority: the lesson states the
host-reported mode, keeps only that tier, and at `danger-full-access` says never to send
`sandbox_permissions` or `justification`; it also pins the closed vocabulary
(`workspace-write`, `danger-full-access`) instead of letting the model invent a wider target
(#963).
- ops-ptc 的批量调用教师轨迹新增沙箱权限教学:按宿主报告的当前模式只保留对应档位,
`danger-full-access` 下明确「绝不发送 `sandbox_permissions`/`justification`」,并钉住
合法值只有 `workspace-write` 与 `danger-full-access`,避免模型编造更宽的目标(#963)。
- OPS-PTC batch-call guidance now rides the pre-step user batch as plain user text: the opening lesson
and every `bypass`/`plan`/`shape` notice are ordinary user messages with source kind `user`, no
`[Plugin context ...]` envelope and no "not a user instruction" disclaimer. The lesson is delivered on
the first accepted pre-step (and counts as taught only after the host commits it), notices are queued by
the root `run_code` result and delivered on the next pre-step, and the tool result itself is untouched.
This deliberately supersedes the #929 same-step-inbox route so the model reads the guidance as the user's
instruction.
- OPS-PTC 批量调用提示改走 pre-step 用户消息:开局教学与每条 `bypass`/`plan`/`shape` 提醒都是
source kind 为 `user` 的普通用户消息,不再带 `[Plugin context ...]` 信封,也不再声明"不是用户指令"。
教学在首个被接受的 pre-step 投递(宿主提交后才算兑现),提醒由根 `run_code` 结果排队、在下一个
pre-step 投递,工具结果本身不被改写。这是对 #929 同一步收件箱路线的有意取代,让模型把提示当作用户指令来读。
- Niubash no longer refuses to prepare its runtime when a full-access session's workspace contains
the default `~/.dsh` home (#870). The workspace boundary stays armed in read-only and
workspace-write modes, where host workspace labeling and write gating could otherwise reach the
Expand Down
2 changes: 1 addition & 1 deletion docs/component-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The `dsh-ops` row owns built-in and explicitly configured consumer plans. Native
`dsh-ops/shell`, `dsh-ops/file`, `dsh-ops/ptc` and `dsh-ops/hide-official` modules remain as
unsupported legacy exports for old profiles and are not part of the bundle.

`ops-ptc` is the merged row's fifth built-in mode: the plugin registers the preset at runtime through the host `agentPresets.register` (definition from the shipped `presets/ops-ptc.patch.yml` fragment parsed by the host's `loadOverlayPatches`), so the plugin manager has no matching preset row; disabling or unloading the plugin row removes the preset together with the tool surface. The default preset is never written automatically: the detail page's button makes `ops-ptc` the default once (`applied`/`no-update`/`unavailable`/`failed`), while apply, remount and unload leave the operator's own choice alone; see [Presets and the default mode](presets.md). It publishes the same surface as `ptc` and adds the YAML-only `batchingGuidance`: the English lesson arrives once on the first accepted root `run_code` result as `additionalContexts` (from `prompts/batching-guidance.md`; same-step inbox, never logged history, never the system prompt), and a **root** `run_code` program that breaks one of the three latched shape categories — `bypass`, `plan` or `shape` — gets one short notice appended to its own result as `additionalContexts`; each category latches once per turn, a compliant program re-arms it, priority is `bypass` → `plan` → `shape`, and the program is never blocked or rewritten. A legacy profile that still names `dsh-ops/mode-ops-ptc` loads that module; under the merged bundle it only warns and stays inert, and its configuration belongs in the merged row's `ops-ptc` section.
`ops-ptc` is the merged row's fifth built-in mode: the plugin registers the preset at runtime through the host `agentPresets.register` (definition from the shipped `presets/ops-ptc.patch.yml` fragment parsed by the host's `loadOverlayPatches`), so the plugin manager has no matching preset row; disabling or unloading the plugin row removes the preset together with the tool surface. The default preset is never written automatically: the detail page's button makes `ops-ptc` the default once (`applied`/`no-update`/`unavailable`/`failed`), while apply, remount and unload leave the operator's own choice alone; see [Presets and the default mode](presets.md). It publishes the same surface as `ptc` and adds the YAML-only `batchingGuidance`: the English lesson arrives once as a plain user message on the first accepted pre-step batch (from `prompts/batching-guidance.md`; source kind `user`, no plugin envelope, never the system prompt), and a **root** `run_code` program that breaks one of the three latched shape categories — `bypass`, `plan` or `shape` — queues one short notice that the next pre-step appends the same way; each category latches once per turn, a compliant program re-arms it, priority is `bypass` → `plan` → `shape`, and the program is never blocked or rewritten. A legacy profile that still names `dsh-ops/mode-ops-ptc` loads that module; under the merged bundle it only warns and stays inert, and its configuration belongs in the merged row's `ops-ptc` section.

The former `dsh-ops/background` component (FastCtx background jobs: `ops_run`, `ops_run_background`, `ops_job_output`, `ops_job_list`, `ops_job_kill`) has been removed. A profile row that still names it loads as a no-op: it accepts any config, publishes nothing, and logs one warning that the row can be deleted.

Expand Down
28 changes: 15 additions & 13 deletions docs/configuration-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ the row's status card, which sets it once when pressed. Generation and the manua
| `hideOfficialTools` | true | Hide the official file tools this mode replaces, including PTC presentation: when the projection can serve the matching `ops_*` API, official `read/glob/grep` leave the tool surface and the SDK declaration. `write`/`edit`/`read_image` stay; a name the projection cannot serve keeps its official tool (an unattached projection, `glob`/`grep` under `dynamicTools: false`, or a name excluded by a narrowed `allowedTools`). Disabled entirely when `global.hideOfficialTools` is false |
| `dynamicTools` | true | Publish the progressive SDK loader `ops_load_sdk`; effective only while `global.dynamicTools` is also on (AND gate) |
| `disclosurePolicy` | `on-demand` | YAML-only explicit first-round disclosure tier: `on-demand` keeps the legacy progressive path (resident + loader); `full` publishes the whole `allowedTools` pool plus `result` in the first round with no loader (implemented; see the D3 addendum in docs/design-decisions-20261119.md). Effective only while `global.dynamicTools` is on — the explicit opt-in never overrides the bundle switch; while it is off the row keeps its legacy resident/always-loaded surface and the saved choice is preserved. Rejected on non-PTC rows; illegal values are errors naming the key and the received value or type. No upgrade, settings save or switch flip ever writes this key for you |
| `batchingGuidance` | true for `ops-ptc`, false otherwise | Teach once, riding the first accepted root `run_code` result as `additionalContexts` (same-step inbox, never logged history; system prompt untouched), then correct the shape of root `run_code` programs: `bypass`, `plan` and `shape` each latch once per turn and re-arm when the program complies; the notice rides the triggering result as `additionalContexts` and never blocks or rewrites the program. Text lives in the editable `prompts/batching-guidance.md`. YAML-only; an omitted `ops-ptc` section in a legacy whole-row profile override retains true; explicit false disables it |
| `batchingGuidance` | true for `ops-ptc`, false otherwise | Teach once, as a plain user message on the first accepted pre-step batch (source kind `user`, no plugin envelope, logged history; system prompt untouched), then correct the shape of root `run_code` programs: `bypass`, `plan` and `shape` each latch once per turn and re-arm when the program complies; the notice is queued by the triggering result and appended to the next pre-step as a plain user message, and never blocks or rewrites the program. Text lives in the editable `prompts/batching-guidance.md`. YAML-only; an omitted `ops-ptc` section in a legacy whole-row profile override retains true; explicit false disables it |
| `spillRetentionDays` | 30 | Host subprocess spill retention window; `0` reports only and never deletes |
| `spillTotalBudgetMiB` | 256 | Total retained spill budget in MiB; `0` disables the budget |
| `spillSweepEnabled` | true | Run one bounded sweep on activation and every 256 settlements |
Expand All @@ -96,20 +96,18 @@ recorded in the same document's D2 addendum, with publication owned by the D3 sl

### Batch-call guidance (`batchingGuidance`)

Off contributes no extra context. The code default is on for `ops-ptc` only, even when a legacy profile replaces the whole row config without that section; explicit `batchingGuidance: false` still disables it. On, two kinds of guidance ride tool results as `additionalContexts`, rendered from one
Off contributes no extra context. The code default is on for `ops-ptc` only, even when a legacy profile replaces the whole row config without that section; explicit `batchingGuidance: false` still disables it. On, two kinds of guidance ride the pre-step batch as plain user messages, rendered from one
external English Markdown file:

- **Once per agent entry**: one plugin-context message rides the first accepted root `run_code` result as
`additionalContexts` (source `dsh-ops:step-tail`, contributor `batching-guidance:lesson`). That inbox is
same-step only and never logged as user history, so the model sees the whole procedure on the request that
follows the first accepted call: the first-line `// plan:` comment, the dependency split, the
- **Once per agent entry**: one plain user message rides the first accepted pre-step batch (source kind `user`, no plugin envelope)
and enters logged history, so the model sees the whole procedure on the first request: the first-line `// plan:` comment, the dependency split, the
load-before-call step (only while dynamic loading publishes the loader) and four copyable trajectories.
The first-round text teaches each rule once (revision 7): the anti-pattern rewrite and the prose that
The first-round text teaches each rule once (revision 8): the anti-pattern rewrite and the prose that
repeated the dependency split are gone, the core rules state load-only-missing and recheck-after-a-mode-change
explicitly, and the four trajectories ship byte-identical.
- **On a thin program**: when a **root** `run_code` program breaks one of three latched categories, a short
notice is appended to that call's own result as `additionalContexts`. The tool result keeps its value, its
content and its existing contexts; the program is never blocked or rewritten.
notice is queued by that call and appended to the next pre-step as a plain user message. The tool result keeps
its value, its content and its existing contexts; the program is never blocked or rewritten.
- The three categories are `bypass` (file work through the shell or `node:fs`), `plan` (no `// plan:` on the
first physical line) and `shape` (a single operation in its own round trip). Each is latched once per turn,
and a program that complies with a category re-arms it, so a regression inside the same turn speaks again;
Expand All @@ -120,9 +118,9 @@ external English Markdown file:
- The analysis is a literal heuristic over the program text: a loop or `map` counts one dispatch site, not its
runtime fan-out, and strings or comments can mislead it. Notices say so, nothing claims a measured dispatch
count, and a cancelled or never-dispatched call is not analysed.
- Everything rides `additionalContexts` on the tool result and the tool schema is untouched, so the system
prompt and its cache survive. The lesson is spent at the delivery point — the accepted root `run_code`
decision — so a call that is cancelled or never accepted leaves the next accepted call free to teach it.
- Everything rides the pre-step user batch and the tool schema is untouched, so the system prompt and its
cache survive. The lesson is spent only once the host commits the delivered message; a batch that is rejected
or cancelled commits nothing, so the next accepted batch still teaches it.
- The text follows the published surface. While dynamic loading publishes `ops_load_sdk`, the lesson ships
byte for byte, load step included. With `dynamicTools: false` the scope publishes no loader, so that step and
its table row are replaced by a direct-call section that lists the APIs this scope actually publishes; a
Expand All @@ -145,7 +143,11 @@ observation only: no context, no message, no extra dependency.
The text file is `prompts/batching-guidance.md` (shipped with the package, English, editable). It is read
once per path and cached in the process, so restart to apply edits; an unreadable file logs one warning and
skips delivery, an empty file also skips, and a failed delivery only logs a warning without rewriting the
tool result.
tool result. Its "Sandbox permissions" section follows the mode the host `sandboxPolicy` reports:
`danger-full-access` keeps only "this is the widest tier, never send `sandbox_permissions` or
`justification`", while `workspace-write` and `read-only` keep their own escalation advice; without a host
policy the shipped three-tier text is delivered unchanged. Only `workspace-write` and `danger-full-access`
are legal values, and an invalid one rejects the program before it runs (#963).

**Contrast-arm usage.** To compare the guidance on one shared PTC surface, keep `ptc` and `ops-ptc` on the same
API configuration and set `batchingGuidance: true` only on the `ops-ptc` section (the packaged default), or
Expand Down
2 changes: 1 addition & 1 deletion docs/presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ default comes from that profile's own composition.
| Plugin-manager row | a dedicated preset row | no preset row; lives and dies with the `dsh-ops` row |
| Publication surface | official PTC tools | same as the `ptc` section: `run_code` under real PTC presentation plus the same-stack typed SDK file tools |
| Compaction | official `compaction-basic` | official `compaction-basic` as well; no `dsh-compress-codex` |
| Batch-call guidance | none | `batchingGuidance`: defaults true in code and the packaged `ops-ptc` section, including legacy whole-row overrides that omit the section; explicit false disables it; one lesson riding the first accepted root `run_code` result, then shape notices for root `run_code` programs (`bypass`/`plan`/`shape`, each latched per turn and re-armed by compliance); both are delivered as `additionalContexts` that never enter logged history; text in the editable `prompts/batching-guidance.md` |
| Batch-call guidance | none | `batchingGuidance`: defaults true in code and the packaged `ops-ptc` section, including legacy whole-row overrides that omit the section; explicit false disables it; one lesson riding the first accepted pre-step batch, then shape notices for root `run_code` programs (`bypass`/`plan`/`shape`, each latched per turn and re-armed by compliance); both are delivered as plain user messages (source kind `user`, no plugin envelope) that enter logged history; text in the editable `prompts/batching-guidance.md` |
| Single-row section | `ptc` | `ops-ptc` (same keys plus `batchingGuidance`) |
| Default preset | decided by the host/operator | set once by the detail page's button (`applied`/`no-update`); never forced; unloading restores the host default only when the current selection is still `ops-ptc` |
| Ordering | order 2 | order 6, sorted after the official rows |
Expand Down
Loading
Loading