Commit Graph
4349 Commits
Author SHA1 Message Date
Tianyi Cui b48384223a refactor(experimental)!: classify optional packages and move prototypes 2026-10-06 16:41:04 +08:00
Tianyi Cui b98b76c9a5 feat(translator): add opt-in native DeepSeek Flash translation 2026-10-06 15:38:24 +08:00
Tianyi Cui cfc6be809c feat(reasoning): persist opt-in machine translations 2026-10-06 15:36:14 +08:00
Dudu-0223 bf1c4e01ba Merge pull request #4394 from deepseek-harness/refactor/subagent
refactor(subagent): unify activations and reuse parent catalog
2026-10-06 15:08:30 +08:00
Tianyi Cui 1103b0277b fix(session): await natural migration verifier worker exit
A successful verifier message was treated as terminal even though the
Worker Thread was still alive. The parent immediately terminated the
worker and detached cancellation, so an error, nonzero exit, or caller
cancellation after that message could be ignored and verification could
resolve successfully.

Keep the first successful response pending until an observed natural exit
with code 0. A missing response or nonzero exit rejects after the worker
has already exited. Error and abort callbacks retain the existing
terminate-and-join path, including its first-error and AggregateError
behavior. The scheduler stays unchanged: its permit remains held until
the verification promise settles, now after successful worker quiescence.
The worker already closes its parent port in finally, so success needs
neither a forced stop nor another protocol message.

Replace success-termination expectations with deterministic message/exit
barriers and cover post-response errors, nonzero exit, cancellation, and
permit handoff. Remove the obsolete hand-written termination thenable and
its retired unknown-assertion baseline entry. Add real source workers for
plain and Zstandard input, and require the built plain-Node migration smoke
to complete with zero termination calls. Document the settlement condition.

Native Windows CI recorded process access violation 0xC0000005 while a
migration fixture was active. Removing unnecessary successful-worker
termination is consistent with that evidence, but this commit does not
claim that the native faulting module or mechanism has been established.
The deterministic regressions prove the lifecycle defect independently;
the next native CI run must assess whether the observed crash recurs.

Validation:
- Original source failed all new message-to-exit regression scenarios;
  the updated focused lifecycle file passes 19 tests with 100% coverage.
- Node 24 owning package: 19 files, 741 passed, 1 skipped; every included
  package source file reaches 100% statements/branches/functions/lines.
- Real source workers passed for none/zstd; built plain-Node smoke passed
  with zero terminate calls and no timeout or process signal.
- Exact Node 22.19 source-mode none/zstd workers naturally exited 0 with
  zero terminate calls, exercising the async Module.register fallback.
- Host TypeScript build, focused lint, no-new-unknown-assertion gate,
  README translation pairing, and all 42 doc-sync gates passed.

Related to #4387 and #4394.
2026-10-06 11:29:17 +08:00
Tianyi Cui 8f3959a196 Merge branch 'master' into worktree/client-control/cli-help-reference 2026-10-06 10:59:23 +08:00
Tianyi Cui a3cb678875 Merge master current-directory support into subagent activations
Integrate the observed master checkpoint 7ab215e23e5d977aae7eb5d4fb91782d39969dbb without rewriting the earlier published checkpoints. Master adds current-directory events, directory-aware consumers, and retained Git worktrees; its old subagent startup paths overlapped the unified activation implementation.

Resolve directory selection within managed startup after acquiring parent ownership. Preserve the original Session origin while setting each new local child directory, retain persisted directory state on cold resume, and pass a required absolute cwd to external providers. Keep unified local/external ownership, full completion notices, parked-input host completion, SDK wait/error/shutdown behavior, and ACP cancellation semantics. Retain removal of the old in-process driver and continuation managers.

Combine SDK wait with the new directory requests, preserve the new master directory/worktree fixtures, regenerate derived catalogs from the combined sources, and refresh only the four stale prompt/schema sidecars. Preserve every protected historical schema, archived note, catalog-v2 acknowledgement, and recorded predecessor input.

Validation: full build; 59 CI static gates; 855 subagent tests with 100% coverage on changed core/external sources; affected consumer suites including 119 repaired-fixture tests; SDK 11 and headless 16 recorded scenarios; two local headless expected cases; six built nested SDK/ACP cases; lint, strict cast inventory, workspace constraints, and whitespace checks. Native Windows worker diagnostics remain additive and require the next CI run to classify the original crash.
2026-10-06 10:52:35 +08:00
Tianyi CuiandChinesezjc 9bc34fa962 ci: reuse reviewed coverage fork exit diagnostics
Repeated native Windows coverage runs stopped a Vitest fork while a JSONL
migration suite was unfinished. Vitest's generic unexpected-exit error
discarded the process exit code and signal, preventing classification of
the failure despite identifying the missing test file from the inventory.

Reuse the public ForksPoolWorker diagnostic implementation and protocol
fixtures from independently reviewed PR #4388, pinned at
77e215ff76711ec75ed8aa08aa5b414780e539ae. The runtime helper is unchanged.
It reports PID, project, worker identity, outstanding file request, code,
and signal before stock Vitest reports the original failure. It clears
ownership only on the typed testfileFinished response, suppresses expected
stop, and leaves cancellation and failure handling with the original pool.

Wire that existing pool into generated coverage partition configs. Keep
the original worker counts, partition scheduling, test timeouts, coverage
thresholds, and failure verdicts. No environment, raw argv, or test object
is serialized. This commit adds diagnostic evidence; it does not claim to
repair the still-unidentified Windows crash. PR #4388 remains the separate
reviewable owner; no duplicate diagnostic framework or PR is introduced.

Adapt the copied fixtures to the current no-new-unknown-assertions rule:
declare the private preload exit function, validate consumed logger fields
with the public logger type, and assign matcher/rejection values to typed
unknown locals without assertions. Add a concise bilingual testing note.

Validation:
- Diagnostic suite: 10 passed, including a real configured Vitest fork
  exiting 23, stock-pool negative control, successful silent shutdown,
  unexpected exit 0, early exit, independent forks, and signal metadata.
- Coverage coordinator suite: 51 passed.
- Targeted lint and focused strict TypeScript check passed.
- pnpm exec tsc -b tsconfig.host.json passed.
- verify-no-unknown-casts passed; 1430 existing assertions unchanged.
- doc-sync passed 40 gates; the two initially failing gates were repaired
  and rerun successfully: doc-typecheck and verify-doc-budgets.
- Translation pairing and git diff --check passed.

Refs #4387, #4388, #4394.

Co-authored-by: Chinesezjc <[email protected]>
2026-10-06 10:17:44 +08:00
Tianyi Cui acf7949db0 test(sdk): replace the cast context with typed runtime services
The cwd regression used a fake Context cast through unknown. Updating its service lookup for descendant shutdown changed the exact legacy assertion fingerprint, which the no-new-unknown-casts CI gate correctly rejected.

Exercise initialize, prompt, and wait with the real Context, Agent registry, Session store, and a scripted LLM adapter. Spy on the real service methods to keep the cwd, reasoning effort, and token-limit assertions. Remove both obsolete unknown assertions and prune only their recorded allowances; do not add or broaden an exception.

Validation: the cwd regression passes; all 54 SDK server tests pass with 100% server coverage. The full check:ci:static aggregate passes 59/59, including the strict unknown-cast inventory. No production behavior changes.
2026-10-06 03:23:56 +08:00
Tianyi Cui a1363f7f47 fix(worktree): offer GUI opt-in through official plugins 2026-10-06 01:39:47 +08:00
Tianyi Cui 171cf5d70f fix(experimental): align worktree fixtures and catalogs with current runtime 2026-10-06 01:39:47 +08:00
Tianyi Cui d299d3b966 test(experimental): verify worktree release and sandbox behavior 2026-10-06 01:39:46 +08:00
Tianyi Cui c67a2d6fdf feat(experimental): create and enter retained Git worktrees 2026-10-06 01:39:46 +08:00
Tianyi Cui e1fe956928 test(sdk): reuse directory fixture mapping for recovery 2026-10-06 01:31:51 +08:00
Tianyi Cui c6aad8c433 test(sdk): refresh released runtime directory context outputs 2026-10-06 01:31:51 +08:00
Tianyi Cui bad0ce8311 test(session): align global directory tool expectations 2026-10-06 01:31:51 +08:00
Tianyi Cui 0c6b1ef7bb fix(session): port directory consumers and fixtures to current runtime 2026-10-06 01:31:51 +08:00
Tianyi Cui b446e2e290 fix(web): start sidebar terminals in the session directory 2026-10-06 01:27:55 +08:00
Tianyi Cui 6f23c5dfd1 fix(session): align rebased documentation and SDK series output 2026-10-06 01:27:55 +08:00
Tianyi Cui 92713fcdbd fix(session): complete working directory consumers and validation 2026-10-06 01:27:54 +08:00
Tianyi Cui 79bd3d8da7 feat(session): centralize working directories and directory context 2026-10-06 01:27:54 +08:00
Tianyi Cui 9dcc8fa985 Merge master into unified subagent activations
Integrate master 78ae4fc2d4d8ecaebb4b674028f781a358b92cc9 after the four
independent review fixes. Keep this base update separate from those fixes
and from subsequent review changes so the integration is independently
reviewable and the observed-master checkpoint remains preserved.

Retain activation-owned execution, caller-independent local discovery,
and unconditional parent final-answer delivery. Preserve master's preset
scoped scheduling tools and all delegated-child schedule deny rules. Move
the new scheduling regression from the removed driver package into the
surviving subagent package and run it through a real Spawn activation.

Preserve master's removal of runtime invariant plugins, dependencies,
exports, and test mounts. Keep context disposal before fixture directory
cleanup. Combine Python workflow ordering with activation/catalog events
without inventing unsupported source-plane import paths.

Keep all frozen Agent Note archives byte-for-byte identical to master;
do not accept Git's automatic edits to renamed archived notes. Retain
current lifecycle and delivery facts in active documentation, repair its
links, and regenerate catalogs/persistence schemas from merged source.
All 62 master persistence roots remain; only subagent/catalog gains the
PR's external membership extension. Keep master's third-party lock graph
and update only workspace dependency changes.

Validation before this checkpoint: 683 focused tests passed, seven
Windows-only cases skipped; 2,772 archived artifacts verified. Generated
catalog and active-pair checks passed. Fresh artifact build and remaining
build-dependent documentation checks continue before publication.
2026-10-05 23:49:47 +08:00
Tianyi Cui 63c1ea3491 fix(subagent): preserve caller-owned local child discovery
Caller delivery previously suppressed both settlement messages and local
catalog membership. Workflows therefore stopped publishing the durable
parent-child edge that the parent header and recursive discovery require.
The workflow panel only opens running members, and the ordinary sidebar
hides subagent Sessions, so completed workflow transcripts had no normal
navigation path even though their logs still existed.

Record every successfully admitted local child in its parent's catalog,
independently of the result recipient. Membership answers which local
Sessions belong to the parent; delivery answers who consumes this activation's
result. Keeping those decisions separate restores completed-child and
descendant discovery without duplicating workflow completion messages or
adding return guidance to caller-owned work. Publication failures retain
the existing rollback transaction for both delivery modes.

These local children intentionally retain the unified continuable mode:
list_agents includes them, the parent catalog opens their transcripts after
reload, and the existing direct-parent controls can cold-resume them. No
one-shot execution path or additional lifecycle state is introduced.
Caller-owned external executions still use their consumer's membership
records because they have no local Session to open.

Update the existing bilingual service/workflow documentation and decision
records, refresh the owning workflow/Ralph/advanced Session recordings and
Python SDK event expectations, and preserve unrelated recorded stream times.

Validation:
- Full repository build passed.
- 443 subagent, workflow-host, and Ralph tests; 14 list_agents tests passed.
- Four focused headless workflow/advanced snapshot refreshes and replays passed.
- Three shipped-Web workflow tests passed, including completed-child catalog
  navigation after reload and the continuable composer.
- Python SDK advanced and scheduler-recovery snapshots refreshed and replayed
  through the built dsh CLI with Python 3.12.
- Three discovery regressions fail with the original catalog exclusion and
  pass after restoring this fix.
- test:docs (20 gates), doc-sync (42 gates), lint:contracts-ready, Host and
  Client TypeScript builds, and git diff --check passed.
2026-10-05 23:32:33 +08:00
Tianyi Cui 8a7d5014bf Merge pull request #5716 from deepseek-harness/worktree/pr-ci-speed-independent-20261005
perf(ci): reduce repeated compilation without raising concurrency
2026-10-05 19:35:09 +08:00
Tianyi Cui 9e9a95f8dc perf(ci): start runtime checks within the existing job ceiling 2026-10-05 18:21:54 +08:00
Tianyi Cui c954a07535 docs(session): separate experimental persistence catalogue 2026-10-05 18:09:01 +08:00
Tianyi Cui 231d5a311e fix(cli): bound CLI help alias discovery and document plugin option placement
`collectCliHelp` stops propagating an alias when it reaches a page
already on the current path, so a `help [command]` row that prints its
parent's help no longer recurses until the stack overflows. `serve|s`
command rows are split into separately collected names.

The CLI reference and upgrade guide describe the forwarded-argument
boundary that Commander applies, including a leading pnpm option, and
args.spec.ts pins that `--profile` placed after a leading pnpm option is
forwarded. Generated pages use the repository's two-line generated
header, and docs/AGENTS.md lists the CLI help among the generated
references.

Refs #4114
2026-10-05 17:45:17 +08:00
Tianyi Cui 75935af1d0 feat(cli): generate the CLI help reference and add dsh plugin help
`scripts/gen-cli-help.ts` runs the source `dsh` launcher with temporary
Harness and Agents homes and captures the launcher, `dsh plugin`, and every
shipped profile's text help (profile names come from `PROFILE_TEMPLATES`).
It recursively discovers subcommands from each page's `Commands:` section,
shows identical alias help once with every invocation, and writes
`docs/cli-help.md`, its Chinese page, and their pairing record. The record
resolves links between the two pages as written, so a first run already
matches `verify-translation-pairing`. `verify-cli-help` checks all three
files and runs as the `cli-help` doc-sync leaf, which the static CI lane
also runs on an unbuilt tree.

`dsh plugin` now owns `-h`/`--help` and reads its own options only before
the forwarded pnpm arguments: `dsh plugin --help` prints its help instead of
failing on the missing `--profile`, while everything after the pnpm command
(including `-h`, `--help`, and `--profile`) reaches pnpm verbatim. A
`--profile` placed after the pnpm command is no longer accepted; the
v0.2.1-alpha.1 upgrade guide covers the migration.

Refs #4114
2026-10-05 17:45:17 +08:00
Tianyi Cui bb405d51fa fix(scripts): normalize plugin record compiler paths 2026-10-05 17:43:56 +08:00
Tianyi Cui 9a4a750a05 Merge master into plugin record catalogue 2026-10-05 17:37:23 +08:00
Tianyi Cui 33b98ec91d test(session): reuse catalogue fixture cleanup 2026-10-05 17:31:08 +08:00
Tianyi Cui 350dbb45df perf(ci): emit benchmark artifacts without repeated type checks 2026-10-05 17:28:27 +08:00
Tianyi Cui dd302f718b feat(session): catalogue experimental plugin records 2026-10-05 17:20:26 +08:00
Tianyi Cui f5dbbd8ea4 Merge pull request #5701 from deepseek-harness/worktree/cot-translation/service
feat(translator): add anonymous Bing and Google translation
2026-10-05 16:35:16 +08:00
Tianyi Cui bbbe372f53 fix(ci): validate Python closure before artifact builds 2026-10-05 15:12:53 +08:00
Tianyi Cui be28d4c15c perf(ci): consolidate compatibility startup within one worker 2026-10-05 14:15:56 +08:00
Tianyi Cui fc072c7a5d perf(ci): bound worker job overlap without extending the critical path 2026-10-05 13:24:31 +08:00
Tianyi Cui c621e238e3 fix(test): pass loader URLs on Windows 2026-10-05 13:08:06 +08:00
Tianyi Cui 536aaef0b3 fix(ci): preserve workflow concurrency and portable artifact checks 2026-10-05 12:53:52 +08:00
Tianyi Cui 853ad0bb9f perf(ci): remove repeated aggregate compilation and gate work 2026-10-05 12:07:57 +08:00
Tianyi Cui d32ecfe1e4 test(infra): compare wheel bytes without deep matcher traversal 2026-10-05 11:46:52 +08:00
Tianyi Cui 3d03717a0e docs(translator): register model effects and generated package list 2026-10-05 10:00:30 +08:00
Tianyi Cui f1250c6e36 feat(translator): add anonymous Google and Bing translation service 2026-10-05 09:55:25 +08:00
Tianyi Cui 3a221c87e3 fix(scripts): find plugin record calls spelled with legacy octal escapes
A sloppy-mode .cjs or .js file can spell the name as '\141ppendPluginRecord',
which TypeScript decodes to appendPluginRecord, but the prefilter only
removed the backslash and skipped the file. The prefilter now decodes a
legacy octal escape as TypeScript does, taking three digits only after
0 to 3, so the value stays within 0o377. The spec rejects two spellings
that use three-digit octal escapes, and tests the decoder itself for
the digit limit, which no spelling of the name, whose letters are all
0o1xx, can exercise.
2026-10-05 09:55:14 +08:00
Tianyi Cui 534acc5952 Merge pull request #3649 from deepseek-harness/fix/packed-install-private-npm-cache
fix(release): isolate packed-install npm cache
2026-10-05 09:23:14 +08:00
Tianyi Cui c1b0e84b95 Merge pull request #5079 from deepseek-harness/worktree/python-live-smoke-ack-20260923
test(python): accept standalone live smoke acknowledgements
2026-10-05 09:18:47 +08:00
Tianyi Cui d6b2430df1 Merge master checkpoint a2ac28a6 into packed-install cache fix 2026-10-05 09:09:23 +08:00
Tianyi Cui 3ca9334868 Merge observed master checkpoint to resolve Python smoke pairing conflict 2026-10-05 09:05:54 +08:00
Tianyi Cui 8c6d23c128 fix(scripts): find plugin record calls spelled with any escape
The caller gate parsed only files whose text held appendPluginRecord or a
\u escape, so a release package could reach the function through
S['\x61ppendPluginRecord'], a \u{61} code point escape, a needless
character escape, or a line continuation, which TypeScript reads as the
same string. The gate now also parses a file when its text with every
escape unescaped holds the name, and its spec rejects each spelling.
2026-10-05 08:57:58 +08:00
Tianyi Cui 1678f0f5f5 fix(session): address review of plugin records
- Make the record commit an ES private method, so appendPluginRecord()
  is its only runtime entry.
- Document PluginRecordType and PluginRecord on the session subsystem
  page, and state in the README and JSDoc that the V3-to-V4 edge renames
  unknown ignorable V3 events into the plugin: namespace and that plugins
  outside this repository must not call the writer.
- The caller gate parses only files that contain the name or a \u
  escape, documents that wildcard re-exports are not reported, and its
  spec reads a temporary repository instead of this checkout.
- Cover Session.fromRestore in the record test and name SessionEventMap
  in the catalog generator's diagnostic.
2026-10-05 08:57:58 +08:00