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
22 changes: 12 additions & 10 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- 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 ...]` 信封,也不再声明"不是用户指令"。
- OPS-PTC batch-call guidance now rides the pre-step batch as user-role text: the opening lesson and
every `bypass`/`plan`/`shape` notice are `role: 'user'` messages carrying the plugin source kind
`dsh-ops:batching-guidance`, no `[Plugin context ...]` envelope and no "not a user instruction"
disclaimer. The model still reads them as the user's instruction, while Chat files them under their
producer instead of drawing a user bubble. 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 (#1040).
- OPS-PTC 批量调用提示改走 pre-step 用户角色消息:开局教学与每条 `bypass`/`plan`/`shape` 提醒都是
`role: 'user'`、来源为插件 kind `dsh-ops:batching-guidance` 的消息,不再带 `[Plugin context ...]`
信封,也不再声明"不是用户指令"。模型仍把它当用户指令来读,Chat 则按生产者归类、不画用户气泡。
教学在首个被接受的 pre-step 投递(宿主提交后才算兑现),提醒由根 `run_code` 结果排队、在下一个
pre-step 投递,工具结果本身不被改写。这是对 #929 同一步收件箱路线的有意取代,让模型把提示当作用户指令来读。
pre-step 投递,工具结果本身不被改写。这是对 #929 同一步收件箱路线的有意取代(#1040)。
- 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 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.
`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 user-role message on the first accepted pre-step batch (from `prompts/batching-guidance.md`; source kind `dsh-ops:batching-guidance`, 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
8 changes: 4 additions & 4 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, 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 |
| `batchingGuidance` | true for `ops-ptc`, false otherwise | Teach once, as a user-role message on the first accepted pre-step batch (source kind `dsh-ops:batching-guidance`, `role: 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,17 +96,17 @@ 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 the pre-step batch as plain user messages, 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 user-role messages carrying the plugin source, rendered from one
external English Markdown file:

- **Once per agent entry**: one plain user message rides the first accepted pre-step batch (source kind `user`, no plugin envelope)
- **Once per agent entry**: one user-role message rides the first accepted pre-step batch (source kind `dsh-ops:batching-guidance`, 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 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 queued by that call and appended to the next pre-step as a plain user message. The tool result keeps
notice is queued by that call and appended to the next pre-step as a user-role 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,
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 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` |
| 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 user-role messages (source kind `dsh-ops:batching-guidance`, 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
4 changes: 2 additions & 2 deletions docs/ptc-cost-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ history; its two byte sizes below are measured on the current guidance text.
assembly's wire.
- **history** is the dsh-ops guidance the suite records from the messages delivered on
each request: the opening lesson (7,538 B in the current text) on the first request,
then the plan notice the thin program earns (200 B). Both are plain user messages
(source kind `user`, no plugin envelope) on the pre-step batch. The suite asserts
then the plan notice the thin program earns (200 B). Both are user-role messages
(source kind `dsh-ops:batching-guidance`, no plugin envelope) on the pre-step batch. The suite asserts
neither touches the system account — the post-notice system sha equals the baseline.

## The arithmetic that must hold
Expand Down
5 changes: 3 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ Standard and Cordis publish resident Native tools; Minimal has no file baseline;
typed APIs with a separate SDK loader; OPS PTC (`ops-ptc`) is registered at plugin runtime and keeps
that surface, adding the batch-call guidance from the editable `prompts/batching-guidance.md`: one lesson on
the first accepted pre-step batch, then shape notices for root `run_code` programs
(`bypass`/`plan`/`shape`, each latched per turn), all delivered as plain user messages (source kind `user`,
no plugin envelope) that enter logged history (on in the packaged bundle; see [presets](presets.md)).
(`bypass`/`plan`/`shape`, each latched per turn), all delivered as user-role messages carrying the plugin
source kind `dsh-ops:batching-guidance` (no plugin envelope) that enter logged history (on in the packaged
bundle; see [presets](presets.md)).
The default preset is set by one button on the row's detail page; nothing forces or restores it automatically.
Residency, dynamic loading, Bash, file replacement and
Windows host-shell hiding are independently controlled. Global gates preserve saved per-preset
Expand Down
2 changes: 1 addition & 1 deletion docs/使用指南.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Native 文件路径(含 copy/move 的目标)、省略的搜索路径,以

本检出是未发布候选。Bundle 只声明一行 `dsh-ops`:五个预设、动态加载、数据采集、TUI 联动与伴随插件联动都在这一行的插件页里配置(其中第五个预设 `ops-ptc` 由插件运行时注册,定义来自随包片段 `presets/ops-ptc.patch.yml`,不是插件管理器行)。五个预设与 discovery 默认开启,数据采集与 TUI 联动默认关闭。已移除的 `mode-*`、`discovery`、`compat`、`panel`、`tui`、`shell`、`file`、`ptc`、`hide-official` 行的已保存覆盖必须删除,它们在新 bundle 中没有对应行。

消费者只为匹配预设发布工具。Standard/Cordis 提供 Native 常驻文件工具,Minimal 没有文件常驻基线;PTC 提供类型化 API 与独立 SDK loader;`ops-ptc` 继承同一工具面并默认开启批量调用提示(`batchingGuidance`:在首个被接受的 pre-step batch 上以普通用户消息英文教学一次 + 按根 `run_code` 程序形状(`bypass`/`plan`/`shape`,每类每轮一次、合规解锁)纠偏,均以普通用户消息投递(source kind `user`、无插件信封)、进入会话历史;文案在可编辑的 `prompts/batching-guidance.md`;YAML 可关;默认预设不自动强制:详情页按钮点一次即设为 `ops-ptc`,apply/重挂载/卸载都不改你自己选的默认,详见[预设与默认模式](预设与默认模式.md))。常驻、动态、Bash、文件替换和 Windows 宿主 Shell 隐藏独立控制,总开关保留各预设保存意图。显式消费者共用装配器,未列出的预设保持原样;内置 Native discovery 可独立于常驻面启用。[配置参考](配置参考.md)说明原生开关页、精确自定义 id 与默认值;迁移见[升级说明](升级与卸载.md#从-04x-迁移到-05x)。
消费者只为匹配预设发布工具。Standard/Cordis 提供 Native 常驻文件工具,Minimal 没有文件常驻基线;PTC 提供类型化 API 与独立 SDK loader;`ops-ptc` 继承同一工具面并默认开启批量调用提示(`batchingGuidance`:在首个被接受的 pre-step batch 上以用户角色消息(插件来源 `dsh-ops:batching-guidance`)英文教学一次 + 按根 `run_code` 程序形状(`bypass`/`plan`/`shape`,每类每轮一次、合规解锁)纠偏,均以普通用户消息投递(source kind `user`、无插件信封)、进入会话历史;文案在可编辑的 `prompts/batching-guidance.md`;YAML 可关;默认预设不自动强制:详情页按钮点一次即设为 `ops-ptc`,apply/重挂载/卸载都不改你自己选的默认,详见[预设与默认模式](预设与默认模式.md))。常驻、动态、Bash、文件替换和 Windows 宿主 Shell 隐藏独立控制,总开关保留各预设保存意图。显式消费者共用装配器,未列出的预设保持原样;内置 Native discovery 可独立于常驻面启用。[配置参考](配置参考.md)说明原生开关页、精确自定义 id 与默认值;迁移见[升级说明](升级与卸载.md#从-04x-迁移到-05x)。


0.5 中,开启原版工具替换不保证条件性工具从模型工具表消失。OPS 对应项采用条件准入时,原版注册仍可见;只有同一已捕获步骤 toolSet 准入该对应项且消费者当前仍有权限时,OPS 才在分派时拒绝原版调用。对应项缺失、撤销或尚未就绪时,不得连带禁用原版工具。安全的无条件常驻替换仍可使用宿主限制。OPS 不包装原版定义,也不在准入条件或提示词组装中隐藏工具。
Expand Down
Loading
Loading