Commit Graph
296 Commits
Author SHA1 Message Date
kingwl 75bd2b8aaa Merge remote-tracking branch 'origin/master' into fix/landlock-runner-failure-classification
# Conflicts:
#	.agents/notes/implemented/feature/2026-07-06-sandbox.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-06-sandbox.zh.md
#	docs/core-data-structures/sandbox.i18n.yaml
#	docs/core-data-structures/sandbox.zh.md
#	docs/postmortem/README.i18n.yaml
#	docs/postmortem/README.zh.md
#	examples/acp-agent/tests/acp.snapshot.ts
#	native/landlock-run/README.i18n.yaml
#	packages/sandbox/sandbox-local/README.i18n.yaml
#	packages/sandbox/sandbox-local/README.zh.md
#	packages/sandbox/sandbox/README.i18n.yaml
2026-08-05 13:17:38 +08:00
xjt 7bd111b2af Merge origin/master into xjt/proofreading-active-docs-2-apply 2026-08-05 10:57:53 +08:00
imccyu ca27512529 fix(packages): omit source publication payloads 2026-08-05 01:15:19 +08:00
Hypatia May 8c72cd3a8f docs(sandbox): align final runner evidence 2026-08-04 17:45:12 +08:00
xjt 2db712eec7 docs(i18n): proofread active Chinese documentation 2026-08-04 17:36:14 +08:00
Hypatia May ea762e3962 test(sandbox): pin runner argv forms 2026-08-04 17:19:19 +08:00
Hypatia May c4e9893a87 test(sandbox): cover POSIX no-shebang fallback 2026-08-04 17:10:42 +08:00
Hypatia May 666690afe9 fix(sandbox): round 7 align spawn evidence 2026-08-04 16:55:11 +08:00
Hypatia May fe818862e1 fix(sandbox): round 6 bind spawn provenance 2026-08-04 16:20:04 +08:00
Hypatia May 293fac9421 fix(sandbox): round 5 harden spawn attribution 2026-08-04 16:06:54 +08:00
Hypatia May 96ba98c99e fix(sandbox): require runner-specific spawn evidence 2026-08-04 14:47:46 +08:00
Hypatia May f91aedd074 refactor(sandbox): defer native protocol exports (round 3) 2026-08-04 13:37:33 +08:00
Hypatia May 319376ef1c fix(sandbox): preserve valueless spawn failures (round 2) 2026-08-04 12:16:21 +08:00
Hypatia May e36d040d0a fix(sandbox): spawn confined argv directly (round 1) 2026-08-04 12:04:48 +08:00
Huanqi Cao b50120e090 docs: attribute the hasPwsh probe to the caller and name the bash dialect
Round-four nits: the acp-snapshot README said 'the suite's hasPwsh probe
follows the executor's own resolution' — hasPwsh is caller-supplied, and the
resolvePwshPath-following behavior belongs to the shipped acp-agent caller;
reword to 'the caller-supplied hasPwsh probe (the shipped acp-agent suite
follows the executor's own resolution...)' on both language sides. And the
tool-bash README loses its only explicit pairing sentence with the dialect
guard reverted, so state the contract plainly: 'The tool contract is
bash-dialect — mount a bash-parsing executor' (both languages, pairing
re-recorded).
2026-08-03 23:38:41 +08:00
Huanqi Cao f14f826648 revert(bash): drop the executor dialect guard
The ShellDialect marker on BashExecutor and the load-time rejection in
tool-bash/tool-pwsh force every test and example fake executor to declare
a dialect for a guard with no in-repo or plausible deployment to catch
(shipped compositions always pair the tool with its matching executor),
and they break the example composition suites that stub ctx.bash without
a dialect (agent-spine-demo/cli-demo/acp-demo lost the bash tool).

Keep the non-dialect doc fixes that landed with the attempt: the tool-bash
README bashEnv contract trim with the stale example import removed, the
acp-snapshot suite.ts 'usable pwsh' JSDoc, and the pwsh.cordis.yml comment
indent. The parity note records the attempt and revert under Alternatives.
2026-08-03 23:16:53 +08:00
Huanqi Cao 3d1166fcdd feat(bash): shell tools reject a mismatched executor dialect at load
The seam gains ShellDialect ('bash' | 'powershell' - concrete shells, not
families: zsh or fish would be their own values, never 'bash'); bash-local
declares bash (bash-sandbox inherits), pwsh-local declares powershell, and
both tools throw at load when the mounted executor speaks another dialect -
previously tool-pwsh over bash-local handed PowerShell text to bash -c and
the deployment error surfaced as ordinary nonzero exits. Pinned by mismatch
tests on both tools; the parity note records the contract (both languages).

Also from the review round: the tool-bash README's managed-environment
section becomes a summary linking the owning dsh-bash-env contract (the
duplicated prose carried a stale owner in its example import), the
pwshOnly JSDoc drops the stale 'on PATH' phrasing, and the task-tools
contract comment in the two pwsh compositions is indented into its block.
2026-08-03 22:47:53 +08:00
Huanqi Cao dc4d2dc868 docs(bash): document the bashEnv hard dependency and dedupe the demo manifest
- tool-bash README (both languages) now shows the real four-service inject
  and attributes the session-persistence contributor to dsh-bash-env.
- pwsh-local README names the also-exported ENV_OVERRIDES/ENCODING_PREAMBLE.
- agent-spine-demo drops the duplicate bash-env devDependency key.
2026-08-03 20:26:39 +08:00
Hypatia May 295a799785 fix(sandbox): close classifier evidence gaps (round 2) 2026-08-03 17:48:41 +08:00
Hypatia May 6343d8f6e6 fix(sandbox): evidence-gate runner failures (round 1) 2026-08-03 17:31:08 +08:00
Huanqi Cao b482f12d57 fix(coverage): probe the pwsh exemption with the executor's own resolution
The review caught the pwshCoverageExclusions comment claiming the inverse of
the code's behavior: a bare-PATH probe FAILING grants the exemption, so a
win32 host where only install-location pwsh (or 5.1) resolves kept the
exemption while its suites ran - over-exempting, never tightening.

resolvePwshPath/candidatePwshPaths move to the dependency-free
pwsh-local/src/resolve.ts (index.ts re-exports; public API unchanged) and
vitest.config.ts probes with that shared definition, so the exemption is
active exactly when the suites skip. The two spec headers stop saying
'on PATH' for a probe that is deliberately not PATH-only, and the parity
note records the abort backport as the one both-ways parity change (both
languages, pairing re-recorded); catalogs regenerated for the line shift.
2026-08-03 00:21:17 +08:00
Huanqi Cao d6a763020b docs(pwsh-local): list the 5.1 non-ASCII stdin gap under Known Limitations (both languages) 2026-08-02 22:08:35 +08:00
Huanqi Cao b2838fb2be fix(pwsh): close the remaining review threads
- scrubbedParentEnv folds case before the DSH_ prefix check (Windows env
  names are case-insensitive; a parent dsh_* entry read back as \*
  in the child) and the service spec pins the lowercase probe.
- The acp.snapshot.ts pwsh probe follows resolvePwshPath() like the package
  suites, so a Windows host with only an install-location pwsh still runs
  the scenario.
- pwsh-tool-turn is re-recorded around [Console]::Out.Write('PWSH_OK'):
  the fixture carries no platform newline, so one recording replays on
  Windows and POSIX alike (record + refresh; replay-verified keyless).
- The pwsh-local Known Limitations bullet drops the self-defeating no-op
  advice: & { } is scoped to param(...), using/#requires scripts run from a
  file (both languages, pairing re-recorded).
- The capability-seams graph moves ctx.bashEnv ownership to bash-env and
  lists pwsh-local/tool-pwsh on the ctx.bash seam (source updated,
  docs regenerated).
- The tool-bash presenter fixture retires the stale 'command aborted'
  literal for the shipped 'tool call aborted' message.
2026-08-02 21:46:53 +08:00
Huanqi Cao 6ae0f78c2a fix(tools): pin the abort error info in the cancel fixture, close the jscpd mirror block, and restore the pwsh binary ignore 2026-08-02 20:27:06 +08:00
Huanqi Cao efcee43c7d docs(tools): document the abort message and the background call card; pin both with tests 2026-08-02 20:07:43 +08:00
Huanqi Cao 5e437d3996 docs(pwsh): scope the encoding claim, document the PATH probe and preamble limitation, and fix catalog requires lists 2026-08-02 19:37:45 +08:00
Huanqi Cao 12c6f43bf1 fix(tool-bash): report foreground aborts as the TOOL_ABORTED HarnessError 2026-08-02 19:37:29 +08:00
Huanqi Cao d8ee37d87a fix(tool-pwsh): present background calls on the generic card like the bash tool 2026-08-02 19:37:25 +08:00
Huanqi Cao a79d7c896c fix(tool-bash): mount bash-env in the sandboxed and HMR-safety harnesses; normalize the pwsh-tool-turn fixture line endings for Linux replay 2026-08-02 16:53:29 +08:00
Huanqi Cao 480c12077f fix(tool-bash): mount bash-env in the base test harness 2026-08-02 16:43:30 +08:00
Huanqi Cao 4e62fea095 docs: record the pwsh/bash parity decision and refresh catalogs and bilingual pairs 2026-08-02 14:18:55 +08:00
Huanqi Cao 33810ae774 feat(tool-pwsh): mirror dsh-tool-bash call-for-call minus the sandbox surface 2026-08-02 14:18:29 +08:00
Huanqi Cao af9af8ca05 fix(pwsh-local): pin UTF-8 I/O so the Windows PowerShell 5.1 fallback cannot garble output 2026-08-02 14:18:15 +08:00
Huanqi Cao 87db82e821 refactor(tool-bash): consume ctx.bashEnv from the shared bash-env package 2026-08-02 14:18:01 +08:00
Huanqi Cao d73888478a feat(bash-env): extract the shared DSH_* environment registry into its own package 2026-08-02 14:17:46 +08:00
Huanqi Cao 4c0b4c3558 Merge remote-tracking branch 'origin/feat/ripgrep-packaged-binary' into feat/pwsh-tool 2026-08-02 01:28:48 +08:00
Tianyi Cui 2309f97a16 chore(bash): mark bashEnv ownership FIXME 2026-08-02 00:57:15 +08:00
Huanqi Cao 30c421ed75 fix(pwsh): pin CI expectations for the mirror design
- jscpd: the executor/tool mirror dsh-bash-local/dsh-tool-bash by design
  (Agent Note), so the mirrored regions carry explicit ignore markers with
  reasons instead of being flagged as duplication.
- pwsh-local: a self-terminated process reports SIGTERM or SIGKILL on
  POSIX (PowerShell's Stop-Process choice), not only SIGTERM.
- gen-tool-catalog.spec: the shipped-tool completeness list gains 'pwsh'.
2026-08-01 19:34:12 +08:00
Huanqi Cao 8c6179d69d feat(pwsh): add the pwsh-local executor and the pwsh tool
Windows-native execution foundation: PwshLocalExecutor implements the bash
executor seam over ctx.subprocess (pwsh -NoLogo -NoProfile -NonInteractive
-Command, one argv element, no quoting layer; resolvePwshPath probes
PowerShell 7 / PATH / Windows PowerShell 5.1 as a pure function), and
tool-pwsh is the minimal PowerShell-dialect model-facing tool over ctx.bash
(foreground only, managed DSH_* env, timeout/signal/exit markers, terminal
and generic presenters). Both packages carry full suites (real pwsh,
self-skipping without it) at per-file 100% coverage; vitest's Windows
exclusion narrows from packages/bash/* to the bash-requiring packages so the
pwsh suites run natively on Windows too. The CLI gains the workspace deps
and tsconfig projects without mounting either plugin; the Windows-default
roadmap is recorded as a proposed Agent Note.
2026-08-01 18:48:17 +08:00
NI0317 1beb38554e fix(review): align runtime-context diagnostics and docs 2026-07-31 15:19:59 +08:00
Tianyi Cui e088cfa59d refactor(sandbox-policy): remove capability family registries 2026-07-31 13:49:41 +08:00
NI0317 8b4cbe4293 feat(system-prompt): cache dynamic policy context 2026-07-30 22:09:15 +08:00
NI0317 87a4aaa32e feat(sandbox-policy): describe enforced file families 2026-07-30 18:51:29 +08:00
xjt de0348bd9e docs(i18n): standardize reviewed README headings 2026-07-29 20:16:45 +08:00
j-xiang 599e6edc87 docs(i18n): record proofread README pairs 2026-07-29 15:30:44 +08:00
j-xiang 333b4bcd30 docs(i18n): proofread README translations 1-20 2026-07-29 15:29:24 +08:00
Turtle 31cb340c36 feat(tui)!: consolidate terminal UI improvements 2026-07-29 10:00:29 +08:00
_Kerman fbf87e660c refactor: identify and freeze messages at creation 2026-07-28 13:55:59 +08:00
_Kerman c6073f07c2 Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	docs/architecture.i18n.yaml
#	docs/architecture.md
#	docs/architecture.zh.md
#	docs/core-data-structures/core.i18n.yaml
2026-07-27 19:55:55 +08:00
Tianyi Cui 5717726835 subprocess: one explicit env channel on the spawn spec
Drop SubprocessSpawnSpec.dshEnv and splitEnvChannels(); childEnv() is now
scrubbed-base + explicit entries with no namespace validation. The invariant
dropped is the reserved-namespace check on explicit entries (DSH_* rejected
from env, non-DSH_* rejected from dshEnv). Explicit-entry trust already
covers it: an explicit credential-shaped entry has always merged after the
scrub as a deliberate caller opt-in, and an explicit DSH_* entry is the same
deliberate act — the staleness invariant lives entirely in scrubbedParentEnv
dropping AMBIENT credential-shaped and DSH_* names, which stays. The
validation's only observed effect was rejecting legitimate explicit entries:
both recent CI breakages (DSH_GATE_CONCURRENCY exported into every job
crashing lsp specs, DSH_PERMISSION_MODE in acp config.env crashing the
child spawn) were this check firing on values a caller meant to pass, each
fixed by routing around the bureaucracy the seam itself imposed.

The bash seam keeps its own request/spec dshEnv field: that is bash-owned
trusted-plugin vocabulary (the ctx.bashEnv collected overlay) whose merge-last
position guarantees a caller env entry cannot displace a managed fact;
bash-local now flattens ENV_OVERRIDES -> spec.env -> spec.dshEnv into the
seam's one env map. subagent-acp and lsp-local pass their single config env
map straight through. DshEnvironment/DshEnvironmentKey/DSH_ENV_PREFIX stay on
the subprocess seam as the namespace vocabulary (bash re-exports them;
scrubbedParentEnv filters on the prefix).

Tests: the two channel-rejection specs and the splitEnvChannels partition
spec are deleted; one spawn spec now proves an explicit DSH_* env entry
reaches the child while an ambient one is scrubbed; the acp/lsp forwarding
specs keep their MOCK_ECHO_ENV / LSP_FAKE_ECHO_ENV assertions with the split
comments rewritten to merge-after-scrub. Docs (en+zh, re-recorded) and the
owning Agent Notes updated; cordis api/services catalogs regenerated.
2026-07-27 04:14:51 +08:00