Skip to content
2 changes: 1 addition & 1 deletion docs/design/acp-gateway-implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Gateway 每十秒续租;native 重连后用相同 bindingId 幂等恢复资源
| `/compact` | 调用 `session.context.compact`,由原生所有者决定执行中请求的排队/合并。等待原生结果;已有 compaction activity 唯一显示 completed/skipped/cancelled/failed,RPC 回复不重复打印终态。`session/cancel` 使用既有 main stop;取消完成返回 ACP cancelled。不能把命令文本作为普通聊天提交。 |
| `/usage` | 捕获当前已采用模型的 providerId,仅向该账户按需读取 `account.status`、`account.usage`。未登录给出该 provider 的登录提示;空报告或读取失败明确报告不可用/错误,不借用另一账户。展示 plan 名称/状态、credits 剩余及用量、每个窗口的时长/used/total/reset,以及 feature 自有单位。缺失值省略、零值保留、显式 unlimited 不按零总额显示耗尽。不生成费用、百分比或原始账户 payload;与 `usage_update` 的 Session 上下文占用完全分开。 |
| `/goal` | 裸命令通过 `session.goal.get` 显示当前目标和状态。支持 `set OBJECTIVE`、`edit OBJECTIVE`、`pause`、`resume`、`clear`;普通 OBJECTIVE 按 CLI 规则在 active/paused 时 edit,否则 set。`pause now` 等仍是 CLI 的普通目标文本,空 set/edit 是用法错误。变更后再次 get,展示 owner 已生效状态;不是从历史自行折叠,也不把 set/resume 的操作确认冒充目标执行完成。合同见 [Goal Appendix A](plugins/Goal.md#appendix-a-interface-details)。 |
| `/loop` | 裸命令列出主线原生 loops;PROMPT 开始 self-paced,INTERVAL PROMPT 开始固定间隔,解析遵循 [Scheduler §12.6](plugins/Scheduler.md#126-interfaces)。`stop ID` 仅接受当前分支列表中的 ID;`stop` 只在恰好一个 running/waiting loop 时选择它,多个时列出 ID 请用户明确选择,没有时提示无活跃 loop,不发起 stop。结果保留原生 ID,以 stop 回复中的最新状态为准:stopped/expired 按终态展示,即使 `settled: false`;仅当返回非终态且 `settled: false` 时提示仍在结算。不用预查询的旧状态推断 stop 结果。 |
| `/loop` | 裸命令列出主线原生 loops;PROMPT 开始 self-paced,INTERVAL PROMPT 开始固定间隔,解析遵循 [Scheduler](plugins/Scheduler.md)。`stop ID` 仅接受当前分支列表中的 ID;`stop` 只在恰好一个 running/waiting loop 时选择它,多个时列出 ID 请用户明确选择,没有时提示无活跃 loop,不发起 stop。结果保留原生 ID,以 stop 回复中的最新状态为准:stopped/expired 按终态展示,即使 `settled: false`;仅当返回非终态且 `settled: false` 时提示仍在结算。不用预查询的旧状态推断 stop 结果。 |

```text
/loop stop
Expand Down
9 changes: 3 additions & 6 deletions docs/design/appserver/management-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ namespace and it was withdrawn; an owner that never registered answers

| Case | Native process owner | TypeScript process owner ([process rows](../process-typescript.md)) | Shipped configuration today |
| --- | --- | --- | --- |
| Pending on a dependency whose row is Failed, Unresolved or Disabled | No. A required host row that fails during startup fails startup (`lib.rs`, required failures); after startup only `RunningServer::restart` can fail one, it has no caller in this repository, and its allow-list (`Rpc`, `Connection`, `Transport`, `Agents`, `Mcp`) holds no provider of an owner dependency | Yes, through the embedding input: an extension row's failure is its own diagnostic and does not fail startup (process rows §2.1), so an owner that injects another process row's service stays Pending when that row fails | None. `dimcode` configures no process rows; the planned Scheduler and Workflow owners inject only `sessions`, `settings`, `pluginFiles` and, respectively, `managementMethods` ([Scheduler §1](../plugins/Scheduler.md#1-structure)) and `workflowFiles` ([Workflow §1.3](../plugins/Workflow.md#13-concrete-package-rows)), all provided by required host rows that cannot be restarted (process rows §5.1) |
| Pending on a dependency whose row is Failed, Unresolved or Disabled | No. A required host row that fails during startup fails startup (`lib.rs`, required failures); after startup only `RunningServer::restart` can fail one, it has no caller in this repository, and its allow-list (`Rpc`, `Connection`, `Transport`, `Agents`, `Mcp`) holds no provider of an owner dependency | Yes, through the embedding input: an extension row's failure is its own diagnostic and does not fail startup (process rows §2.1), so an owner that injects another process row's service stays Pending when that row fails | None. `dimcode` configures no process rows; the planned Scheduler and Workflow owners inject only `sessions`, `settings`, `pluginFiles` and, respectively, `managementMethods`, with Scheduler also injecting `processActivity` ([Scheduler](../plugins/Scheduler.md)) and `workflowFiles` ([Workflow §1.3](../plugins/Workflow.md#13-concrete-package-row)), all provided by required host rows that cannot be restarted (process rows §5.1) |
| Pending on a service no row provides | No: assembly wires every native dependency | Yes, once the owner has registered and reloads; before that its names are `unknown_method`, as process rows acceptance 2 asserts | None, as above |
| Node runtime lost after startup | — | Yes: when the Node process exits, rutis-bridge 0.16.0 `watch_exit` (`runtime/plugin.rs`) records `RuntimeState::Down` and withdraws the runtime service, but the local runtime wrapper has already returned `Effect::Done` (`runtime/local.rs`), so its row stays `Running(Active)` while every owner on that runtime goes back to `Running(Pending)`. A probe with the real Workflow row from [#306](https://github.com/arcships/dim/pull/306) and `kill -KILL` on the runtime confirmed it ([review](https://github.com/arcships/dim/pull/247#discussion_r4344393184)) | Reachable by an explicitly installed optional package such as Workflow (#306, open); not by `dimcode`'s default configuration. Accepted, see below |
| Disposed itself, row Inactive | No owner disposes itself | Yes: a JavaScript row whose plugin ends disposes its fiber (rutis-bridge `on_row_ended`, called from rutis-loader `runtime.rs`), and the process loader has no editable layer, so `SelfDisposed` carries the edit error | None, as above |
Expand Down Expand Up @@ -363,11 +363,8 @@ item is one committed runtime change, and it is answered only when a later
`runtime.watch` on the same connection takes over (`{}`) or its generation
unloads (`operation_interrupted`)
([RuntimeManager §10](../plugins/RuntimeManager.md#10-client-change-notices)).
`schedule.watch` declares `progress`: its call stays open while the
connection watches, each item is one change, and it is answered only when a
later `schedule.watch` on the same connection takes over (`{}`) or its
generation unloads (`operation_interrupted`)
([Scheduler §11.2](../plugins/Scheduler.md#112-jobs-and-runs)).
The `schedule.watch` progress is removed with the Scheduler contract; the
`schedule.*` methods except `watch` keep their names ([Scheduler](../plugins/Scheduler.md)).
Connection-bound notifications are the contract's `callChannel.notify`
and `closed` ([A.2](../contracts/session-boundary.md#a2-call-channel)): a
notification is written to the calling connection only, through the reply and
Expand Down
4 changes: 2 additions & 2 deletions docs/design/appserver/sessions-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ recovery from it:
| The branch Timeline ([core/timeline.rs](../../../crates/dim-agent-runtime/src/core/timeline.rs)), through `Session::input` and `Session::lookup` (`sessions.input`, `sessions.lookup`, Rpc's `session.submit` and `session.input_lookup`) | — | Accepts each id once per branch; `accepted`, `unknown` or `ambiguous` for lookup |
| Goal parts ([crates/dim-goal](../../../crates/dim-goal)) | `goal:<uuid>`, through `TreeCommands::input` | Nothing |
| Workflow ([engine.ts](../../../runtime/plugins/workflow/engine.ts)) | `workflow:<uuid>` for each stage input and report, stored in its run file before the write | A retry, by the same or a replacement generation, resubmits the same id and settles from the reply |
| Scheduler ([A.5](../plugins/Scheduler.md#a5-timeline-and-capability-mechanics), [A.6](../plugins/Scheduler.md#a6-run-outcome-delivery); runtime in draft [#317](https://github.com/arcships/dim/pull/317)) | `scheduler:<run_id>`, one per delivery | An uncertain reply is settled by lookup (A.6); a window is never written twice |
| Scheduler ([Scheduler](../plugins/Scheduler.md)) | `scheduler:<run_id>`, one per delivery | An uncertain reply is settled by the read-only lookup; a window is never written twice |
| `dimcode` and the Rust TUI ([#312](https://github.com/arcships/dim/pull/312)) | A new UUID for each submit | Nothing yet: an uncertain submit is reported to the user, not looked up |
| S5c fork ([§6.6](session-deletion-and-fork.md#66-identity-provenance-and-paths)) | Copies it with the event | — (lookup on the fork finds copied inputs) |
| InputQueue, Loop, the history projection, Goal's fold, the model | — | Never read it |
Expand Down Expand Up @@ -501,7 +501,7 @@ An `inputId` the branch does not hold answers `false`; that covers both an id th

`{sessionId}` → `{defaultBranchId}`; errors `rejected`, `session_closed`, `reloading`, `failed`.

The read answers the line the Session's conversation is on: the tree's current default, read from its owner (`TreeCommands::default_branch`) after the Session is acquired, so an idle-unloaded Session is restored for the answer as for §6.10. It reads no history page and writes no event. It exists for the request-side defaults that name no line: a management `schedule.save` that records the default branch for a new job ([Scheduler §2.1](plugins/Scheduler.md#21-the-two-targets)), and the `loops`, `wakeups` and EventHub faces when a request omits a branch ([timeline branches §20.22](../timeline-branches.md#20-acceptance)). A caller resolves it once per request.
The read answers the line the Session's conversation is on: the tree's current default, read from its owner (`TreeCommands::default_branch`) after the Session is acquired, so an idle-unloaded Session is restored for the answer as for §6.10. It reads no history page and writes no event. It exists for the request-side defaults that name no line: a management `schedule.save` that records the default branch for a new job ([Scheduler](../plugins/Scheduler.md)), and `session.loop.*`, the `wakeup` tool and `eventHub.subscribe` when a request omits a branch ([timeline branches §20.22](../timeline-branches.md#20-acceptance)). A caller resolves it once per request.

## 7. Sequence

Expand Down
6 changes: 3 additions & 3 deletions docs/design/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ the run status and context usage, with the place on its right:
## Loop

`/loop` runs a prompt on a rhythm and reads the loops Scheduler keeps. The record, the rounds and the
cadences belong to [Scheduler §12](plugins/Scheduler.md#12-loop); this section owns what the native
cadences belong to [Scheduler](plugins/Scheduler.md); this section owns what the native
clients do with them. The command is listed in the palette beside `/goal`.

| Form | Call |
Expand Down Expand Up @@ -1309,7 +1309,7 @@ plugin's source offers neither, and its detail names the plugin.
Scheduler (#815): the `/scheduled` panel, `/schedule` its alias in both modes, and `dimcode
scheduled list|enable ID|disable ID|edit ID|set ID PATH|add PATH|remove ID|run ID|history ID`
over `schedule.list`, `schedule.save`, `schedule.delete`, `schedule.set_enabled`,
`schedule.run_now` and `schedule.history` ([Scheduler §A.3](plugins/Scheduler.md#a3-management-methods)).
`schedule.run_now` and `schedule.history` ([Scheduler](plugins/Scheduler.md)).
Every job is an entry: its name is the label, and its schedule, next window, last delivery, target
and disabled reason are its detail. The target line says where the job delivers — `Delivers to
Session {session} branch {branch} ({mode}).` for a session target, or `Launches a new Session in
Expand Down Expand Up @@ -1861,7 +1861,7 @@ whole rule as one quoted argument, so global options stay unambiguous.
| `dimcode hooks edit` | Open the user's hook document in `$VISUAL`, `$EDITOR` or the platform default, and write it over `hooks.save` with the revision `hooks.catalog` reported; an interactive edit needs a terminal. |
| `dimcode hooks set PATH` | Write the user's hook document from `PATH`, or from stdin for `-`, with the revision read immediately before the write; unchanged text writes nothing. |
| `/hooks` | Open the Hooks panel of the Session's workspace ([management surfaces](#management-surfaces)): a source per entry, the project's toggle and the user document's edit. |
| `dimcode scheduled list` | List the jobs the Scheduler holds over `schedule.list` ([Scheduler](plugins/Scheduler.md#a3-management-methods)): each job's id, name, schedule, state, next window, last delivery and target, then the jobs whose schedule the owner cannot use. |
| `dimcode scheduled list` | List the jobs the Scheduler holds over `schedule.list` ([Scheduler](plugins/Scheduler.md)): each job's id, name, schedule, state, next window, last delivery and target, then the jobs whose schedule the owner cannot use. |
| `dimcode scheduled enable\|disable ID` | Enable or pause one job over `schedule.set_enabled`, then report the jobs again. |
| `dimcode scheduled edit ID` | Open one job's document in `$VISUAL`, `$EDITOR` or the platform default, and write it over `schedule.save` with the revision the listing reported; an interactive edit needs a terminal. |
| `dimcode scheduled set ID PATH` | Write one job's document from `PATH`, or from stdin for `-`, with the revision read immediately before the write; unchanged text writes nothing. |
Expand Down
Loading