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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes follow Semantic Versioning.

## Unreleased

- Added #24 neutral forwarding hooks, #25 attached-yield continuation on the same running handle, and #26 fixed-shape structural progress probes with detailed status limited to the exact owner.
- Added an observational, heartbeat-bounded session-snapshot progress fallback when structural conversation probes do not receive accepted online frames. It schema-validates through the ZCode client, scans only the durably accepted current turn, never reads raw logs or emits assistant prose/reasoning/tool output/file contents, and degrades to lifecycle-only updates without changing authoritative completion.
- Stopped writing the Codex host's `hide_spawn_agent_metadata` flag; one setup now reconciles the managed Role and safely removes only a legacy `false` proved by complete numeric-v1 ownership evidence.
- Added a packaged bilingual manual-uninstall guide for receipt-gated Role/config cleanup while retaining durable jobs, results, progress, logs, and history by default.
- Fixed `$zcode:setup` managed Role reconciliation with Codex 0.147 effective configuration, which normalizes an otherwise exact Role registration with `nickname_candidates = null`.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ Foreground Rescue runs the constant forwarder in one native child thread. When t

Use `/agent` or `/subagents` to select the Rescue child and inspect its transcript. `/ps` is different: it lists background terminals owned by the currently active thread, so switch to the child first if a long-running yielded child terminal still exists. A short command may finish before appearing there. The operating-system `ps` command can show processes and argv, but not Codex model activity or thread transcripts. The noninteractive qualification harness does not expose these TUI events, so it emits the machine-readable scoped observation `{ "observed": false, "code": "tui-evidence-not-exposed", "qualificationScope": "tui" }`. That observation is not a qualification result and does not claim that the UI passed or failed.

The child subscribes to online conversation progress when ZCode supports it. Allowlisted tool activity may include a control-free, one-line command or search-query preview shortened to 96 characters. Truncation is not secret redaction: a secret placed in a command or query can remain visible in the child transcript and durable status preview. Raw output, file contents, reasoning, assistant drafts, environment values, and authorization material are not progress fields. If the subscription or an optional progress sink fails, Rescue continues with lifecycle messages and the 20-second heartbeat; the revision-guarded terminal result remains authoritative.
The child subscribes to online conversation progress when ZCode supports it and structurally probes whether that subscription is actually delivering usable online frames. Allowlisted online tool activity may include a control-free, one-line command or search-query preview shortened to 96 characters. Truncation is not secret redaction: a secret placed in an online command or query can remain visible in the child transcript and durable status preview.

If accepted online frames remain unavailable, Rescue can fall back to already schema-validated session snapshots at no more than heartbeat frequency. This fallback is bounded to the durably accepted current turn and emits only allowlisted tool state; it does not emit commands or queries. It never reads raw ZCode logs and never emits assistant prose or reasoning, arbitrary tool input or output, errors or metadata, raw paths, file or patch contents, identifiers, environment values, or authorization material. Progress observation is non-authoritative: failure degrades once to lifecycle-only updates and does not change job success. The separate revision-guarded session read after companion completion remains the authoritative terminal result.

Background semantics remain unchanged: the child reserves the production background worker and returns the public job ID, while the one-time capability stays on production-owned protected descriptors. Use `$zcode:status`, `$zcode:result`, and `$zcode:cancel` for durable recovery. Ordinary steering, a wait timeout, or parent/child loss does not authorize a replacement execution.

Expand Down
4 changes: 3 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ ZCode Desktop 与 ZCode CLI 分别保存 model provider 设置。运行 `$zcode:

使用 `/agent` 或 `/subagents` 选择 Rescue child 并查看它的 transcript。`/ps` 含义不同:它只列出当前活动线程拥有的后台 terminal,所以若一个耗时 child terminal 已 yield,应先切换到 child;短命令可能在出现在列表前就已结束。操作系统的 `ps` 只能显示进程和 argv,不能显示 Codex 模型活动或线程 transcript。非交互 qualification harness 不暴露这些 TUI event,因此会输出机器可读的作用域观测 `{ "observed": false, "code": "tui-evidence-not-exposed", "qualificationScope": "tui" }`。该观测不是资格结果,也不会声称 UI 已通过或失败。

ZCode 支持时,child 会订阅 online conversation progress。allowlist 内的工具活动可以带一行、去控制字符、最长 96 字符的命令或搜索 query 预览。截断不是秘密脱敏:如果秘密本来就在命令或 query 中,它仍可能出现在 child transcript 和持久 status 预览里。原始输出、文件内容、推理、assistant draft、环境值和授权材料都不是进度字段。subscription 或可选进度 sink 失败时,Rescue 会降级到生命周期消息与 20 秒心跳;带 revision guard 的终态结果仍是权威结果。
ZCode 支持时,child 会订阅 online conversation progress,并用结构化结果探测该 subscription 是否真的持续提供可用的 online frame。allowlist 内的 online 工具活动可以带一行、去控制字符、最长 96 字符的命令或搜索 query 预览。截断不是秘密脱敏:如果秘密本来就在 online 命令或 query 中,它仍可能出现在 child transcript 和持久 status 预览里。

若已接受的 online frame 始终不可用,Rescue 可以按不高于心跳的频率回退读取已经通过 schema 校验的 session snapshot。该回退严格限定在已持久确认的当前 turn,只输出 allowlist 内的工具状态,不输出命令或 query。它绝不读取原始 ZCode 日志,也不输出 assistant 正文或推理、任意工具输入/输出、错误或 metadata、原始路径、文件或 patch 内容、标识符、环境值或授权材料。进度观测不具权威性:失败只会一次性降级为 lifecycle-only 更新,不改变 job 的成功结果。companion 完成后的独立、带 revision guard 的 session read 仍是权威终态结果。

后台语义保持不变:child 只负责预留生产 background worker 并返回公开 job ID,一次性 capability 仍只经 production-owned protected descriptor 传输。持久恢复继续使用 `$zcode:status`、`$zcode:result` 和 `$zcode:cancel`。普通 steering、等待超时或父/child 丢失都不授权替代执行。

Expand Down
4 changes: 3 additions & 1 deletion agents/zcode-rescue.toml.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
developer_instructions = """
You are the installed ZCode Rescue forwarder. Accept only the exact initial assignment or one of the two exact continuation assignments documented below. Run exactly one mapped constant command in the current workspace, preserve stderr, and return public stdout verbatim and byte-for-byte. Never inspect or modify code independently, interpret results, retry, poll, cancel, choose a pending branch, or request/print/persist authorization material. Do not accept task text, command arguments, job or session identity, workspace identity, permissions, credentials, or authorization values in the assignment. Reject every other assignment without running a command.
You are the installed ZCode Rescue forwarder. Accept only the exact initial assignment or one of the two exact continuation assignments documented below. Run exactly one mapped constant command in the current workspace, preserve stderr, and return public stdout verbatim and byte-for-byte. Here exactly one command means exactly one `exec_command` companion process; continuation calls only observe its original running handle. Never inspect or modify code independently, interpret results, retry, start a second `exec_command`, cancel, choose a pending branch, or request/print/persist authorization material. Do not accept task text, command arguments, job or session identity, workspace identity, permissions, credentials, or authorization values in the assignment. Reject every other assignment without running a command.

A companion result containing an exit code is terminal. A result containing a running execution or session handle is nonterminal: poll only that same handle with the host continuation tool until it reports an exit code. Partial stdout, stderr, heartbeat text, or an outer code-cell completion is not terminal and must not be returned as final output. A needs-choice response with exit code 3 is terminal for the current child turn.

For the exact initial assignment "Run the installed ZCode Rescue forwarder now. Return its public stdout verbatim.", run only:
node "{{PLUGIN_ROOT}}/scripts/zcode-companion.mjs" invoke rescue
Expand Down
Loading
Loading