Commit Graph

8999 Commits

Author SHA1 Message Date
creatixchu
ebe6ca20ad fix(web): address review findings on producer-declared context forms
- `catalogHistory` validated its durable read. `agent.session.events` is a
  JSONL/SQLite seed on resume or fork, and seed validation guarantees only a
  source object with a non-empty `kind`; a `skill-catalog` record with missing
  or wrongly shaped `entries` threw inside the step listener, failing every
  later turn of that session. It is now skipped as an unrecognizable record,
  the posture the replaced content digest had, with a regression test over six
  malformed shapes.
- The headless keyless smoke still filtered catalogs by the old plugin source,
  so the `built-bin-smoke` gate would not have found the catalog message.
- Entries record the published description unescaped. The pseudo-XML escaping
  belongs to the `<available_skills>` frame and is applied when rendering it,
  so a description containing `<` no longer reaches the card as `&lt;`.
  `escapeText` is injective, so republish semantics and the model-facing text
  are unchanged.
- Adjacent text blocks join with no separator, matching how provider adapters
  flatten them; the body no longer shows a line break the model never saw.
- Provenance fields are bounded like the text: an unknown producer may record
  an arbitrarily large value.
- Both readers are all-or-nothing, and the row's form marker reports what
  rendered rather than what was declared, so a partly unreadable record cannot
  present a confident but incomplete account.
- The catalog body consumes `update` as a replacement notice; the digest
  canonicalizes per entry as JSON, since every separator character is itself
  legal in a description.
- `core.md` documents the form axis with a `ContextForm` type-equiv block, and
  both projections assert the wiring they duplicate.
2026-08-05 14:55:21 +08:00
creatixchu
e6293785bc Merge remote-tracking branch 'origin/master' into worktree/context-source-cards
# Conflicts:
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	packages/skill/tool-skill/README.i18n.yaml
2026-08-05 14:11:29 +08:00
Wenlu Wang
61e46f077e Merge pull request #1362 from deepseek-harness/fix/landlock-runner-failure-classification
Fix false sandbox failures from Landlock partial-enforcement notices
2026-08-05 13:59:47 +08:00
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
imccyu
b5da33c9ac Merge pull request #1567 from deepseek-harness/feat/perf-session-create
refactor(session): route construction through Session.create
2026-08-05 13:07:17 +08:00
creatixchu
340c9ba576 feat(web): split context injection into producer-declared forms
Injected context reached the transcript as one anonymous shape whose
expanded body was the whole message serialized as inline JSON, so the
escaping collapsed the only readable part — the model-facing prose —
into a single line.

`MessageSource` gains an optional producer-declared `form`, a small
semantic vocabulary of information shapes independent of `kind`: kind
says who produced the context, form says what shape it is, so several
producers may share one presentation. Two values ship.

`instructions` (workspace-context) lists the reconciled files above
their text and keeps the `<system-reminder>` framing verbatim, because
the framing is part of what the model read. `catalog` moves dsh-tool-skill
off the shared plugin kind onto a `skill-catalog` source carrying the
published name/description entries, and the body lists those instead of
re-parsing `<available_skills>` out of the prose. Catalog identity moves
with it: the republish digest now covers the durable entries, deleting
the text-slicing that recovered them from a logged message.

Everything else renders the opaque body — the model-facing text with its
real line breaks, then the remaining provenance as fields. That is the
documented default, not a leftover: a resumed, forked, or foreign log
must render whether or not its producer is mounted here, which is why
the classification lives in the durable source rather than a client-side
table keyed by producer.
2026-08-05 12:15:03 +08:00
imccyu
e61839a6ab fix(session): refresh Session.create artifacts 2026-08-05 11:57:17 +08:00
imccyu
5ae0a23f42 fix(session): remove unreachable header guard 2026-08-05 11:57:17 +08:00
imccyu
1832df038d docs(session): document creation ownership boundaries 2026-08-05 11:57:17 +08:00
imccyu
c02871b910 refactor(session): separate validation from snapshots 2026-08-05 11:56:14 +08:00
imccyu
69b1ea8d8c refactor(agent-loop): extract setup and publication 2026-08-05 11:56:14 +08:00
imccyu
8cbdd5b9d0 refactor(session): route construction through Session.create 2026-08-05 11:56:14 +08:00
Tianyi Cui
c7f693aa40 Merge pull request #1122 from deepseek-harness/xjt/proofreading-active-docs-2-apply
docs(i18n): proofread active Chinese documentation and update translation prompt
2026-08-05 11:47:08 +08:00
creatixchu
e5d4ae72fc Merge remote-tracking branch 'origin/master' into worktree/context-source-cards 2026-08-05 11:26:51 +08:00
xjt
7bd111b2af Merge origin/master into xjt/proofreading-active-docs-2-apply 2026-08-05 10:57:53 +08:00
imccyu
a1221f315f Merge pull request #1621 from deepseek-harness/fix/npm-publish-vendor-packages
fix(npm): publish vendored baseline packages
2026-08-05 10:41:02 +08:00
creatixchu
d060327f0c Merge remote-tracking branch 'origin/master' into worktree/context-source-cards
# Conflicts:
#	apps/web/tests/snapshots/bash-abort-row/ui.expected.md
#	packages/client/runtime/README.i18n.yaml
#	packages/client/ui-conversation/README.i18n.yaml
2026-08-05 10:40:23 +08:00
imccyu
59133cb8a3 fix(npm): promote dsh after baseline publication 2026-08-05 01:44:13 +08:00
imccyu
957050c47e fix(npm): probe installed Web startup 2026-08-05 01:15:48 +08:00
imccyu
50ae954ebf fix(npm): publish vendored baseline packages 2026-08-05 01:15:47 +08:00
imccyu
ca27512529 fix(packages): omit source publication payloads 2026-08-05 01:15:19 +08:00
imccyu
7557de1131 fix(packages): ship web and theme assets 2026-08-05 01:11:50 +08:00
imccyu
958e1bd157 fix(npm): harden baseline publication 2026-08-05 01:11:49 +08:00
imccyu
b7c0e4ea08 fix: dsh exports
fix: pty-local postinstall
2026-08-05 01:11:49 +08:00
imccyu
1dffc3cb86 pkg: upgrade node-addon 2026-08-05 01:11:49 +08:00
imccyu
6a5f0e169f docs: rfc 2026-08-05 01:11:49 +08:00
Huanqi Cao
81c63bbf4d Merge pull request #1127 from deepseek-harness/feat/windows-picker-pwsh
fix(host): drive the Windows directory picker from a koffi IFileOpenDialog child process
2026-08-05 01:05:10 +08:00
Huanqi Cao
00621f92d2 fix(picker): keep the worker-boundary mock off the vitest IPC channel
The mocked process.send consumed vitest's own fork-pool IPC messages and immediately ran the post callback, whose disconnect() severed the test worker's channel (process.connected is true under forks) — the whole spec's results vanished and win32-dialog-bindings.ts/win32-dialog-worker.ts fell to near-zero coverage on CI. The mock now records without invoking the callback or disconnecting; the real close lifecycle stays with built-worker.e2e.ts. Verified under both the threads and forks pools.
2026-08-05 00:31:43 +08:00
Huanqi Cao
4cb5f328bb refactor(picker): drop the Windows PowerShell fallback chain
The win32 tier is exactly the koffi IFileOpenDialog child process; any failure surfaces as-is. The pwsh -> Windows PowerShell 5.1 cascade, the shared WinForms script, and the triple-miss AggregateError are deleted: koffi is a packaged dependency whose availability the install guarantees, so no mechanism fallback exists (the browse backend remains the fallback at the composition level). The pwsh-first DPI picker-fix note is consolidated into a new simplification note recording the reversal.
2026-08-05 00:31:43 +08:00
Huanqi Cao
4201eaed3f refactor(picker): drive the Win32 dialog from a spawned child process
The koffi IFileOpenDialog conversation runs in a spawned child process instead of a worker thread: the dialog is the child's first window, so Windows activates it without a foreground call, and a native fault stays contained to the child. The driver maps the child's message protocol onto a promise and services aborts by posting WM_CLOSE to the dialog thread's windows, killing the child when the close budget is exhausted. The built worker ships as lib/worker.cjs (the ./worker export) under plain node, and win32-dialog.spec.ts returns to the thread-safe pool.
2026-08-05 00:31:43 +08:00
Huanqi Cao
bc9171337a fix(picker): raise the worker-thread dialog to the foreground on showing
The koffi redesign moved the dialog from a spawned child process (which
inherits a foreground-activation right from the spawning app) onto a worker
thread of the same process, so Windows shows the dialog without activating
it — it opens behind the app with a taskbar flash. The app has no native
HWND to hand the seam, so raise from the driver: on the 'showing' notice
(the worker posts it right before Show, before the dialog window exists),
attach this thread's input queue to the dialog thread's, call
SetForegroundWindow on its top-level window, and detach — retried on the
close cadence until the window appears, stopped on settle/abort/success,
never blocking the pick. Injectable seam mirrors closeThreadWindows; driver
tests pin the raise and its retry; the in-process note records the
mechanism (both languages, pairing re-recorded).
2026-08-05 00:31:43 +08:00
Huanqi Cao
8923ae2ab8 docs(picker): drop the invented .NET 10 version specificity from the DPI note
The Description paragraph attributed the modern dialog's bottom-strip
rendering to '.NET 10', an unverifiable version the code comment
deliberately avoids (the same invented-version class flagged in round one).
Say 'the modern FolderBrowserDialog' on both language sides; pairing
re-recorded. Round-five review finding.
2026-08-05 00:31:43 +08:00
Huanqi Cao
f4095ee3eb fix(picker): end the closed worker-message switch in assertNever
The driver's switch over Win32DialogWorkerMessage handled all three current
kinds but had no default, so a fourth kind added to the worker protocol
would compile cleanly and silently no-op — settle() never called and the
pick dangles until worker exit. Add the local assertNever backstop (the
command-compact shape; this package does not depend on dsh-llm for the
helper) and the return the error case needs to avoid falling into it.
Round-five review finding.
2026-08-05 00:31:43 +08:00
Huanqi Cao
020ce50414 fix(picker): correct crash-isolation and DPI claims, wire the built-worker guard, and tidy round-four nits
The round-four review's v6 pass found three factual gaps and the v5 pass two
nits. Correct them before merge:

- The in-process note claimed a koffi signature mistake is 'contained to
  the worker thread' — worker_threads share the process, so a native access
  violation takes down the whole Node process with no PowerShell fallback.
  State the real blast radius and record the deferred pkg-VFS worker-spawn
  arm in Consequences (both languages, pairing re-recorded).
- The 2026-07-27 picker note claimed unconditional 'per-monitor-v2 DPI';
  PMv2-less hosts (Server 2016 / Win10 1607) cascade to per-monitor or
  system-aware. Say 'the best thread DPI awareness the host accepts'
  (both languages, pairing re-recorded).
- built-worker.e2e.ts was not in any keyless gate (vitest.e2e config is
  not part of the default unit run and builtBinSmokeGate's explicit list
  missed it), so lib/worker.cjs load regressions passed keyless CI. Add it
  to builtBinSmokeGate alongside the workflow-workerthread sibling.
- Remove the dead trailing 'void bindings' in win32-dialog-logic.spec.ts
  and give native-picker.spec.ts the sibling module header it lacked.
2026-08-05 00:31:43 +08:00
Huanqi Cao
e234a3a274 docs(host-directory-picker-native): describe the in-process IFileOpenDialog primary in the module header
The @module header still described the Windows adapter as the pre-PR 'STA
PowerShell FolderBrowserDialog' while the README and Agent Notes document
the koffi IFileOpenDialog primary with the PowerShell chain as fallback;
mirror the README's platform summary.
2026-08-05 00:31:43 +08:00
Huanqi Cao
16b7708100 chore(knip): declare directory-picker-native's e2e entry
The package-wide default only knows spec files; the new built-worker e2e
guard needs the workflow-workerthread-style entry declaration.
2026-08-05 00:31:43 +08:00
Huanqi Cao
e182f03230 fix(picker): cascade thread DPI contexts and harden the round-three review points
- setThreadDpiAwareness checks SetThreadDpiAwarenessContext's return value
  and cascades per-monitor-v2 -> per-monitor -> system-aware; DPI stays a
  deliberate cosmetic best-effort - a host accepting none (or lacking the
  API, pre-1607) still gets the modern dialog instead of a downgrade to the
  legacy fallback chain over a cosmetic concern.
- The mocked-koffi world now uses a distinctive 4-byte pointer width and
  rejects mis-sized out-buffers and mis-divided vtable offsets, so a
  regression to hardcoded 8s fails the suite (the ia32 bug class).
- A keyless built-worker e2e guard loads lib/worker.cjs under plain
  worker_threads on POSIX (the workflow-workerthread shape).
- The 'loaded lazily' module claims are reworded to attribute laziness to
  the dynamic import('koffi') calls, and the discarded close-attempt
  rejection is named at its catch.
2026-08-05 00:31:43 +08:00
Huanqi Cao
8500a21658 fix(picker): pointer-width vtable offsets, COM apartment pairing, unconditional abort budget, and the full failure chain
Review round two on the in-process dialog:

- Vtable slots and out-pointers use koffi.sizeof('void *') instead of a
  hardcoded 8 - win32-ia32 (which Node and koffi both ship) would have read
  method pointers from the wrong address and crashed in-process before any
  fallback could run.
- runFolderDialog pairs every successful (incl. S_FALSE) CoInitializeEx
  with CoUninitialize in the outermost finally, releasing the dialog first;
  a failed init is deliberately unpaired. Pinned across fake-bindings and
  mocked-koffi suites.
- The abort close budget starts unconditionally: a worker hung before the
  showing notice (koffi import or COM init) now ends in terminate instead
  of a dangling promise; WM_CLOSE posting still waits for the thread id.
- A triple miss (dialog + pwsh + 5.1) surfaces an AggregateError carrying
  all three causes - the in-process tier's reason was previously
  unrecoverable from the final PowerShell error.
- The stray '=>{ ' formatter artifacts are normalized to real blocks.

Both stale note claims from the review are fixed: the DPI note's
Consequences no longer claims an ENOENT classification or zero new
dependencies, and the 2026-07-27 picker note's Windows bullet now names
the in-process primary and keeps the PowerShell chain as fallback (both
languages, pairings re-recorded).
2026-08-05 00:31:43 +08:00
Huanqi Cao
fed3149ac4 fix(picker): ship the dialog worker as the constrained ./worker artifact
The workspace files constraint keys worker bundles on the ./worker export
(lib/worker.cjs, the workflow-workerthread shape); the descriptive source
entry stays win32-dialog-worker.ts and tsdown renames the bundle.
2026-08-05 00:31:43 +08:00
Huanqi Cao
8e0880e303 test(picker): attach abort expectations before driving the close-budget race
On a fast host the 1ms close budget can exhaust and reject between waitFor
ticks; a rejection with no listener yet counted as an unhandled error in the
Linux run.
2026-08-05 00:31:43 +08:00
Huanqi Cao
089f4dfad8 feat(picker): open the Win32 folder dialog in-process over koffi
The modern IFileOpenDialog becomes the primary win32 tier: a koffi-driven
COM conversation on a worker_threads worker (the modal Show never blocks
the host event loop), per-monitor-v2 DPI via SetThreadDpiAwarenessContext,
and abort service by re-posting WM_CLOSE to the dialog thread's windows,
with terminate+unref as the last resort (Node cannot interrupt a thread
blocked in native code, and such a worker must never hold the process open).

The PowerShell chain stays as the fallback tier with its trigger widened
from ENOENT to any pwsh failure, closing the review-flagged PowerShell 6
regression (no WinForms: exit 1, not ENOENT, so 5.1 never ran).

Layering keeps per-file coverage honest on every host: pure sequencing and
the driver test against fakes anywhere; the bindings run against a mocked
koffi COM world (the session-persistence-jsonl technique); POSIX hosts
drive the real spawn plumbing to its koffi-load rejection; win32 hosts run
a real open-and-abort-close smoke. The smoke joins processBoundTests: a
worker blocked in a native modal wedges the threads pool's teardown, while
a fork contains it. The worker bundles as its own CJS tsdown entry
(workflow-workerthread's pattern; no TLA), and the host module is imported
statically so the node-half bundle stays chunk-free.

Built-plane and real-COM behavior verified on native Windows: standalone
probes for the source worker, the built CJS worker, and the driver's abort
path all open and close the real dialog.

Agent Notes: new implemented/feature/2026-08-02-win32-in-process-folder-dialog
(bilingual) owns the decision; the DPI note is re-scoped to the fallback tier
it now describes and its AutoUpgradeEnabled attribution corrected (.NET Core
3.0 rewrote FolderBrowserDialog; the opt-out arrived in .NET 6).
2026-08-05 00:31:43 +08:00
Huanqi Cao
da1b1ff87d fix(host): drop the folder-dialog Description both picker modes render badly
.NET 10's modern FolderBrowserDialog renders Description as a bottom
strip above the folder input, and the 5.1 classic dialog as an unthemed
white box; the property is dropped entirely and a regression assertion
pins its absence.
2026-08-05 00:31:43 +08:00
Huanqi Cao
5c51589665 docs(picker): record the pwsh-first DPI-aware Windows picker fix
README pairs document the pwsh-preferred adapter and the PowerShell 7
requirement for the modern dialog; the 2026-07-27 picker note's Windows
adapter fact is updated in place, and a new bug-fix note records the
defect, the fallback decision, and the DPI awareness rationale.
2026-08-05 00:31:43 +08:00
Huanqi Cao
a92ffff10a fix(host): prefer pwsh for the Windows directory picker and force DPI awareness
The win32 branch now spawns pwsh.exe (PowerShell 7) first and falls back
to powershell.exe (Windows PowerShell 5.1) only when pwsh is missing
(ENOENT), mirroring the Zenity-KDialog fallback. PowerShell 7 renders the
modern IFileDialog folder picker; the 5.1 fallback keeps the legacy tree
functional. Both runtimes execute the identical script, which opts the
process into system DPI awareness (SetProcessDPIAware) before any window
exists, fixing the blurry bitmap-stretched dialog on scaled displays.
2026-08-05 00:31:43 +08:00
Huanqi Cao
60ba5ef3f6 Merge pull request #1120 from deepseek-harness/feat/pwsh-tool
feat(pwsh): add the pwsh-local executor and the pwsh tool
2026-08-05 00:31:39 +08:00
Huanqi Cao
c5acd4ce96 Merge remote-tracking branch 'origin/master' into feat/pwsh-tool 2026-08-04 22:05:31 +08:00
xjt
8320c3666d Merge origin/master into xjt/proofreading-active-docs-2-apply 2026-08-04 21:03:39 +08:00
xjt
782d84116a docs(i18n): restore first-occurrence terminology 2026-08-04 20:54:42 +08:00
imccyu
55e0dc3565 Merge pull request #1548 from deepseek-harness/codex/session-pending-interactions
feat(client): show pending interactions in the session sidebar
2026-08-04 20:50:55 +08:00
Huanqi Cao
acda0e39bc Merge remote-tracking branch 'origin/master' into feat/pwsh-tool 2026-08-04 20:39:17 +08:00