@mokuyoaxis/agent-guard 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,141 @@
1
+ # Maintenance delivered in 0.2.6 / 0.2.6 维护说明
2
+
3
+ Updated 2026-10-22. The additions previously tracked here now ship in
4
+ [0.2.6](release-notes-0.2.6.md). This path is retained for existing links and
5
+ the preparation history below. The [0.2.5 notes](release-notes-0.2.5.md) retain
6
+ that release's scope. Existing installations need an upgrade; optional Stop
7
+ also needs explicit configuration and a new Kimi session.
8
+
9
+ ## Availability
10
+
11
+ | Addition | Availability and setup |
12
+ |---|---|
13
+ | Kimi recovery feedback | Included in 0.2.6 as `adapters/kimi-code/stop_feedback.py`; requires an explicitly configured Stop hook. Version 0.2.5 lacks this helper. |
14
+ | Kimi configuration guidance | The current example recommends PreToolUse 120 seconds and optional Stop 30 seconds; merge top-level skill directories separately from TOML hook tables. Existing installations can adjust their PreToolUse timeout independently of Stop. |
15
+ | Kimi Stop doctor checks | Included in 0.2.6; `doctor.py kimi --probe --json` reports optional Stop configuration/local execution in a separate `feedback` object. Version 0.2.5 lacks these checks. |
16
+ | Kimi 2.3.0 Bash profile | Added in 0.2.6 after prompt-CLI and ACP root-Bash trials. Version 0.2.5 keeps its earlier list; the separate Kimi Lab helper stays pinned to 2.1.1. |
17
+ | DSH Lab preflight diagnostics | Included in 0.2.6; 0.2.5 retains the older generic error messages. This concerns the Lab controller's version/config checks, not the production deletion policy. |
18
+ | DSH alpha.4 default deletion adapter | Added in 0.2.6. Exact loader declarations include `0.2.1-alpha.4`; optional native read and Lab keep their two-version scope. Version 0.2.5 retains its earlier declaration. |
19
+
20
+ Use the [installation guide](../guides/getting-started.md) to keep the chosen
21
+ checkout or local-package path consistent. Start a new Kimi session after
22
+ changing hooks. The setup remains opt-in; this page does not change user settings.
23
+
24
+ ## Kimi recovery feedback
25
+
26
+ The sampled Kimi 0.42.0, 2.1.1 and 2.3.0 success-hook paths omit the recovery
27
+ explanation from the next model request. The optional POSIX Stop hook asks
28
+ for one additional response after new compensations. It supplies actual
29
+ transaction IDs, state/restore commands, retained-storage guidance and full
30
+ GC commands. Restoring files moves them back without freeing total disk space.
31
+ The hook itself performs no restore or purge.
32
+
33
+ The initial answer appears first and may be inaccurate. Stop cannot repair
34
+ the earlier tool result; the model may still omit details. Emission cursors
35
+ prevent repeated notices in the tested scope but do not prove model receipt.
36
+ Shared-session actors, cancellation and exhausted budgets retain their limits.
37
+ The local doctor checks described below do not prove optional Stop delivery.
38
+
39
+ See [setup and delivery limits](../../adapters/kimi-code/README.md#optional-recovery-feedback-unreleased-checkout-addition)
40
+ and the [bounded host report](../reports/test-report-kimi-code-block.md).
41
+ Missing/timed-out hooks still allow tools in the sampled hosts. The 120-second
42
+ outer timeout gives the internal 90-second check margin; it does not change
43
+ that host behavior.
44
+
45
+ ## Kimi Stop doctor checks
46
+
47
+ The existing top-level results retain PreToolUse scope. A separate `feedback`
48
+ object distinguishes absent Stop (`NOT_CONFIGURED`), invalid configuration
49
+ (`FAIL`), unreadable configuration (`UNVERIFIED`), and requested local probe
50
+ success/failure. An absent optional Stop does not fail the CLI; a configured
51
+ Stop that fails configuration or a requested probe exits 1.
52
+
53
+ The probe checks synthetic recovery guidance, empty/active-Stop silence and
54
+ repeat suppression in its own temporary home/workspace/trash. Existing audit
55
+ records and cursors are left alone; no model, deletion, restore or GC runs.
56
+ PreToolUse probes also isolate inherited `AGENT_GUARD_*` recovery locations.
57
+ Executable/file presence is checked separately from successful execution.
58
+ `feedback.model_delivery` remains `UNVERIFIED`, even after a Bash live sentinel.
59
+
60
+ Configured Stop fields and helper bytes join drift fingerprints. A Stop
61
+ failure prevents writing a passing baseline or proceeding to the live sentinel.
62
+ The importable `check_kimi()` wrapper remains PreToolUse-only; Claude behavior,
63
+ Core policy and rm wildcard rules are unchanged. See the
64
+ [doctor fields and limits](../../adapters/kimi-code/README.md#stop-doctor-checks-unreleased).
65
+
66
+ ## DSH Lab preflight diagnostics
67
+
68
+ Version/config failures distinguish `START_FAILED`, `TIMEOUT`, `OUTPUT_LIMIT`,
69
+ `NONZERO_EXIT`, `EMPTY_STDOUT` and `UNSUPPORTED_VERSION`. Errors include child
70
+ exit code, capture flags, elapsed/deadline seconds and captured byte counts.
71
+ Configuration text, stderr text, command arguments and environment values are
72
+ omitted. Version/config budgets remain 10/15 seconds, with no automatic retry.
73
+ CLI failure still exits 1. See the [Lab runner guide](../../adapters/dsh/harness/README.md).
74
+
75
+ ## Validation and remaining uncertainty
76
+
77
+ The [0.2.6 release notes](release-notes-0.2.6.md#validation-and-limits) record
78
+ the implementation checkpoint's 13/13 CI result, including ten complete
79
+ Python matrix jobs and both Node groups. The dated local checkpoints below
80
+ remain historical records and do not replace that final implementation check.
81
+
82
+ The later [DSH compatibility work](../design/dsh-compatibility.md) adds alpha.4
83
+ to default deletion support. Real CLI Profile/Boot checks covered all three
84
+ admitted hosts, with scripted root/child-agent, policy-forwarding and approval
85
+ checks on alpha.4. The [report](../reports/test-report-dsh-alpha4.md) records
86
+ that separate checkpoint; the historical full run below predates the new
87
+ manifest/forwarding assertions and does not validate those additions.
88
+
89
+ Before the 0.2.6 version/document alignment, the implementation passed a
90
+ complete frozen run on 2026-10-21: **974 Python tests and both Node groups**,
91
+ no failures, errors or skips, in 1270.573 seconds with the original
92
+ 1800-second deadline and no retry. It used an internal unittest result
93
+ collector for immediate failure/event logs, with the same discovery scope
94
+ and sequential Node stages as `npm test`. The 195 public files stayed frozen.
95
+ That preparation aligned only version metadata, the exact-version assertion
96
+ and documentation; it does not reclassify the older failures below as passes.
97
+
98
+ The earlier DSH diagnostics checkpoint passed one complete `npm test` on 2026-10-21:
99
+ **962 Python tests and both Node groups**, on ARM64/PRoot POSIX. A 138-file
100
+ local package was installed offline at a path containing spaces; its CLI
101
+ reported the controlled child exit code correctly without copying payloads.
102
+ Those counts describe that earlier checkpoint, before the Stop doctor
103
+ additions. A later 139-file offline package checked the doctor candidate;
104
+ neither older artifact is a versioned 0.2.6 release.
105
+
106
+ The earlier complete-test attempts included a timeout and one DSH config
107
+ preflight error. Its original result details were not retained. Five bounded
108
+ repetitions of the failing case and the new complete run passed, but the
109
+ historical cause remains unknown. Controlled faults verified the new
110
+ diagnostics; they are separate from reproducing that historical failure.
111
+
112
+ Later Kimi compatibility work adds exact `2.3.0` to the Bash profile after
113
+ sixteen actual-host fixed-loopback trials: eight prompt CLI and eight ACP,
114
+ including allow, BLOCK, ASK refusal, runtime failure, absence controls,
115
+ quarantine/restore and Stop feedback. ACP hooks ran in the session directory
116
+ despite a different server startup cwd. This postdates the historical full
117
+ run above; it changes the version declaration, not Core or the bridge.
118
+ The [2.3.0 report](../reports/test-report-kimi-code-block.md#kimi-230-acceptance)
119
+ keeps root Bash, client-terminal, timeout, model and subagent limits explicit.
120
+ Updating the profile can make an old baseline `DRIFTED`; no baseline is
121
+ automatically rewritten. The Lab helper remains pinned to 2.1.1.
122
+
123
+ Earlier Kimi fixed loopback trials exercised the actual 0.42.0/2.1.1 CLIs.
124
+ A bounded 2.1.1 real-model session received the recorded transaction and full
125
+ commands; restoration and repeat-Stop checks passed. This does not establish
126
+ all-model, subagent, background or long-running behavior. The new DSH
127
+ diagnostic checks made no external model requests.
128
+
129
+ ## 中文摘要
130
+
131
+ 本页记录已纳入 0.2.6 的维护:Kimi 可选 Stop 恢复反馈、120 秒外层超时接入说明,以及
132
+ DSH Lab 版本/配置预检的原因、退出码和计时诊断,及 Kimi Stop 的独立 doctor 检查。
133
+ 后续默认删除适配加入 DSH `0.2.1-alpha.4`,读取脱敏/Lab 不随之扩大。
134
+ Kimi Bash profile 新增精确版本 2.3.0;CLI/ACP 各八项固定响应试次提供有限根代理证据,
135
+ 未调用外部模型,也未扩大 Kimi Lab 的 2.1.1 准入或子代理声明。
136
+ Stop 未配置不报错;配置或本地探针失败退出 1,模型送达始终未验证。已发布 0.2.5 的范围保持原记录;
137
+ 已有安装需升级至 0.2.6,Stop 另需显式配置;原页面路径为已有链接保留。
138
+
139
+ 版本/文档对齐前,最终实现检查点的 974 项 Python 与两组 Node 已在同一冻结流程通过;
140
+ 此前 962 项检查点和历史失败分别保留,原失败原因仍未确定。
141
+ 删除策略、rm 通配符规则、恢复格式和手动 GC 保持原样。
@@ -0,0 +1,102 @@
1
+ # DSH alpha.4 default deletion adapter
2
+
3
+ Tested 2026-10-22 on ARM64/PRoot Debian with Node v22.23.2 and Python 3.13.5.
4
+ At validation, the selected Agent Guard checkout identified as 0.2.6 and was
5
+ unpublished. The tested additions now ship in [0.2.6](../releases/release-notes-0.2.6.md).
6
+ This report adds default deletion evidence for DSH `0.2.1-alpha.4`; the
7
+ [compatibility page](../design/dsh-compatibility.md) states the separate
8
+ optional-read and Lab boundaries.
9
+
10
+ ## Actual CLI and bundle loading
11
+
12
+ Three isolated runs launched the actual DSH CLI using an owned profile with
13
+ `dsh-base` and a local link to this checkout's package. Python Core came from
14
+ that selected package, with no `repoRoot` override. Homes, settings, profiles,
15
+ Git workspaces and recovery directories belonged to the trials. No user
16
+ profile was updated, and no DSH/dependency installation was performed.
17
+
18
+ The CLI roots were `0.1.5-rc.1`, `0.2.0-rc.2` and `0.2.1-alpha.4`.
19
+ The legacy root's key SDK packages are `0.1.5-rc.2`; root and SDK versions
20
+ were not assumed interchangeable. All three completed the following seven
21
+ checks through the real Profile/Boot and native Bash/shell services:
22
+
23
+ - Load the selected bundle and register its three recovery tools.
24
+ - Execute a harmless command.
25
+ - Reject a force-push-shaped command before its harmless bypass marker runs.
26
+ - Reject a wildcard deletion shape, preserving the owned log file.
27
+ - Reject an ASK when the direct call has no agent/approval route.
28
+ - Query status without promoting `host_interception` above `UNVERIFIED`.
29
+ - Quarantine an owned valuable file, report retained disk use and GC guidance,
30
+ then restore its original bytes through the registered tool.
31
+
32
+ ## Root and native child agents on alpha.4
33
+
34
+ The actual AgentLoop and native continuable subagent service ran five actors.
35
+ A local scripted LLM adapter emitted 15 fixed streams and ten Bash calls;
36
+ there were no external model requests. Bash, the deletion guard and the native
37
+ approval service were not replaced.
38
+
39
+ | Actor | Observed result |
40
+ |---|---|
41
+ | Root BLOCK | Benign command executed; force-push-shaped call refused; bypass marker absent |
42
+ | Native child BLOCK | Depth 1 and parent lineage recorded; same refusal and absent marker |
43
+ | Root ASK with policy `never` | Native approval rejected the call; marker absent |
44
+ | Native child ASK | Native delegated approval policy rejected the call; marker absent |
45
+ | Root ASK with fixed local answerer | Native approval recorded `allowed-once`; only the owned harmless approval marker ran |
46
+
47
+ The approval grant used a deterministic answerer for one owned sentinel.
48
+ It does not establish interactive approval UI behavior. The first attempt used
49
+ the older `subagents.start` API: its root case passed, then the child driver
50
+ failed because alpha.4 exposes `startActivation` instead. That failed attempt
51
+ was retained. Updating the test driver to the actual SDK interface required
52
+ no product adapter change.
53
+
54
+ Observe-only instrumentation checked each of the five checker requests against
55
+ the invoking agent session's native resolved policy. Workspace, signal and
56
+ the existing 90-second timeout were retained. Native execution used
57
+ `danger-full-access`. Unit checks additionally alternate distinct root/child
58
+ `read-only` and `workspace-write` policies to detect caching across callers.
59
+ These are forwarding checks, not an OS sandbox-confinement certification.
60
+
61
+ ## Loading failures and feature separation
62
+
63
+ Three additional alpha.4 CLI trials confirmed:
64
+
65
+ - Injected startup Python failure reports `GUARD_STARTUP_FAILED`, contributes
66
+ no guard tools and leaves the host able to run other tools.
67
+ - An absent bundle contributes no interception; the harmless marker runs.
68
+ - Explicitly enabling optional read redaction on alpha.4 reports
69
+ `READ_GUARD_STARTUP_REFUSED` and contributes no deletion/read guard from
70
+ that failed plugin row. Leave it disabled on alpha.4.
71
+
72
+ The default version expansion does not update native-read artifact hashes or
73
+ Lab session/config parsers. Their previous two-host contracts remain intact.
74
+
75
+ ## Manifest and regression scope
76
+
77
+ The default adapter's three-version profile matches top-level `engines.dsh`,
78
+ the optional DSH peer and nested `dsh.engines.dsh`. Actual rc.2 and alpha.4
79
+ compatibility helpers accepted all three declared versions and rejected twelve
80
+ unlisted versions each: six accept and 24 rejection checks, without exemptions.
81
+ The optional peer supplies compatibility metadata without installing DSH.
82
+ The legacy loader was checked through actual Profile/Boot rather than a
83
+ modern helper it does not provide.
84
+
85
+ The broader 12-version SDK experiment used controlled shell/synthetic Bash
86
+ tool bodies. Its remaining nine versions were not promoted into the published
87
+ declaration. This report's CLI checks use real native execution.
88
+
89
+ Package-manifest and DSH smoke/regression checks accompany this change.
90
+ The previous 974-test full run predates this expansion and is not its full-suite
91
+ result. Core decisions, command recognition, rm wildcard refusal, compensation,
92
+ recovery formats and the production JavaScript adapter retain their bytes.
93
+ Existing Kimi maintenance changes are separate from this DSH addition.
94
+
95
+ ## Limits
96
+
97
+ No external model, graphical UI, arbitrary PTC/API calls or concurrent-agent
98
+ trial was run. Policy forwarding does not prove OS sandbox enforcement.
99
+ Agent-less checks do not imply subagent coverage; the separate native child
100
+ cases above supply that bounded evidence. Package version, local test success
101
+ and a running host do not establish publication or activation in a user's
102
+ existing profile. Tag and release decisions remain pending.
@@ -1,6 +1,118 @@
1
- # Kimi Code 0.42.0 / 2.1.1: bounded Bash enforcement tests
2
-
3
- ## Current-host live sentinel: Kimi Code 2.1.1
1
+ # Kimi Code 0.42.0 / 2.1.1 / 2.3.0: bounded Bash enforcement tests
2
+
3
+ The Stop helper, separate doctor checks and 2.3.0 Bash profile ship in
4
+ [0.2.6](../releases/release-notes-0.2.6.md). Dated sections retain the source's
5
+ publication state at the time of each trial; their evidence limits are unchanged.
6
+
7
+ <a id="kimi-230-acceptance"></a>
8
+
9
+ ## Kimi 2.3.0 follow-up (2026-10-22, unpublished checkout)
10
+
11
+ The actual npm Kimi Code **2.3.0** CLI ran sixteen isolated trials with the
12
+ unpublished 0.2.6 checkout's existing PreToolUse bridge and optional Stop
13
+ helper. Eight used prompt CLI; eight used ACP with the service launched from
14
+ directory A and a session created in directory B. Each fixture had its own
15
+ home, configuration and Git workspace. Fixed OpenAI-compatible loopback
16
+ responses drove Bash calls: **36 loopback model-protocol requests, zero external
17
+ model calls**, and no production credentials. The environment was Linux
18
+ ARM64/PRoot Debian with Node 22.23.4.
19
+
20
+ The ACP client did not advertise a terminal capability, so Kimi executed
21
+ Bash locally. The hook observer recorded the original payload, process cwd,
22
+ bridge exit code and output without changing the decision. All invoked ACP
23
+ hooks ran in B and carried B as payload cwd, independently of startup in A.
24
+
25
+ | Case, run once through both prompt CLI and ACP | Observation |
26
+ |---|---|
27
+ | Harmless allow | Hook exited 0; the owned marker was created; empty Stop added no request. |
28
+ | Policy BLOCK | Core reported `BLOCK_FORCE_PUSH`; exit 2 blocked the inert command and its bypass marker was absent. |
29
+ | Core ASK | The adapter hard-refused with exit 2; the bypass marker was absent. This was no approval-UI test. |
30
+ | Missing Python after the shell bridge started | The bridge converted startup failure to exit 2; the marker was absent. |
31
+ | No hook configured | No hook receipt; the harmless bypass marker was created. This remains an uncovered path. |
32
+ | Recoverable deletion | The owned file was relocated; Stop supplied its actual txid, retained-space notice and complete GC commands in the next request; restoration matched the original bytes. |
33
+ | Partial compensation | The call was refused after a recorded move; Stop supplied the incomplete status and recovery guidance; the moved file restored exactly. |
34
+ | Same recoverable call without Stop | The file remained recoverable, but no recovery explanation entered a later request. |
35
+
36
+ Successful PreToolUse recovery output still did not reach the first request
37
+ after Bash. Stop added a third request in the two compensation cases. These
38
+ fixed responses establish delivery into a request, not a real model's
39
+ understanding or accurate final wording. No purge was run.
40
+
41
+ The `km` Web wrapper was separately checked with a private configuration:
42
+ 2.3.0 startup, HTTP 200, status recognition and shutdown passed. That was
43
+ not a Web-session tool-call trial. Normal/login Bash, an inherited old PATH,
44
+ and repeated configuration loading selected the updated executable; this is
45
+ local launcher evidence, not a new portable shell-configuration feature.
46
+
47
+ The unpublished checkout now lists exact version 2.3.0 in the
48
+ [Bash compatibility profile](../../adapters/kimi-code/compatibility.json).
49
+ The shared Core, payload mapping and bridge were unchanged. This admits the
50
+ observed root Bash contract; it does not establish 2.3.0 subagent, background,
51
+ concurrent, other-tool, client-provided terminal, timeout-failure or real-model
52
+ coverage. The [Lab capture helper](../../adapters/kimi-code/harness/README.md)
53
+ remains pinned to 2.1.1. Published 0.2.5 keeps its recorded version list.
54
+ The historical observations below retain their original versions and limits.
55
+
56
+ ## Recovery-feedback follow-up (2026-10-20, unreleased source)
57
+
58
+ A new Kimi 2.1.1 session used the checkout's PreToolUse 120-second hook and
59
+ optional Stop 30-second hook, with an isolated HOME, skills directory,
60
+ workspace and model budget. One configured model route completed three
61
+ requests, all HTTP 200. The client route does not independently identify
62
+ remote model weights; private connection and transaction identifiers are omitted.
63
+
64
+ The session performed one guarded deletion of a synthetic valuable file.
65
+ Stop supplied the recorded transaction ID and the full state, restore and
66
+ GC commands. The final supplement stated that retained files occupy storage
67
+ and restoration does not free total disk space. After the model stopped,
68
+ the controller restored the exact original bytes, confirmed RESTORED, and
69
+ verified a repeated Stop emitted no duplicate notice. The model did not
70
+ execute restore or purge itself.
71
+
72
+ The initial answer still appeared before Stop. This passing final supplement
73
+ does not guarantee every model's wording or cover the user's full daily
74
+ configuration, background work, shared-session actors or long conversations.
75
+ Fixed loopback normal/blocked calls separately confirmed ordinary commands
76
+ without compensations require no extra reply, and refused calls did not create
77
+ their inert markers.
78
+
79
+ This helper is absent from published 0.2.5. See [unreleased availability](../releases/unreleased.md)
80
+ and [setup and delivery limits](../../adapters/kimi-code/README.md#optional-recovery-feedback-unreleased-checkout-addition).
81
+
82
+ ## Hook failure audit (2026-10-20, local checkout)
83
+
84
+ Fourteen isolated trials used the actual 0.42.0 and 2.1.1 CLIs, native Bash
85
+ and the current checkout's bridge. Each CLI ran the seven cases below.
86
+ Thirty-two model-protocol requests received fixed loopback responses;
87
+ there were no external model calls or production credentials. These tests
88
+ establish hook behavior, not a real model's interpretation of feedback.
89
+
90
+ | Case, independently tested on both versions | Observed result |
91
+ |---|---|
92
+ | Started guard, process-local invalid dialect | Exit-2 refusal reached the host; inert Bash marker absent |
93
+ | Started bridge, missing Python interpreter | Exit-2 refusal; marker absent |
94
+ | Hook command does not exist | Bash ran and created the marker; no adapter started |
95
+ | Started hook delayed past a one-second host timeout | Bash ran and created the marker |
96
+ | Recoverable deletion and optional Stop feedback | Real txid, retained-space notice and complete GC commands entered the next request; public restore returned the original bytes |
97
+ | Stop Python startup failure | One feedback-unavailable continuation; the earlier successful Bash marker remained |
98
+ | Stop without compensation records | No additional model request |
99
+
100
+ The PreToolUse example now uses `timeout = 120`. Its previous 90-second
101
+ outer timeout matched the adapter's inner 90-second guard deadline and
102
+ left no startup/return margin. The one-second timeout probe demonstrates
103
+ the host's timeout behavior; it does not claim a measured 90-second race.
104
+ The longer example timeout reduces that race, while missing hooks and host
105
+ timeouts still allow tools. Local doctor checks do not exercise deadline
106
+ exhaustion or certify live interception.
107
+
108
+ The optional Stop addition is **not in the published 0.2.5 package**.
109
+ These new records supplement the earlier authenticated live trials below;
110
+ they do not replace their model, tool, subagent or failure limits. User
111
+ configuration, deletion policy and recovery formats were unchanged.
112
+
113
+ <a id="current-host-live-sentinel-kimi-code-211"></a>
114
+
115
+ ## Live sentinel (2026-09-27, Kimi Code 2.1.1)
4
116
 
5
117
  On 2026-09-27, the checksum-verified official Linux ARM64 build of Kimi Code
6
118
  CLI 2.1.1 ran two authenticated model routes in new isolated fixtures:
@@ -34,10 +146,11 @@ cwd, and a timed-out host is always `INCONCLUSIVE` even if block evidence was
34
146
  already present. The second route's prompt also forbids retrying after a block.
35
147
  Only the post-fix, exact-command, normally exited runs are counted as PASS.
36
148
 
37
- This current-host evidence covers one root-agent `Bash` call. It does not add
149
+ This sentinel evidence covers one root-agent `Bash` call. It does not add
38
150
  2.1.1 evidence for subagents, concurrent calls, ASK behavior, non-`Bash`
39
- tools, hook absence/timeouts or adapter-startup faults. Those remain separate
40
- from the broader historical 0.42.0 observations below.
151
+ tools, hook absence/timeouts or adapter-startup faults. The later fixed-loopback
152
+ failure audit above provides separate, bounded fault observations for both
153
+ versions; the broader historical 0.42.0 observations follow below.
41
154
 
42
155
  ## Historical Kimi Code 0.42.0 trials
43
156