Commit Graph

1592 Commits

Author SHA1 Message Date
_Kerman
afedf18ccf fix inbox lifecycle downstream contracts 2026-07-31 22:00:39 +08:00
_Kerman
fcc2b5e282 refactor agent pre-step inbox lifecycle 2026-07-31 19:21:16 +08:00
_Kerman
7a463dbe44 Merge branch 'master' of https://github.com/deepseek-harness/deepseek-harness into xtr/react-loop-simplification
# Conflicts:
#	.agents/notes/implemented/feature/2026-07-17-dedicated-full-screen-tui-front-door.i18n.yaml
#	docs/architecture.i18n.yaml
#	docs/cookbook/extension-cookbook.i18n.yaml
#	docs/cordis-catalog/events.md
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/core.i18n.yaml
#	docs/core-data-structures/core.md
#	docs/core-data-structures/core.zh.md
#	docs/core-data-structures/llm-streaming.i18n.yaml
#	docs/core-data-structures/llm-streaming.md
#	docs/core-data-structures/llm-streaming.zh.md
#	docs/core-data-structures/session.i18n.yaml
#	docs/event-producer-consumer.md
#	docs/persistence-catalog.md
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/core/agent-loop/README.i18n.yaml
#	packages/core/agent-loop/src/agent.ts
#	packages/core/agent/README.i18n.yaml
#	packages/core/session/README.i18n.yaml
#	packages/core/session/src/types.ts
#	packages/llm/llm/README.i18n.yaml
#	packages/llm/llm/README.md
#	packages/llm/llm/README.zh.md
#	packages/llm/llm/src/index.ts
#	packages/llm/llm/tests/service.spec.ts
#	packages/sdk/sdk-client/README.i18n.yaml
#	packages/sdk/sdk-protocol/README.i18n.yaml
#	packages/sdk/sdk-protocol/README.md
#	packages/sdk/sdk-protocol/README.zh.md
#	packages/subagent/subagent-dsh-sdk/README.i18n.yaml
#	packages/ui/jsonrpc/README.i18n.yaml
#	packages/ui/jsonrpc/README.md
#	packages/ui/jsonrpc/README.zh.md
#	packages/ui/tui/src/index.ts
#	python/sdk/README.i18n.yaml
#	scripts/gen-cordis-catalog.ts
2026-07-31 10:16:14 +08:00
imccyu
ea6eb85162 fix(ci): review follow-ups for the coverage lane split
- Split DSH_COVERAGE_MAX_WORKERS between the two parallel gates
  (instrumented gets ~2/3, exempt gets ~1/3, both at least 1) so the
  lane never exceeds the budget the failover pool's 8 x 6-instance
  bound assumes; a budget of 1 pairs with DSH_GATE_CONCURRENCY=1 on
  the serial reference lanes, which already prevents gate overlap.
- Fail loud on a set-but-not-'1' DSH_COVERAGE_EXEMPT_HEAVY value in
  vitest.config.ts instead of silently ignoring it.
- Add coverage-exempt.spec.ts: each roster entry's filter and exclude
  must select the same non-empty spec set and entries must not
  overlap, so a renamed suite breaks the gate instead of silently
  returning to the instrumented run with a stale roster.
2026-07-31 02:55:37 +08:00
imccyu
e9ed7193d8 ci: run coverage-exempt heavy suites uninstrumented in parallel
The coverage lane's wall clock was pinned by a few compiler- and
subprocess-bound suites whose v8 instrumentation tax is a multiple of
their runtime while contributing nothing the per-file thresholds need:
typert generator fixtures (whole-workspace compiler analysis; its src is
threshold-excluded) and three scripts/ child-process fixture suites
(scripts/ sources are never coverage-measured; in-process imports are
covered by their owning package tests).

Split ci-coverage into two parallel gates: the instrumented run sets
DSH_COVERAGE_EXEMPT_HEAVY=1 and vitest.config.ts drops the exempt suites
from both projects (CLI --exclude cannot reach per-project include
resolution); a second uninstrumented gate runs exactly those suites, so
the aggregate still executes every test. Membership contract and the
filter/exclude pairs live in scripts/coverage-exempt.ts.

Local 6-worker A/B: instrumented gate 900s -> 260s wall; exempt gate
262s wall runs beside it, so the lane converges near the slower of the
two (~4.4min vs ~7min single-gate). DSH_GATE_CONCURRENCY now has two
schedulable gates in this lane.
2026-07-31 02:55:37 +08:00
Tianyi Cui
464a57d3ca Merge commit 'refs/codex/pr1006/master' into worktree/pr1006-merge-20260731
# Conflicts:
#	docs/architecture.i18n.yaml
#	docs/config-catalog.md
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/core.i18n.yaml
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	examples/headless-agent/cordis.yml
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/llm/llm-deepseek/README.i18n.yaml
#	packages/llm/llm-deepseek/README.md
#	packages/llm/llm-deepseek/README.zh.md
#	packages/llm/llm-deepseek/src/adapter.ts
#	packages/llm/llm-deepseek/src/index.ts
#	packages/llm/llm-deepseek/tests/adapter.spec.ts
#	packages/llm/llm/README.i18n.yaml
#	packages/llm/llm/README.md
#	packages/llm/llm/README.zh.md
#	packages/subagent/subagent-dsh-sdk/README.i18n.yaml
#	packages/ui/jsonrpc/README.i18n.yaml
2026-07-31 01:55:19 +08:00
Yichen Jiang
307fea8ae9 Merge worktree-llm-dynamic-config (884, with latest master) into worktree-llm-web-config 2026-07-31 00:06:29 +08:00
Yichen Jiang
1ff8bb3422 Merge latest master into worktree-llm-dynamic-config 2026-07-31 00:05:13 +08:00
Yichen Jiang
86ae2b70d5 Merge worktree-llm-dynamic-config (884, with latest master) into worktree-llm-web-config 2026-07-30 23:57:01 +08:00
Yichen Jiang
2a9a5ff412 Merge latest master into worktree-llm-dynamic-config 2026-07-30 23:55:50 +08:00
imccyu
7c086e40be Merge branch 'master' into worktree/plan-review-layout 2026-07-30 23:48:19 +08:00
imccyu
493c49aeab Merge pull request #1012 from deepseek-harness/fix/tui-prompt-source-resolution
fix(cli): resolve @deepseek-ai/dsh-tui/prompt in the source plane
2026-07-30 23:38:13 +08:00
Yichen Jiang
8c0d626cd5 Merge worktree-llm-dynamic-config (884, with latest master) into worktree-llm-web-config
# Conflicts:
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/core.i18n.yaml
#	packages/client/runtime/README.i18n.yaml
#	packages/host/apiproxy/README.i18n.yaml
#	packages/host/apiproxy/README.md
#	packages/host/apiproxy/README.zh.md
2026-07-30 23:32:31 +08:00
Yichen Jiang
9ebf7424f7 Merge latest master into worktree-llm-dynamic-config 2026-07-30 23:28:58 +08:00
Tianyi Cui
7e381bf70f Merge remote-tracking branch 'origin/master' into worktree/pr798-retarget-config-20260730 2026-07-30 22:47:31 +08:00
Tianyi Cui
6f89c6405d Merge pull request #1001 from deepseek-harness/worktree-optgate
revert CI cocurrency 4/12
2026-07-30 22:46:33 +08:00
Tianyi Cui
9a0ee6fbfe Merge branch 'master' into worktree/deepseek-max-tokens-defaults 2026-07-30 22:20:47 +08:00
Yichen Jiang
015b065e9d Merge worktree-llm-dynamic-config (884, with latest master) into worktree-llm-web-config
# Conflicts:
#	apps/web/tests/scaffold.ts
2026-07-30 22:19:53 +08:00
Yichen Jiang
80c36ff0d3 Merge latest master into worktree-llm-dynamic-config 2026-07-30 22:18:16 +08:00
Tianyi Cui
b5f5a01dcb Merge remote-tracking branch 'origin/master' into worktree/pr798-retarget-config-20260730 2026-07-30 22:14:08 +08:00
creatixchu
1102cfc1f3 Merge remote-tracking branch 'origin/master' into worktree/plan-review-layout 2026-07-30 22:10:56 +08:00
imccyu
9e2f6859f7 ci: reduce invariant import 2026-07-30 21:59:50 +08:00
Yichen Jiang
02b8529405 Merge origin/master into worktree/deepseek-max-tokens-defaults
# Conflicts:
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/core.i18n.yaml
#	docs/core-data-structures/session.i18n.yaml
#	packages/core/session/README.i18n.yaml
2026-07-30 21:55:07 +08:00
Yichen Jiang
45e6a6c31d Merge worktree-llm-dynamic-config (884, with latest master) into worktree-llm-web-config 2026-07-30 21:50:43 +08:00
Yichen Jiang
5fd34f9109 fix(agent-loop): rematerialize adapter defaults 2026-07-30 21:49:58 +08:00
creatixchu
97d79e3ee0 Merge remote-tracking branch 'origin/master' into feat/dir-selector-adaptive-default 2026-07-30 21:49:33 +08:00
Yichen Jiang
cd6027125c Merge latest master into worktree-llm-dynamic-config 2026-07-30 21:49:30 +08:00
Tianyi Cui
b43e392be7 Merge remote-tracking branch 'origin/master' into feature/directory-listing-tool 2026-07-30 21:49:30 +08:00
Turtle
37116d0b0a test(scripts): gate source-plane resolution of configured plugins
verify-cordis-config now requires every configured specifier of a local
workspace package to resolve through the tsconfig.base.json paths facade
to a .ts/.tsx source file. A failed resolution or a .d.ts hit (the exports
fallback into built lib/types) fails the gate, so a missing paths mapping
is a red gate instead of a clean-tree-only startup crash masked by built
trees in CI. Removing the dsh-tui/prompt mapping reproduces the failure.

Agent Note records the decision and alternatives.
2026-07-30 21:47:13 +08:00
Tianyi Cui
26f0dc1aef Merge branch 'master' into worktree/ci-independent-consumer-build 2026-07-30 21:44:31 +08:00
creatixchu
ddc4adb7a3 Merge remote-tracking branch 'origin/master' into feat/dir-selector-adaptive-default 2026-07-30 21:42:30 +08:00
Tianyi Cui
ec9ff784fa Merge remote-tracking branch 'origin/master' into feature/directory-listing-tool 2026-07-30 21:41:25 +08:00
Yichen Jiang
7022ab4a75 Merge worktree-llm-dynamic-config (884) into worktree-llm-web-config 2026-07-30 21:19:17 +08:00
Yichen Jiang
2243e35846 Merge worktree-config-settings-seam (870) into worktree-llm-dynamic-config 2026-07-30 21:17:07 +08:00
Tianyi Cui
6777e4fab9 fix(fs-search): make glob sampling an explicit choice 2026-07-30 21:14:03 +08:00
Tianyi Cui
ec1f08d3ba Merge branch 'master' into worktree/ci-independent-consumer-build 2026-07-30 21:07:14 +08:00
Yichen Jiang
ff5b65bb62 Merge latest master into worktree-config-settings-seam
# Conflicts:
#	packages/typert/generator/tests/cordis-catalog-contract.spec.ts
2026-07-30 20:28:25 +08:00
creatixchu
0ea0aef41a Merge remote-tracking branch 'origin/feat/directory-picker-quiet-navigation' into feat/dir-selector-adaptive-default 2026-07-30 20:23:11 +08:00
Yichen Jiang
3957ce007a Merge branch 'worktree-llm-dynamic-config' into worktree-llm-web-config
# Conflicts:
#	apps/cli/cordis.yml
#	apps/cli/package.json
#	apps/cli/tests/tui-keyless-smoke.e2e.ts
#	apps/web/tests/details-session-lifecycle.e2e.ts
#	apps/web/tests/snapshots/code-mode-round/ui.expected.md
#	apps/web/tests/snapshots/cordis-tool-round/ui.expected.md
#	apps/web/tests/snapshots/fresh-round-trip/ui.expected.md
#	apps/web/tests/snapshots/lifecycle-chrome/hero.expected.md
#	apps/web/tests/snapshots/lifecycle-chrome/reloaded.expected.md
#	apps/web/tests/snapshots/live-interactions/cancel.expected.md
#	apps/web/tests/snapshots/live-interactions/error-auth.expected.md
#	apps/web/tests/snapshots/live-interactions/retry.expected.md
#	apps/web/tests/snapshots/message-actions/ui.expected.md
#	apps/web/tests/snapshots/question-composer/answered.expected.md
#	apps/web/tests/snapshots/seeded-history/ui.expected.md
#	apps/web/tests/snapshots/steering/mid-steer.expected.md
#	apps/web/tests/snapshots/steering/settled.expected.md
#	docs/cordis-catalog/events.md
#	docs/cordis-catalog/services.md
#	docs/event-producer-consumer.md
#	docs/user/guide/config.i18n.yaml
#	docs/user/guide/config.md
#	docs/user/guide/config.zh.md
#	docs/user/guide/index.i18n.yaml
#	docs/user/guide/index.md
#	docs/user/guide/index.zh.md
#	examples/acp-agent/tests/snapshots/subagent-fork/session.1.jsonl
#	examples/acp-agent/tests/snapshots/subagent-mixed/session.2.jsonl
#	examples/cordis-agent/cordis.yml
#	examples/cordis-agent/tests/cordis-tools.e2e.ts
#	examples/headless-agent/tests/semantic-checkpoint-snapshots/tool-outcome-unknown/session.expected.jsonl
#	examples/headless-agent/tests/subagent-inheritance-snapshots/parent-override/parent.expected.jsonl
#	examples/tui-agent/code-mode.cordis.yml
#	examples/tui-agent/cordis.yml
#	packages/examples/tui-demo/README.md
#	packages/examples/tui-demo/README.zh.md
#	packages/host/apiproxy/README.i18n.yaml
#	packages/pty/tool-bash-persistent/README.i18n.yaml
#	packages/ui/tui/tests/snapshots/status-diagnostics-narrow.expected.txt
#	packages/ui/tui/tests/snapshots/status-diagnostics.expected.txt
#	pnpm-lock.yaml
#	scripts/snapshots/python-sdk-single-exe/advanced/result.json
#	scripts/snapshots/python-sdk-single-exe/advanced/session.1.jsonl
#	scripts/snapshots/python-sdk-single-exe/advanced/session.2.jsonl
#	scripts/snapshots/python-sdk-single-exe/advanced/session.jsonl
2026-07-30 20:15:40 +08:00
imccyu
7326b9b2a4 fix(scripts): share package-source selection to clear the jscpd clone
The spec duplicated collectEventRelations' source-selection block; extract
collectPackageSources and use it from both sides.
2026-07-30 19:57:17 +08:00
imccyu
f988ca9b86 fix(scripts): own the locality proof's premises in gen-doc-graphs
Review follow-up. provenLocalCallee inferred file-local calls from module
scoping but borrowed non-exportedness from its one caller and never checked
module-ness: a helper in a global script file (no import/export) is
program-visible and callable cross-file with no same-file reference, so the
proof passed and those call sites were dropped as silently missing matrix
cells. Guard both premises at the proof entry, failing toward the global
fallback.

- State the EVENT_API_METHODS obligation: a visitSource branch for an
  unlisted method name is dead because the prefilter drops the call first.
- Add gen-doc-graphs.spec.ts pinning fast path vs global fallback equivalence
  on fixture programs: a proven-local helper, an alias-escaping helper, and a
  global-script helper (negative control that keeps the fallback exercised).
- Record the demand-driven indexing decision in the Program-backed semantic
  gates Agent Note (both languages, pairing re-recorded).

Generated docs stay byte-identical (verify-doc-graphs green).
2026-07-30 19:57:17 +08:00
imccyu
0a3cf3b5a6 perf(scripts): drop the whole-repo call-site pre-index from gen-doc-graphs
The event-relation collector resolved every CallExpression in all package
sources up front (getResolvedSignature is the most expensive checker query)
and type-classified every property-access receiver before looking at the
method name. Both costs served a tiny fraction of call sites.

- Filter by event API method name first; receiver classification now runs
  on those calls only.
- Replace the eager global call-site index with demand-driven indexing:
  when a non-exported local helper's same-file references are all provably
  direct callees, only that file is indexed; any other reference shape
  (alias escape) falls back to the original full package-source index.

Generated docs are byte-identical; verify-doc-graphs stays green. Halves
the script's CPU time (23.4s -> ~13s user on a warm run).
2026-07-30 19:57:16 +08:00
Yichen Jiang
eae4219e04 Merge branch 'worktree-config-settings-seam' into worktree-llm-dynamic-config
# Conflicts:
#	apps/cli/README.i18n.yaml
#	apps/cli/composition.md
#	apps/cli/config/base.cordis.yml
#	apps/cli/src/app-cli-entry.ts
#	apps/cli/src/tui.ts
#	apps/cli/tests/tui-keyless-smoke.e2e.ts
#	examples/package.json
#	packages/ui/app-boot/README.i18n.yaml
#	packages/ui/app-boot/README.md
#	packages/ui/app-boot/README.zh.md
#	pnpm-lock.yaml
#	python/sdk-runtime/package.json
2026-07-30 19:46:04 +08:00
Yichen Jiang
e6483f0afc feat(settings): detect stale writers with a revision, and announce raw changes
The remaining P1 from the #939 review, plus the P2 it shares a mechanism with.

Nothing carried a version, so two tabs editing one namespace silently
overwrote each other — reproduced as tab B's `reasoning` lost to tab A's
older draft. The seam's per-namespace write queue orders writes; it cannot
tell a fresh writer from one replaying a snapshot a predecessor superseded.

Each namespace now carries a monotonic `revision` over its RAW section. A
write may send `expectedRevision`, checked at the FRONT of the queue (not at
call time, which would race the very predecessor it guards against); a
mismatch rejects with `SettingsConflictError` → `settings-conflict` on the
wire, carrying both revisions. The editor captures the revision it opened at
and, on conflict, asks the user to reopen rather than replaying its snapshot.

The same counter fixes the missing broadcast. `settings/updated` is gated on
the resolved value — correct for consumers, wrong for configuration surfaces:
storing an override equal to the composition base leaves the resolved value
alone while changing what the document says (the field is now overridden, not
inherited) and moving every open editor's revision. `settings/document-updated
(ns, revision)` fires on any raw-section change, in-process or external, and
`host/settings-changed` now rides it.

That event also closes the stale model picker: editing a provider's `models`
changes no route, so `llm/adapters-updated` never fired and an open picker
kept serving the old catalog. A change to an exposed provider namespace now
emits `host/models-changed` too — that namespace holds the catalog.

Docs: both sides of the five touched README pairs, a type-equiv block for
`SettingsPathOp`, and an Agent Note recording what the plane exposes and who
may overwrite what. The deferred wire-redaction gaps (secrets behind
union/intersection/transform, `.default(...)` in the served envelope, schema
text in rejection messages, `new Function` rehydration, pi-ai's `headers`) are
recorded as TODO(settings-wire-redaction) and in Known Limitations rather than
half-fixed.
2026-07-30 19:24:21 +08:00
creatixchu
89d30b0ef7 feat(user-interaction): declare a plan-review presentation intent on questions
A question may now carry `intent`, a tagged declaration that it IS a decision
of a known shape, so a UI that recognises the tag can present it as such
instead of as a generic option list. The one member is
`{ kind: 'plan-review', approve }`, which plan-mode sets on the exit_plan_mode
review.

An intent shapes presentation only: a UI honouring it answers with the same
option labels a generic UI would send, so the tool reads one answer shape
either way, and a UI that does not know the tag renders the generic flow.
`approve` names the affirmative option rather than relying on option order;
since no type can tie that label to the question's own option list, `ask()`
rejects a mismatch as BAD_INTENT, and the wire schema rejects an unknown tag
outright rather than silently rendering generic.

plan-mode also stops reporting a dismissed review as "the user cancelled
ask_user_question" — a tool it never called. A dismissal now tells the model
the user took the turn back to speak, and to stay in plan mode and wait; every
other ask failure keeps its own message.
2026-07-30 19:09:19 +08:00
Tianyi Cui
6d6c146f81 ci: allocate consumer runner independently 2026-07-30 19:02:10 +08:00
creatixchu
5e4922a761 Merge remote-tracking branch 'origin/feat/directory-picker-quiet-navigation' into feat/dir-selector-adaptive-default
# Conflicts:
#	apps/cli/cordis.yml
#	packages/host/README.i18n.yaml
2026-07-30 18:41:41 +08:00
Tianyi Cui
ff364c53a2 Merge master into worktree-config-settings-seam 2026-07-30 18:31:50 +08:00
_Kerman
d1dc303bc6 Merge remote-tracking branch 'origin/master' into xtr/react-loop-simplification
# Conflicts:
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/session.i18n.yaml
#	docs/persistence-catalog.md
#	packages/cordis/tool-cordis/src/api-catalog.ts
2026-07-30 17:30:10 +08:00
Yichen Jiang
0a263941ef Merge branch 'worktree-llm-dynamic-config' into worktree-llm-web-config
# Conflicts:
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/core.i18n.yaml
#	docs/event-producer-consumer.md
#	examples/headless-agent/tests/headless.snapshot.ts
#	examples/headless-agent/tests/snapshots/missing-credential/stream-json.expected.jsonl
#	packages/llm/llm-deepseek/README.i18n.yaml
#	packages/llm/llm-deepseek/src/index.ts
#	packages/llm/llm-pi-ai/README.i18n.yaml
#	packages/llm/llm-pi-ai/src/index.ts
#	packages/llm/llm/README.i18n.yaml
#	packages/llm/llm/src/index.ts
2026-07-30 17:22:44 +08:00