100 Commits
Author SHA1 Message Date
Huanqi Cao ed463d74bf fix(workflow): use optional syntax for the tsconfig pin parameter 2026-08-13 15:16:12 +08:00
Huanqi Cao 314fedfc14 docs: record the junction-safe fixture teardown decision 2026-08-13 15:16:12 +08:00
Huanqi Cao 29d420f1ee fix(pwsh): accept link-shaped candidates and sync the README contract 2026-08-13 15:16:12 +08:00
Huanqi Cao 7593842ccf fix(workflow): forward the tsconfig pin only in the unbuilt worker 2026-08-13 15:16:12 +08:00
Huanqi Cao 095fde4ffd test(claude-code): isolate ambient Anthropic model env 2026-08-13 15:16:12 +08:00
Huanqi Cao c29246ae31 fix(pwsh): resolve Store app execution aliases 2026-08-13 15:16:12 +08:00
Huanqi Cao a62884a565 docs: add junction-safe unlink rule to defensive patterns 2026-08-13 15:16:12 +08:00
Huanqi Cao 22d30852f7 test(app-boot): unlink hmr alias junctions before removing the target 2026-08-13 15:16:12 +08:00
Huanqi Cao 9e9073da24 fix(boot): unlink stale profile fallback links instead of rmSync 2026-08-13 15:16:11 +08:00
Huanqi Cao 4ed036da1c fix: Windows-native CI findings on latest master
Local run of check:ci:windows-complete (the windows-native gate) on
latest master surfaced five Windows-only failures, all unreachable by
current CI because the native windows job is disabled and the wine gate
only covers build+site.

- install-lefthook/translation-pairing-merge specs junctioned the real
  scripts/ and tsx package into fixtures; Windows recursive deletion
  (Node rmSync and git worktree remove) follows MOUNT_POINT junctions and
  deleted the repository's own directories mid-run. Fixtures now unlink
  their reparse points before any recursive removal (shared helper in
  scripts/test-fixture-cleanup.ts).
- workflow-workerthread spawned its worker with an empty env; on Windows
  os.tmpdir() then degrades to the literal relative path undefined\temp,
  so tsx wrote its transform cache into a cwd-relative undefined/
  directory inside the repo. The worker env now injects the host temp
  path on win32 (workerSpawnEnv, platform-parameterized and unit-tested
  on both arms).
- workspace-context spec did not stub USERPROFILE (win32 homedir) or a
  set DSH_HOME, leaking the developer machine's real ~/.dsh/AGENTS.md
  into discovery.
- ui-trajectory client-bundle spec mounted the built artifact without the
  remote/settingsScope provides the locale plugin needs, so the plugin
  never activated and no view registered.
- subagent temp-fixture cleanup lacked the maxRetries Windows handle
  release needs under load (EPERM); added retries to the three affected
  specs and the fixture-cleanup helper.
2026-08-13 15:16:11 +08:00
Huanqi Cao 50bedaf03b Merge pull request #2234 from deepseek-harness/feat/loader-entry-disabled-interpolation
feat(loader): interpolate the entry disabled field
2026-08-12 11:40:02 +08:00
Huanqi Cao 0c0a2a2b65 fix(gate): allowlist the cordis preset id in the rescope check
The preset-roster loop added by this PR names the \cordis\ preset id in
apps/cli/tests/windows-shell.spec.ts; the bare token is product data like
the existing agent-preset allowlist entries, not a package reference, so
the rescope-vendor hygiene check must not rewrite it.
2026-08-12 01:02:31 +08:00
Huanqi Cao 05a8846c6e refactor(preset): trim the shell-row comments
Drop the filler and factually loose comments added with the tool-pwsh rows:
the platform expressions self-explain, the web-app overlay comment repeats
the file header, and the spec comments now state only the platform-scoped
evaluation fact.
2026-08-11 21:38:51 +08:00
Huanqi Cao ccb3e4aaac Merge remote-tracking branch 'origin/master' into feat/loader-entry-disabled-interpolation
# Conflicts:
#	scripts/verify-cordis-config.ts
2026-08-11 21:04:49 +08:00
Huanqi Cao 32744c2b5c refactor(preset): gate tool-pwsh by platform alongside tool-bash
The web-app overlay now disables the host tool-pwsh row too, and the shipped
presets (standard/code/cordis) declare both shell tool rows with inverted
platform gates — tool-bash on POSIX, tool-pwsh on win32 — so the preset layer
exposes exactly one shell tool per host and a preset can drop or replace the
shell tool on either platform. windows-shell.spec pins both preset gates and
both host tool rows disabled in the web composition; the loader and Windows
pwsh notes are updated in place.
2026-08-11 20:21:57 +08:00
Huanqi Cao 3f2490a7c4 Merge remote-tracking branch 'origin/master' into feat/loader-entry-disabled-interpolation 2026-08-11 20:00:54 +08:00
Huanqi Cao 234a1b37c1 fix(gate): use the oxlint disable form for the compile-only check 2026-08-11 19:07:56 +08:00
Huanqi Cao e56b1ccab2 refactor(loader): tighten the disabled gate and rehome the note
Address review: the gate module docstring now states the actual evaluation
contexts (config after injections against the plugin context, disabled at
every mount decision against the loader context); metadataExpressionErrors
rejects expressions nested below disabled and syntax-checks the disabled
expression itself so an unparseable gate fails at the gate instead of the
boot. The tutorial's !!js claims follow, and the loader note moves to
implemented/architecture with its inbound links retargeted.
2026-08-11 18:52:52 +08:00
Huanqi Cao 25329fcb79 Merge remote-tracking branch 'origin/master' into feat/loader-entry-disabled-interpolation
# Conflicts:
#	vendor/README.md
#	vendor/loader/src/config/entry.ts
2026-08-11 18:43:40 +08:00
Huanqi Cao ad1d690dd4 fix(bundle): record base README pairing and drop the deleted patch path from the note 2026-08-11 15:54:37 +08:00
Huanqi Cao 2a6658252c Merge remote-tracking branch 'origin/master' into feat/loader-entry-disabled-interpolation
# Conflicts:
#	.agents/notes/implemented/feature/2026-08-01-windows-pwsh-default.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-01-windows-pwsh-default.md
#	.agents/notes/implemented/feature/2026-08-01-windows-pwsh-default.zh.md
2026-08-11 15:33:09 +08:00
Huanqi Cao 1b2a5c55dd chore: retrigger CI after a lost synchronize dispatch 2026-08-11 15:23:54 +08:00
Huanqi Cao 4308f91e88 refactor(bundle): fold the Windows shell platform layer into the base rows
Entry \disabled\ interpolation makes the launcher's separate platform layer
unnecessary: the base bundle's cordis.patch.yml now gates both shell stacks
on its own rows — bash-sandbox/tool-bash disable on win32, and their twins
pwsh-sandbox/tool-pwsh mount only there with the inverted expression — so
exactly one shell stack mounts per host from one shared patch file.

windows.cordis.patch.yml and the launcher's windows-shell.ts injection (boot,
live recomposition, config dumps) are deleted, with the workspace-constraints
entry and the dsh-base exports/files entries following. The windows-shell spec
pins the effective per-platform roster through the real bundle layers, and
base.spec pins the four symmetric gates. The superseded active notes are
updated and cross-linked; the loader note records the fold itself.
2026-08-11 15:11:45 +08:00
Huanqi Cao f00a29111b Merge remote-tracking branch 'origin/master' into feat/loader-entry-disabled-interpolation 2026-08-11 13:40:24 +08:00
Huanqi Cao 6fb226ea24 feat(loader): interpolate the entry disabled field
The Windows platform layer disables tool-bash and inserts the pwsh stack, but the shipped presets each mount a tool-bash row that re-enabled the tool on win32 — the session had both a PowerShell-backed bash tool and tool-pwsh, silently, because no spec pinned the composed preset layer.

The Loader now evaluates a disabled: !!js expression against the loader context at every mount decision; disabled is the only interpolated metadata field, and the raw node stays in the options so write-back keeps the !!js form. The standard/code/cordis presets gate tool-bash with process.platform === 'win32', verify-cordis-config allows expressions in disabled only, and the windows-shell spec pins the preset-level invariant.
2026-08-11 11:33:53 +08:00
Huanqi Cao cd226191a8 Merge pull request #2182 from deepseek-harness/fix/windows-native-acl-coverage
fix(ci): restore the native Windows coverage denominator to green
2026-08-10 21:21:53 +08:00
Huanqi Cao 539d116d57 Merge remote-tracking branch 'origin/master' into fix/windows-native-acl-coverage 2026-08-10 21:05:38 +08:00
Huanqi Cao 84964ba661 Merge remote-tracking branch 'origin/master' into fix/windows-native-acl-coverage
# Conflicts:
#	packages/preset/agent-presets/src/authoring.ts
#	vitest.config.ts
2026-08-10 21:04:44 +08:00
Huanqi Cao 0a17575040 fix(sandbox): address review: leak FIXME, legal ACL fixture, stronger offset test, prose 2026-08-10 19:34:01 +08:00
Huanqi Cao 59a2e4d825 fix(ci): restore the native Windows coverage denominator to green
The windows-native job has been red since #1990 put the sandbox-windows-acl sources into the Windows 100%-per-file denominator without tests carrying them, and #1543 dropped the authoring.ts V8 ignore for the POSIX-only owner-execute branch. Non-blocking at merge time, the red state has propagated to every later pull request.

Cover every in-process ACL-sandbox failure branch with stub-based failure-path suites (ffi/acl/token/spawn/index), following the package's existing failure-paths pattern; the package now measures 100% per file under the Windows denominator. Exclude only the runner entry from the win32 denominator: it executes exclusively as a spawned child outside the instrumented run, and its behavior is pinned end-to-end by the runner suite. Restore the authoring.ts narrow V8 ignore and add one for the dispose token guard whose absent-token arm is lifecycle-unreachable. Update the dual-lane Agent Note with the denominator composition.
2026-08-10 19:07:35 +08:00
Huanqi Cao 4cedc69966 Merge pull request #1990 from deepseek-harness/feat/windows-acl-sandbox
feat(sandbox): Windows ACL write-restriction sandbox (restricted-token runner)
2026-08-10 12:51:31 +08:00
Huanqi Cao beefa3c43b Merge pull request #1829 from deepseek-harness/feat/windows-pwsh-default
feat(bundle): default Windows hosts to the pwsh shell stack
2026-08-10 12:51:00 +08:00
Huanqi Cao c9285753de Merge branch 'merge/1829-master' into merge/1990-1829
# Conflicts:
#	docs/module-graph.i18n.yaml
#	docs/module-graph.md
#	docs/module-graph.zh.md
2026-08-10 12:35:32 +08:00
Huanqi Cao 2a6aba0f48 Merge remote-tracking branch 'origin/master' into merge/1829-master
# Conflicts:
#	apps/cli/package.json
#	pnpm-lock.yaml
2026-08-10 12:32:14 +08:00
Huanqi Cao 0b9f4844c2 fix(config): drop the obsolete lsp-local coverage exclusions
Master's native Windows coverage lane now covers the LSP sources, and its
ci-workflow spec asserts the exclusion paths are absent from vitest.config.ts;
keeping them (as carried over in the merge) fails both the coverage and the
native Windows lanes. The sandbox-windows-acl exclusion stays: that package
is win32-only and the Linux lane cannot cover it.
2026-08-10 12:30:46 +08:00
Huanqi Cao ad54135d43 fix(sandbox-local): block-body the default rmTempDir fallback
The arrow shorthand implicitly returns rmSync's void, which the
no-confusing-void-expression rule forbids; the block body keeps the
fallback without the violation.
2026-08-10 12:30:39 +08:00
Huanqi Cao a3a91aa654 Merge branch 'merge/1829-master' into merge/1990-1829
# Conflicts:
#	vitest.config.ts
2026-08-10 11:24:58 +08:00
Huanqi Cao a7b973757b Merge remote-tracking branch 'origin/master' into merge/1829-master 2026-08-10 11:23:08 +08:00
Huanqi Cao ee38c2540b Merge branch 'merge/1829-master' into merge/1990-1829 2026-08-10 11:12:52 +08:00
Huanqi Cao 2474b6e638 Merge remote-tracking branch 'origin/master' into merge/1829-master
# Conflicts:
#	scripts/project-doc-site.spec.ts
2026-08-10 11:12:39 +08:00
Huanqi Cao 976020f2bb refactor(sandbox): derive the private temp dir; drop the acl-session record
The durable sandbox/acl-session event carried a workspace binding that
always equals the session cwd and a random temp path that only needed
to be stable per session. Both are now derived: the temp subdirectory
is sha256(session id + workspace), created exclusively and removed on
provider dispose, so fork/resume semantics fall out of the derivation
and the record, its fold/provision/tamper validation, the immediate
flush kick, and the session-store dependency all disappear.
2026-08-10 01:03:29 +08:00
Huanqi Cao a29966b71f Merge branch 'feat/windows-pwsh-default' into feat/windows-acl-sandbox
# Conflicts:
#	.agents/notes/implemented/feature/2026-08-02-pwsh-tool-bash-parity.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-02-pwsh-tool-bash-parity.md
#	.agents/notes/implemented/feature/2026-08-02-pwsh-tool-bash-parity.zh.md
#	docs/module-graph.i18n.yaml
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	packages/bash/tool-pwsh/README.i18n.yaml
#	packages/bash/tool-pwsh/README.md
#	packages/bash/tool-pwsh/README.zh.md
2026-08-09 23:19:14 +08:00
Huanqi Cao 2720091429 Merge remote-tracking branch 'origin/master' into feat/windows-pwsh-default
# Conflicts:
#	.agents/notes/proposed/feature/2026-08-01-windows-pwsh-default.i18n.yaml
#	.agents/notes/proposed/feature/2026-08-01-windows-pwsh-default.md
#	.agents/notes/proposed/feature/2026-08-01-windows-pwsh-default.zh.md
2026-08-09 22:59:34 +08:00
Huanqi Cao 4cfe4366d7 docs(note): drop the stage-numbering residual from the windows-default note
The roadmap stage reference dated the decision record; the purge
standard removes change-history narration and stage numbering from
implemented notes.
2026-08-09 22:58:10 +08:00
Huanqi Cao 63ad5d6d98 refactor(cli): drop the redundant existence pre-check in resolveWindowsShellLayer
loadOverlayPatches already throws on a missing file (the caller named
it, so absence is a misconfiguration) — the existsSync guard was a
second fail-loud mechanism for the same miss with a prettier message.
The loader's throw keeps the fail-loud contract the Windows-default
note records.
2026-08-09 18:53:38 +08:00
Huanqi Cao f5caadc808 Merge branch 'feat/windows-pwsh-default' into feat/windows-acl-sandbox
# Conflicts:
#	packages/bash/pwsh-local/src/index.ts
#	packages/sandbox/sandbox-local/src/index.ts
2026-08-09 17:50:55 +08:00
Huanqi Cao 8af10a54b9 Merge remote-tracking branch 'origin/master' into feat/windows-pwsh-default 2026-08-09 17:45:36 +08:00
Huanqi Cao 428f84f710 test(docs): split placed-image paths on either separator
The placer tests receive absolute paths; on Windows the POSIX-only
split kept the whole path as the basename. The windows-acl branch
already carries this fix from an earlier merge-forward.
2026-08-09 17:11:18 +08:00
Huanqi Cao d7e19a0977 docs(sandbox): pin the translated confinement-runner heading anchor
The upgraded md-links gate resolves same-file fragments against the
zh file's own heading slugs; the translated heading needs the explicit
a-id anchor the corpus convention uses for cross-language fragments.
2026-08-09 17:06:36 +08:00
Huanqi Cao 165ad7e969 Merge branch 'feat/windows-pwsh-default' into feat/windows-acl-sandbox
# Conflicts:
#	.agents/notes/implemented/feature/2026-08-01-pwsh-tool-and-executor.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-01-pwsh-tool-and-executor.zh.md
#	packages/bash/tool-pwsh/README.i18n.yaml
#	packages/bash/tool-pwsh/README.zh.md
2026-08-09 16:59:52 +08:00
Huanqi Cao 018009338b Merge remote-tracking branch 'origin/master' into feat/windows-pwsh-default
# Conflicts:
#	.agents/notes/proposed/feature/2026-08-01-windows-pwsh-default.i18n.yaml
#	.agents/notes/proposed/feature/2026-08-01-windows-pwsh-default.zh.md
#	packages/bundle/base/README.i18n.yaml
#	packages/bundle/base/README.md
#	packages/bundle/base/README.zh.md
2026-08-09 16:37:48 +08:00
Huanqi Cao 33e4c6580f feat(tool-pwsh): teach the confined named-pipe capture boundary to the model
Under read-only and workspace-write the Windows ACL sandbox leaves
programs unable to open named pipes, so a piped-stdio spawn fails with
EPERM. State that boundary in the pwsh tool description next to the
ConstrainedLanguage contract, pin it in the tool tests, and bring the
package README and both implemented Agent Notes current with it.
2026-08-09 16:34:25 +08:00
Huanqi Cao 8f2c7c5047 docs(sandbox): attribute the named-pipe default SD to the Win32-layer user-mode template
CreateNamedPipeW with NULL security attributes does not install a kernel
template: KernelBase builds the documented 5-ACE default SD in user mode
and passes it down; the kernel itself (a raw SD-null create) applies the
token default DACL. Correct the claim in both README sides and the
runner.spec pin comment, and link the MS template documentation.
2026-08-09 16:34:09 +08:00
Huanqi Cao 01a3b454f6 fix(sandbox): extend the restricted token's default DACL with a write-SID ACE
New objects created without an explicit security descriptor take
their DACL from the token's default DACL, which CreateRestrictedToken
builds from the user's ambient SIDs — none of them a restricting SID.
Confined children therefore failed the write pass-2 check when
creating anonymous pipes (CreatePipe: ERROR_ACCESS_DENIED, surfaced
as Node EPERM), breaking PowerShell pipelines and other CreatePipe
consumers. Merge a full-access write-SID ACE (Everyone under
read-only) into the token default DACL at init via
SetTokenInformation(TokenDefaultDacl).

Named pipes are EXEMPT: their default security descriptor is the
kernel's PUBLIC template (owner/SYSTEM/Admins full, Everyone
read-only), which no token change influences, so libuv's piped stdio
capture stays denied for confined grandchildren — the POC-documented
boundary, now pinned by the runner suite (inherit/ignore OK, pipe
DENIED) and documented in the README pair. The NUL paragraph is
corrected to the measured matrix (Everyone has 0x1201BF on the
device: cmd/node writes land; Set-Content fails at the PS layer).
2026-08-09 12:34:48 +08:00
Huanqi Cao bb50783002 test(sandbox): cover the temp-grant cleanup-failure AggregateError path 2026-08-09 10:57:01 +08:00
Huanqi Cao 8119bc3401 test(sandbox): fix grant-count and dispose-warning assertions
The reparse case reuses the standing workspace grant of the preceding
case (same workspace -> map hit), so the failed temp grant is the third
grant, not the fourth; the dispose-warning text carries 'failure(s)'.
2026-08-09 10:51:02 +08:00
Huanqi Cao 5fea4b7c4b feat(sandbox): derive the windows-acl write SID per workspace, not per session
The per-session random write SID forced a full tree propagation per
session per server lifetime (minutes on large workspaces). The write
SID is now the per-workspace identity derived from the canonical
workspace path (workspaceWriteSid: sha256 -> S-1-4-x-y), stored
nowhere: the workspace-root ACE materializes once per workspace per
machine and every later provision hits the exact-ACE skip.

- workspace ACEs are STANDING (never revoked - the reuse cache); temp
  ACEs stay revocable (disposed with the provider), so an inheritable
  ACE never outlives its session's temp dir on the ambient temp root
- AclSandbox requires the write SID under workspace-write; read-only
  parses/grants nothing; the runner derives the SID itself (the
  --write-sid flag's presence still marks the seam-managed contract)
- the acl-session record drops writeSid (sessionId/workspace/tempDir
  remain): the SID-tamper surface and its validation are gone
- sandbox-local holds two grant maps: standing workspace grants and
  revocable per-session temp grants

Docs (README pair, design note pair, catalogs, type-equiv) and the
acl-session/grant/acl/probe/runner suites updated; workspace-sid.spec
pins the derivation contract.
2026-08-09 10:44:35 +08:00
Huanqi Cao d18dc76b89 chore(docs): regenerate module graph for merged tree
The merge-forward took the parent's module-graph verbatim; the merged
tree adds the sandbox-windows-acl package and dsh-session edges.
verify-module-graph is a ci-static gate, not in local doc-sync.
2026-08-09 03:19:09 +08:00
Huanqi Cao 5e080849aa Merge remote-tracking branch 'origin/feat/windows-pwsh-default' into feat/windows-acl-sandbox
# Conflicts:
#	apps/cli/reference/README.i18n.yaml
#	docs/cordis-catalog/services.md
#	docs/module-graph.md
#	docs/subsystems/sandbox.i18n.yaml
#	packages/sandbox/sandbox/README.i18n.yaml
#	pnpm-lock.yaml
#	scripts/verify-package-readme-model-experience.ts
2026-08-09 02:53:48 +08:00
Huanqi Cao cb6ff7e1f8 Merge remote-tracking branch 'origin/master' into feat/windows-pwsh-default
# Conflicts:
#	apps/cli/reference/README.i18n.yaml
#	pnpm-lock.yaml
2026-08-09 02:24:25 +08:00
Huanqi Cao 55fd6e555a fix(knip): restore pwsh-sandbox entry body mangled by merge
The merge-forward collapsed the pwsh-sandbox key with the parent's
e2b entry into invalid JSON; restore the branch's original entry
alongside the kept e2b entry.
2026-08-09 02:14:45 +08:00
Huanqi Cao 2bfc8273ee fix(pty-local): expect sessionId in resolved policy after merge-forward
Master's pty-local rewrite dropped the sessionId expectation from the
resolved-policy contract; sandbox-policy resolve() injects the owner
sessionId (sandbox branch design). Restore it in both expectations.
2026-08-09 01:56:53 +08:00
Huanqi Cao 97a62fa639 Merge remote-tracking branch 'origin/feat/windows-pwsh-default' into feat/windows-acl-sandbox
# Conflicts:
#	docs/module-graph.md
#	knip.json
#	packages/pty/pty-local/tests/index.spec.ts
#	scripts/check-workspace-constraints.ts
2026-08-09 00:29:55 +08:00
Huanqi Cao 544290f3b6 Merge remote-tracking branch 'origin/master' into HEAD 2026-08-09 00:22:50 +08:00
Huanqi Cao db7bcbdf91 test(sandbox): cover the durable-record typeof guards and the empty-workspace branch 2026-08-09 00:06:50 +08:00
Huanqi Cao 18859c408c fix(sandbox): record the dsh-session dependency in the lockfile 2026-08-08 23:59:52 +08:00
Huanqi Cao 6478da61e3 fix(sandbox): harden the per-session record and the ACL runner failure paths (review round v6)
Durable record: bound to the owning session id and validated at the fold (orphan-SID shape, temp path inside the host temp root) — a fork's copied parent record no longer provisions the child, and a tampered record fails loud. Private temp dir: random unguessable name persisted in the record, created exclusively (pre-existing entries and reparse points fail EEXIST). Persistence: a fresh provision kicks an immediate flush (no write-behind debounce), narrowing the crash window to the flush latency — documented as the one self-healing gap. Runner-failure rules: exit-gated on 127 so a confined command that prints the signature on a non-127 exit is never misclassified. Spawn: AssignProcessToJobObject failure terminates the suspended child (no hanging orphans). SandboxExecutionPolicy.sessionId is the branded SessionId. Boundary docs: qualifying clause on the absolutist sentences, NULL-DACL Known Limitation, 'full' scoped to the supported NTFS surface, CLM gate comment.
2026-08-08 23:23:38 +08:00
Huanqi Cao 441927c526 fix(sandbox): drop Authenticated Users from both restricting lists — close the C:\\-root escape, CIM unavailable in every confined mode
workspace-write now runs [logon SID, Everyone, orphan]: the two lists differ only by the orphan, and the keep-alive group (logon SID + Everyone) is the single shared invariant. The WMI namespace security check fails in BOTH modes (0x80041003), so CIM/Get-ComputerInfo are unavailable everywhere — the price of closing the C:\\-root tree-creation escape (AU:(AD) + AU:(OI)(CI)(IO)(M)) in workspace-write too. The unused WinLocalSid/WinInteractiveSid/WinAuthenticatedUserSid constants and their ABI-probe prints are removed; the enforcement 'full' claim now stands on a closed NTFS surface. New regression: a C:\\Users\\Public subdirectory write is denied under BOTH modes (the ambient-writable blind spot the review flagged — INTERACTIVE is absent from both lists). FAT-class (non-ACL) targets outside the granted roots remain writable (no security descriptors to intersect) — documented as a legacy residue, warn-only, not engineered around. Docs/design note/PR body updated in both languages (list I/J terminology gone everywhere).
2026-08-08 21:55:02 +08:00
Huanqi Cao 9d10a1888b fix(pwsh): record the tool-pwsh user-approval dependency in the lockfile 2026-08-08 20:24:19 +08:00
Huanqi Cao 7eadde5c58 Merge remote-tracking branch 'origin/feat/windows-pwsh-default' into feat/windows-acl-sandbox
# Conflicts:
#	apps/cli/reference/README.i18n.yaml
2026-08-08 20:18:56 +08:00
Huanqi Cao 03cf9caba2 Merge remote-tracking branch 'origin/master' into HEAD 2026-08-08 20:15:08 +08:00
Huanqi Cao 83f835e4cb feat(pwsh): mirror the bash sandbox surface — denial rendering, escalation, and the ConstrainedLanguage contract
tool-pwsh now renders sandbox denial facts (denial marker + same-turn escalation hint, runner-failed notice on background reads) and advertises the sandbox_permissions/justification escalation pair resolved through ctx.approval before execution — the shared fail-closed sequence from dsh-sandbox, with the tool name 'pwsh'. The description teaches the ConstrainedLanguage contract under the Windows sandbox (both confined modes run pwsh in CLM: Add-Type, non-core .NET statics, COM, and reflection fail; the mode cannot be lifted — probe-verified, pinned by LANGMODE assertions in the runner suite and description assertions in the tool suite). The stale pwsh-sandbox JSDoc ('the tool owns approval') and the parity notes' superseded 'minus sandbox' claims are corrected.
2026-08-08 20:11:21 +08:00
Huanqi Cao 2dd9af6f4b fix(sandbox): keep read-only strictly zero-grant by dropping the write-allowlist SID from list I
A session that materialized its workspace-write grant and then switched to read-only (or crashed and resumed under read-only) kept a writable workspace for the server lifetime: the standing orphan-SID ACE survived the downgrade and list I still carried the orphan, so the write-restricted pass-2 check granted it. List I is now [logon SID, EVERYONE] only — the standing ACE stays inert under read-only while the unrevoked ACE keeps the re-upgrade free (map hit, no re-propagation). Pinned by the runner's real-token mode-downgrade regression (standing ACE denied under read-only, effective again on re-upgrade), the acl-session mode-switch cycle (nothing under read-only, one materialization on upgrade, no revoke on downgrade), and ConstrainedLanguage pins in both modes.
2026-08-08 20:11:01 +08:00
Huanqi Cao 69fd67bfd8 fix(docs): restore the cli reference pairing record to the multi-line contract after the merge-forward 2026-08-08 18:25:48 +08:00
Huanqi Cao e9b1c64a38 fix(sandbox): update the missing-runner snapshot for the Windows-aware SANDBOX_UNAVAILABLE text 2026-08-08 18:16:19 +08:00
Huanqi Cao f1af1831ef fix(docs): point the parity note at the implemented windows-pwsh-default note and re-record the pair 2026-08-08 18:10:21 +08:00
Huanqi Cao 644162d4df fix(docs): re-record the parity note pair hashes after the EOF normalization 2026-08-08 18:03:15 +08:00
Huanqi Cao c0991f2568 fix(docs): point the parity note at the implemented windows-pwsh-default note and refresh catalogs after the merge-forward 2026-08-08 17:58:35 +08:00
Huanqi Cao cc64c729db Merge remote-tracking branch 'origin/feat/windows-pwsh-default' into feat/windows-acl-sandbox
# Conflicts:
#	apps/cli/reference/README.i18n.yaml
#	knip.json
#	packages/sandbox/sandbox-local/package.json
#	pnpm-lock.yaml
#	scripts/check-workspace-constraints.ts
2026-08-08 17:50:39 +08:00
Huanqi Cao d1b080a68d Merge remote-tracking branch 'origin/master' into HEAD
# Conflicts:
#	.agents/notes/implemented/feature/2026-08-05-pwsh-ui-bash-parity.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-05-pwsh-ui-bash-parity.md
#	.agents/notes/implemented/feature/2026-08-05-pwsh-ui-bash-parity.zh.md
#	apps/cli/reference/README.i18n.yaml
2026-08-08 17:42:47 +08:00
Huanqi Cao 07c7e2f0bd fix(sandbox): revoke post-apply grant failures, free init SID allocations, and name the Windows runner in SANDBOX_UNAVAILABLE 2026-08-08 17:39:25 +08:00
Huanqi Cao 43d53d339d fix(pwsh): stamp the calling session's sandbox policy onto pwsh tool calls 2026-08-08 17:30:04 +08:00
Huanqi Cao abfb933620 feat(sandbox): per-session windows-acl write grant with dual-mode restricting lists and a private temp subdirectory 2026-08-08 17:29:43 +08:00
Huanqi Cao 91d3ed6c5a fix(sandbox): address the ACL backend review findings — quoting, DACL merge+lock, failure paths
quoteArg doubles end-of-string backslashes (real CommandLineToArgvW round-trip test; first-token exemption noted); grantWrite merges into the current DACL instead of replacing it, and both grant/revoke hold a LockFileEx per-path lock under GetTempPathW/dsh-acl-locks (koffi crashes on NULL lpOverlapped — a zeroed OVERLAPPED is used); GRANT_MASK gains DELETE|FILE_DELETE_CHILD (never WRITE_DAC/WRITE_OWNER) though the win32 26200 second check only constrains the WRITE bit; failure paths close all handles (CreateProcessAsUserW pipe set, ResumeThread thread/process/job) with stub-api tests; getTempPathW refuses undersized buffers; drainPipe backs off; runner.spec pwshAvailable uses the resolvePwshPath probe; NTSTATUS exit codes mirror bit-exact (verified end-to-end); WinLocalSid JSDoc re-attributed to WinLocalLogonSid. All gates green: 42 passed/2 skipped, typecheck, oxlint, 0 clones, constraints, knip.
2026-08-08 14:32:01 +08:00
Huanqi Cao fa591b5ebd docs(sandbox): record the DACL churn limitation and the win32 snapshot substitution
Known Limitations gains the per-command DACL mutation entry (inheritance is lazy, not a per-file walk; per-session grant reuse is deferred work); the design note gains a Testing section stating why the win32-only roster flip cannot ride macOS/Linux snapshot fixtures and naming the substitute evidence.
2026-08-08 13:44:10 +08:00
Huanqi Cao 2ecfe383c7 fix(cli): resolve the pwsh-sandbox layer row from the cold-start module closure
The launcher's healProfilesModuleFallback BFS-links the apps/cli dependency closure into the profile's node_modules (the pwsh-local precedent): without dsh-pwsh-sandbox in apps/cli dependencies, a fresh Windows host cannot resolve the inserted row. Assert the closure reaches both inserted packages in the real-layers composition; rewrap the windows-shell layer comment.
2026-08-08 13:44:05 +08:00
Huanqi Cao 83f288993f fix(sandbox): mark the pwsh-sandbox executor's deliberate twin mirror for the clone gate
The duplication gate flags the call-for-call mirror of bash-sandbox's executor (the pwsh-tool-and-executor decision): wrap the class body in jscpd ignore markers, the same convention the invariant companions use.
2026-08-08 12:35:27 +08:00
Huanqi Cao e660ec8cf5 fix(sandbox): pack the windows-acl rung in the publish-path rehearsal
sandbox-local now depends on @deepseek-ai/dsh-sandbox-windows-acl, so the packed-install e2e must carry its tarball in the workspace closure — npm cannot resolve the private package from the registry. koffi and the shared peers (dsh-invariants, cordis) already resolve from the registry or the existing closure.
2026-08-08 12:20:49 +08:00
Huanqi Cao b60e64c592 Merge remote-tracking branch 'origin/feat/windows-pwsh-default' into feat/windows-acl-sandbox
# Conflicts:
#	apps/cli/reference/README.i18n.yaml
2026-08-08 12:13:23 +08:00
Huanqi Cao 94f1a7741c Merge remote-tracking branch 'origin/master' into HEAD
# Conflicts:
#	apps/cli/reference/README.i18n.yaml
2026-08-08 12:09:04 +08:00
Huanqi Cao ae7d16815d chore: retrigger CI (no workflow run was created for the previous push) 2026-08-08 11:51:53 +08:00
Huanqi Cao d8acd2b656 fix(ci): pass the pwsh-less self-hosted Linux runners
The self-hosted Linux runners ship no pwsh, and the pwshAvailable probes used spawnSync('where.exe'), which reports a missing binary as status null instead of throwing — the suites never skipped and failed with spawn pwsh ENOENT. Probe with resolvePwshPath() status instead, the same gate the coverage exemption uses. Exempt pwsh-sandbox src from coverage on pwsh-less hosts (its remaining helpers branch and the invariant companion ride the executor suites' real pwsh runs); pwsh-ful hosts keep the full 100% bar. Cover the windows-acl probe case and the runner-entry resolution in sandbox-local on Linux (chain-seam tests plus a windowsAclRunnerEntry seam) — the package's POSIX-only suites are Linux's only chance to cover the new lines. Static gate fixes: declare dsh-pwsh-sandbox in the base bundle, register the runner files entry in constraints, knip entries for the e2e suite and where.exe, regenerate the module graph. Verified in WSL (no-pwsh Linux): pwsh-sandbox 5 pass/13 skip with the exemption active, sandbox-local coverage 100%.
2026-08-08 11:46:05 +08:00
Huanqi Cao aa790346e4 docs(sandbox): explain why the token intersection needs no new identity
Add the mechanism section to the Windows rung Agent Note: identity routes (restricted-user, AppContainer) default-deny everything from a fresh SID and pay per-path ACE writes for every read, while the WRITE_RESTRICTED token keeps the caller's SID and double-checks write-class access only — reads pass on the normal check alone. Covers DISABLE_MAX_PRIVILEGE/LUA_TOKEN as the token-side limited-user synthesis and why SidsToDisable read restriction is unused.
2026-08-08 02:42:47 +08:00
Huanqi Cao 264420127a docs(sandbox): record the Windows rung design choice — raw ACL restricted tokens over mxc and AppContainer
Add the implemented Agent Note owning the win32 rung decision: mxc rejected (OS floor 24H2, BaseContainer tier only on 25H2+ with the OS feature enabled, and arbitrary-path reads demand wholesale host DACL writes), AppContainer rejected (no ambient read access — arbitrary-path reads unsupported), landstrip already rejected and AppContainer-shaped. Link the note from the backend README pair and restate the choice in the PR description.
2026-08-08 02:32:54 +08:00
Huanqi Cao dcd5a50374 docs(sandbox): satisfy the doc-sync gates for the Windows ACL packages
JSDoc every sandbox-windows-acl export (the 138 verify-export-jsdoc violations); fix the sandbox-windows-acl README code block (undeclared workspaceRoot), bring its stale claims current (the provider wiring and kill-on-close are live), add the canonical Model Experience sections to both new packages, audited the backend's indirect Model Experience sentence, and regenerate docs/config-catalog.md.
2026-08-08 02:26:26 +08:00
Huanqi Cao bec3cba084 test(scripts): split placed-image paths on both separators in project-doc-site.spec.ts
The placer fixtures derive the basename with split('/'), which never splits a Windows absolute path (backslashes), so the two image-placement tests fail on win32 hosts. The production rewrite passes absolute paths through; the fixtures now accept both separators.
2026-08-08 02:25:44 +08:00
Huanqi Cao 7574769818 fix(bundle): drop fs-local from the Windows layer — duplicate ctx.fs registration failed load
The Windows platform layer re-enables the base fs-sandbox row (removing its disable), but still inserted dsh-fs-local: both extend FileSystem and provide ctx.fs, so every shipped win32 profile failed at load. Delete the insert; fs-sandbox stays the single fs provider exactly as on POSIX. Sync the roster specs, the base/reference README pairs, the sandbox core doc (read-only grants no sink on Windows), the windows-shell JSDoc, and re-record the i18n pairings.
2026-08-08 02:11:15 +08:00
Huanqi Cao 94991499c8 docs(pwsh-sandbox): real temp grant is a backend-defined choice aligned with Landlock, not deferred work 2026-08-08 01:36:34 +08:00
Huanqi CaoandHuo Yaoyuan f64ba40f43 feat(sandbox): Windows ACL write-restriction sandbox (restricted-token runner)
Confine Windows command execution through a WRITE_RESTRICTED token whose restricting SIDs carry an orphan-SID write allowlist, ported from https://github.com/huoyaoyuan/windows-acl-restrict-poc (@ 10e4dfb). Every Win32 call is checked and fails closed - the POC silently ran children with the FULL token when CreateRestrictedToken failed.

- @deepseek-ai/dsh-sandbox-windows-acl: koffi primitives verified against the MinGW Windows headers (verify/abi-probe.cpp) plus the confinement runner ([node, runner, --workspace, --temp, --mode, --, argv...]: kill-on-close job, stdio passthrough, exit-code mirroring, windows-acl-run: failure signature, grant revocation). read-only = strict zero grants (NUL device not writable; documented). Windows-only execution: exempted from the Linux coverage lane (windowsOnlyCoverageExclusions).
- @deepseek-ai/dsh-sandbox-local: PLATFORM_CHAINS.win32 filled with the windows-acl runner (full enforcement, ACL denial dialect, runner-failure rules).
- @deepseek-ai/dsh-pwsh-sandbox: sandbox-consuming pwsh executor (call-for-call mirror of dsh-bash-sandbox) over a new argv-level seam in dsh-pwsh-local; per-file coverage complete via the fake-provider spec.
- bundle/base: the Windows platform layer mounts the confined pwsh roster - sandbox/policy/fs-sandbox/permission/approval re-enabled, the POSIX bash stack stays disabled.

Co-authored-by: Huo Yaoyuan <huoyaoyuan@hotmail.com>
2026-08-08 01:24:33 +08:00
Huanqi Cao 4c2d20dbf7 Merge remote-tracking branch 'origin/master' into feat/windows-pwsh-default 2026-08-07 20:54:35 +08:00