Commit Graph

6378 Commits

Author SHA1 Message Date
Yichen Jiang
ebff7db11e fix(schema-form): extract the clone-spine walk and drop the unused ui-primitives dependency 2026-07-30 10:40:43 +08:00
Yichen Jiang
0d96676f35 feat(web): mount the config plane in dsh web and pin the Models page keyless
apps/cli/cordis.yml gains settings-local, credentials-local, and the bare
dormant llm-pi-ai row (manifest deps added for the resolver contract);
llm-deepseek drops its !!js apiKey inline for per-request credential
resolution. Both adapters tag apiKeyEnv role('credential-ref') so the
form mounts the credential control. The web e2e scaffold isolates a
harness home per run — an in-process boot must never touch the
developer's real ~/.dsh — and the new models-settings scenario pins the
whole loop through the shipped app: dormant directory as add vocabulary,
schema-driven editor apply landing in settings.yaml, the route
registering live (topology frame), and a write-only key landing in the
temp .env with the configured badge converging. A hermetic test-owned
reference name keeps a developer's real provider keys from flipping the
badge. schema-form joins the platform module table (seed + externals)
so client bundles share one instance.
2026-07-30 09:29:40 +08:00
Yichen Jiang
686e40ebf6 feat(ui-models): schema-driven provider configuration page
The Models settings section joins llm.providers (the configurable
directory with live state), settings.describe (schemas, layered redacted
values, secret slots), and credentials.describe (value-free badges) into
provider rows with one editor card at a time. The editor renders the
provider's profile subtree through dsh-client-schema-form; the
credential-ref role mounts a control that shows configured/source state
and stores keys write-only through credentials.set. Apply without
removals merges a minimal patch (stored secrets outside it survive);
apply after a reset — and row deletion — replace the user section so
removals land. The client runtime bridges the three new host frames to
typed ctx events (settings/credentials/models changed), the page
refetches on any of them once loaded, and ui-model's per-session picker
directories reload on models/changed so a settings-born route appears in
open pickers without a reopen.
2026-07-30 00:46:45 +08:00
Yichen Jiang
9592c8f271 feat(schema-form): schema-driven React form renderer package
@deepseek-ai/dsh-client-schema-form rehydrates the wire's serialized
schemastery envelope (new Schema(json)) and edits a draft user section
against it: presence-in-draft marks a field overridden with a per-field
reset, inherited values render as placeholders, role('secret') slots are
write-only with configured-state placeholders from the wire's secrets
list, dict adds take a union-typed sKey as their vocabulary, and any
node the renderer cannot faithfully edit falls back to a read-only view
instead of silently disappearing. renderField(context) is the role hook
the Models page will use for the credential-ref control; validateDraft
runs the same rehydrated validator the host uses, so the browser and
host judge one schema.
2026-07-30 00:24:19 +08:00
Yichen Jiang
191067559e feat(apiproxy): settings/credentials/llm wire domains, frames, and write guard
Eight compiler-locked methods: settings.describe/update/replace serve
redacted layered namespace views (secrets structurally absent from every
layer, write-only in the update direction) and fold seam refusals into
settings-rejected; credentials.describe/set/unset expose value-free views
with credential-rejected on shadowed writes; llm.providers merges the
configurable directory with live routes and llm.models claims the
host-scoped catalog reservation through the buildModelCatalog extraction
session.models now shares. Three HostFrame invalidations bridge the seam
events (host/settings-changed, host/credentials-changed,
host/models-changed), and the connection route generalizes the native-
dialog check into a privileged-method set covering all four writes. The
fixture and both fake clients grow the same face.
2026-07-30 00:13:12 +08:00
Yichen Jiang
a5c8136cb3 feat(settings): layered descriptors and structural secret redaction
describe() now carries each namespace's detached composition base and raw
user section beside the resolved value — presence in the user layer is how
a form marks a field user-overridden — and describe({redactSecrets:true})
strips role('secret') fields from every layer while enumerating their
{path,set} slots, so a wire surface has no slot that can carry a secret.
The pure redactSecrets(schema,value) walker (object/dict/array containers,
secret-role subtree as opaque leaf, inputs never mutated) is exported for
any other wire; the README's no-redaction Known Limitation is discharged.
2026-07-29 16:50:05 +08:00
Yichen Jiang
4989494e75 feat(llm): topology event and configurable-provider directory
ctx.llm gains 'llm/adapters-updated' — a payload-free registry notification
emitted at every topology commit point (adapter routes registering or
disposing, directory entries appearing or withdrawing) with contained
observers and INVARIANT rethrow — plus registerConfigurableProviders/
listConfigurableProviders, the directory of routes an adapter plugin can
activate through configuration. llm-deepseek declares deepseek-official
(whole llm-deepseek section as profile); llm-pi-ai declares the full
installed catalog under providers.<provider> even while dormant, so the
web settings surface can offer every provider before any route exists.
The invariant companion asserts the registry stays readable at each
notification.
2026-07-29 16:45:06 +08:00
Yichen Jiang
fee12f1af0 refactor(llm-deepseek)!: rename the provider route to deepseek-official
The native adapter's route was named deepseek, colliding with pi-ai's
catalog provider of the same name, so the two DeepSeek paths could never
be mounted side by side. The web settings page needs both configurable at
once. Compositions, fixtures, goldens, scaffolding defaults, and docs all
move together (pre-release, no shim); TUI/session-query-spill/
missing-credential goldens re-recorded through their keyless refresh
modes because provider-name length shifts box padding and spill
truncation points.
2026-07-29 16:36:07 +08:00
Yichen Jiang
7f1496c996 docs: regenerate the module graph for the credentials family and atomic-write 2026-07-29 15:16:18 +08:00
Yichen Jiang
4e9916b3e5 feat(llm-pi-ai): dormant bare mount — routes live entirely in the settings plane
An empty or omitted providers dict is now the valid dormant posture: the
adapter mounts with zero routes and no catalog entries, registers routes
the moment the llm-pi-ai settings section supplies profiles, and drops
them when it empties. The TUI demo mounts the adapter bare, so adding an
openai/anthropic provider is purely a settings.yaml (or, next PR, web
form) operation with per-request apiKeyEnv credential resolution.
2026-07-29 14:56:09 +08:00
Yichen Jiang
9336fed1e9 feat(examples): mount the pi-ai adapter in the TUI demo composition
openai + anthropic routes register keyless beside the direct deepseek
adapter — the catalog stays browsable and requests fail actionably until a
key arrives — with per-request apiKeyEnv resolution, so a user's settings
section (proxy baseURL, extra routes) and .env keys are the only steps to
turn them on.
2026-07-29 14:45:01 +08:00
Yichen Jiang
4bb101e002 Revert "fix(examples): drop the dev HMR row the native source launch cannot load"
This reverts commit 8ca499e33dd2b6e1f4e80189a1a3ab9e6873ddf7.
2026-07-29 14:29:12 +08:00
Yichen Jiang
2a53abd491 fix(examples): drop the dev HMR row the native source launch cannot load
Vendored @cordisjs/plugin-hmr uses decorators — non-erasable syntax the
--experimental-transform-types demo:tui launch refuses — so its row made the
shipped TUI composition unbootable from source while the tsx-launched
snapshot harness masked it. The stale !!js head comment goes with it;
restoring dev HMR is tracked separately.
2026-07-29 14:26:00 +08:00
Yichen Jiang
b0a2011d95 docs: bilingual credentials/settings-consumer documentation, catalogs, and gates
New credentials data-structure page (type-equiv manifested), group README,
rewritten llm-deepseek/llm-pi-ai READMEs (dynamic configuration, dict
profiles, credential chain), capability-seams/service-role registration,
Agent Note (bilingual), demo compositions mounting settings-local +
credentials-local with no inline key plumbing, installSettingsSection
consumer helper on the settings seam (deduplicating both adapters' wiring),
jscpd symmetry markers for the provider twins, runtime-closure additions for
python/sdk-runtime, and doc-budget ceilings AGENTS.md 1750→1755 /
packages/README.md 850→865 for the structural one-line group rows.
2026-07-29 14:20:06 +08:00
Yichen Jiang
d77db29f01 test: real-Loader dynamic composition, keyless onboarding snapshot, and .env-only e2e
llm-deepseek gains a Loader+Include composition spec proving external
settings.yaml/.env edits reach the very next request, and a real-API e2e
where only a credentials-local document holds the key. The headless example
pins the first-run missing-credential UX as a keyless stream-json snapshot
(new credentials.cordis.snapshot.yml scenario); runLoaderSmoke learns
expectedExitCode so a designed failure surface can be pinned instead of
masked.
2026-07-29 13:44:24 +08:00
Yichen Jiang
c0426142c5 feat(llm-pi-ai): route-keyed profiles with per-request resolution and in-place route swaps
providers becomes a dict keyed by provider route, so the composition base
and the llm-pi-ai settings section merge per provider and the route set is
structural; the pre-release array shape and per-profile provider field fail
loud with migration directions. The adapter reads a profiles thunk once per
operation and resolves the credential per stream call (literal apiKey, then
apiKeyEnv through ctx.credentials with an ambient env fallback, then pi-ai's
provider-native discovery), so key, endpoint, and knob changes reach the
next request without restarts. Route-set or captured-retry-policy changes
re-register the same adapter instance in one synchronous section; an invalid
settings snapshot keeps the last good profiles.
2026-07-29 13:36:29 +08:00
Yichen Jiang
f05ab3f945 feat(llm-deepseek): per-request connection resolution over settings + credentials
The adapter takes an options thunk and a per-stream credential resolver
instead of frozen construction facts: base URL, catalog, defaults, idle
budget, and the API key re-resolve at each operation, so a settings or
credential change reaches the very next request while in-flight streams
keep the facts they started with. resolveAdapterOptions is the one explicit
resolve step (entry config fails loud at load; a live snapshot failing a
beyond-schema bound keeps the last good options). The plugin layers its
entry config under the optional llm-deepseek settings section and resolves
keys literal-first through ctx.credentials with an ambient env fallback; a
missing key now registers the route, warns, and fails each request with
actionable MISSING_CREDENTIAL instead of failing plugin load. The
registration-captured retry policy re-registers the route in place when it
changes.
2026-07-29 13:26:52 +08:00
Yichen Jiang
aee06097ee feat(credentials): file-backed provider layering process env over $DSH_HOME/.env
Live environment wins read-only (shadowed writes reject instead of
appearing to succeed); the file is the writable source with byte-preserving
line edits, a quoting ladder dotenv reads back verbatim, atomic 0600
writes, wholesale snapshot replacement on reload, and write-drain
teardown.
2026-07-29 13:18:28 +08:00
Yichen Jiang
3a794495ad feat(credentials): abstract credential seam (ctx.credentials)
References-not-values doctrine: settings carry env-shaped CredentialRefs,
providers own storage. Per-operation resolve, UI-safe describe, fail-loud
set/unset under read-only shadowing, credentials/updated commit event with
a live-service invariant.
2026-07-29 13:03:12 +08:00
Yichen Jiang
ba37180946 feat(util): extract dsh-atomic-write and migrate settings-local writes
writeFileAtomic: exclusive-create random-suffix temp + rename carrying the
caller-stated mode; settings-local persistSection now consumes it. The
credentials-local store shares it next.
2026-07-29 12:59:41 +08:00
Yichen Jiang
42de60347a docs: raise packages/README.md budget ceiling to 850
The group table legitimately gained one row for the new settings group;
the row itself is already condensed to the minimum. The intended raise
missed the merge commit because a pipeline swallowed the failing edit's
exit status.
2026-07-29 10:26:29 +08:00
Yichen Jiang
82a299bf6d Merge origin/master: settings seam lands beside web plan mode
Conflicts were the parallel-edit set: packages/README group table (kept
master's session-title wording, re-added the settings row condensed),
doc-budgets AGENTS.md ceiling (took master's 1750), and regenerated
graph/catalog docs plus re-recorded translation pairs. packages/README.md
ceiling 845 -> 850: the table legitimately gained one row for the new
settings group and the row is already minimal.
2026-07-29 10:24:57 +08:00
Yichen Jiang
1010291fe6 fix(settings): close cross-namespace, dispatch, and lifecycle races from second review
Confirmed and fixed, each with a regression test that failed first:

- Concurrent writes to different namespaces lost whole sections on disk
  (each persist rendered the full document from a stale text): the local
  provider serializes render->write->rename->text-commit on one internal
  persist chain shared by every namespace queue.
- One throwing settings/updated listener starved the rest (cordis emit
  stops at the first throw): commit fans out per listener via
  events.dispatch, contains individual failures, and rethrows the first
  INVARIANT-coded error only after every listener ran.
- Write queues ignored fiber/service lifecycle: the base init now
  registers a teardown that refuses new writes and drains queued chains;
  queued tasks re-verify service liveness and namespace ownership before
  running and again before committing, so a registrant disposed
  mid-flight is never notified and a disposed service never commits.
- Async watcher invocations could interleave (a slow stale call applied
  last): each watcher carries a serialized invocation chain — one call
  at a time, in commit order; JSDoc/doc pages state the async timing.
- update/replace borrowed the caller's object until the queued task ran:
  inputs are structured-clone snapshotted at call time; non-cloneable
  plain objects reject with a typed error.
- Composition guard now proves the documented fallback: the consumer
  uses the optional scoped-inject shape and boots both with the settings
  entry (hot publish) and without it (entry-config resolution, no scope).
- core-data-structures index: settings.md row added to the sub-page
  table in core.md/core.zh.md.

Both packages hold per-file 100% coverage across repeated runs.
2026-07-29 10:19:33 +08:00
Yichen Jiang
f44b4db1f2 fix(settings): harden seam and provider per review findings
Confirmed and fixed, each with a regression test that failed first:

- Concurrent update() lost patches (merge over one stale snapshot):
  per-namespace serialized write queues; a failed write cannot poison
  the queue for later writers.
- Fixed-name .tmp write followed planted symlinks and kept stale modes:
  random-suffix sibling, exclusive-create (wx), 0600, cleanup on
  failure, then rename.
- A throwing settings/updated listener escaped commit and permanently
  wedged the provider reload chain (rejected refreshTask): commit now
  contains listener failures (INVARIANT-coded errors still propagate),
  async watcher rejections are adopted and contained
  (watch callbacks are officially void | Promise<void>), and the
  provider chains refreshes on a settled tail with an error log.
- No way to remove a user override: scope/service replace(section)
  sets the user section wholesale; replace({}) re-inherits base and
  schema defaults.
- The three-primitive provider contract did not hold (base never
  called load()): the base Service.init loads and publishes once;
  settings-local delegates via yield* super[Service.init]().
- Dispose did not quiesce: teardown flags closed, closes the watcher,
  then awaits queued/in-flight reloads; closed is re-checked across
  await points.
- Invariant now checks the authoritative relation with the seam's own
  deepEqualJson: emitted next must equal settings.get(ns), and
  next/prev must differ structurally (cosmokit dependency dropped).
- New docs/core-data-structures/settings.{md,zh.md} with type-equiv
  blocks + manifest entries; catalog types moved from exemptions to
  LINK_MAP; website page registered.

Both packages stay at per-file 100% coverage.
2026-07-29 10:19:32 +08:00
Yichen Jiang
ec0786e099 feat(settings): add user-settings seam (ctx.settings) + file provider
Two-package capability family mirroring session-persistence/:

- dsh-settings: abstract Settings service — namespace registry with
  caller-fiber effect registrations, layered resolution (schema defaults
  < composition base < user document), schemastery validation,
  per-namespace deep-equal commit detection, and the settings/updated
  event. Boot/registration validation fails loud; provider publishes
  keep last-good per namespace.
- dsh-settings-local: settings.yaml/.json provider — resolveSpec
  defaulting to $DSH_HOME/settings.yaml, chokidar hot reload,
  content-equality self-write suppression, atomic 0600 tmp+rename
  writes, comment-preserving YAML namespace patching.

Consumers register inside ctx.inject(['settings'], …), so every
composition works unchanged without a mounted provider. Real Loader +
Include composition test proves cordis.yml boot and external-edit hot
propagation; HMR disposal test proves registry cleanup. Both packages
hold per-file 100% coverage.

Doc budgets rise 1705→1710 (AGENTS.md) and 835→845 (packages/README.md):
one structural line per file for the new package group.

Agent Note: .agents/notes/implemented/architecture/2026-07-28-user-settings-seam.md
2026-07-29 10:19:32 +08:00
imccyu
1f242753ec Merge pull request #590 from deepseek-harness/codex/web-plan-mode
feat(web): add plan mode controls
2026-07-29 03:27:28 +08:00
imccyu
a447e26272 fix: test 2026-07-29 03:07:06 +08:00
imccyu
64742d3d30 fix: remove machine busy loading test 2026-07-29 03:01:34 +08:00
imccyu
9f7919d894 fix: remove machine busy loading 2026-07-29 02:40:29 +08:00
imccyu
d4ba2ecd63 Merge origin/master: goal domain lands beside plan
Union resolutions throughout — the fixture serves both the goal and plan
projection units (catalog gains /goal beside /plan; the retired
goal-fixture sample command yields to the real goal mirror), the mux
baseline spec expects all four unit frames, and the tsconfig paths /
Model Experience allowlist carry both domains' outlets.
2026-07-29 02:27:16 +08:00
imccyu
2b2261ff1a Merge pull request #527 from deepseek-harness/goal-ui
feat(gui): web goal UI and slash command dispatch
2026-07-29 02:17:35 +08:00
imccyu
baf8238462 Merge remote-tracking branch 'origin/master' into goal-ui-merge-master 2026-07-29 01:56:44 +08:00
imccyu
d34629d1aa fix: lint 2026-07-29 01:56:32 +08:00
imccyu
a40e0978da style: fix fixture indentation from the master merge 2026-07-29 01:41:44 +08:00
imccyu
0477f33079 feat(fixture): mirror the goal domain — /goal command, six verbs, projection unit
The keyless fixture now carries the goal chain end to end, mirroring the
host: /goal enters the command catalog and its execute path brackets a
goal/change create with the command lifecycle pair; the six mutation verbs
CAS-check the projected current goal and append whole-value changes (the
shared append path broadcasts the session event and the goal projection
frame); the tail-page projections block and the mux-open baseline always
carry the goal key (null before create / after clear). Connection specs
follow: the lifecycle round-trip replaces the not-implemented stubs, and
the mux baseline expects the third unit frame.

Also: GoalBar inline errors use ASCII parens around the code (review
feedback on #842).
2026-07-29 01:40:23 +08:00
imccyu
250d90d481 docs: regenerate cordis catalogs after the master merge
The merge auto-combined both sides' generated text, landing the catalogs
behind the open-turn set() JSDoc; regenerated from the merged sources.
2026-07-29 01:30:58 +08:00
Tianyi Cui
ff5119db35 Merge pull request #832 from deepseek-harness/worktree/fix-test-mock-server-bin
fix(llm): stop exposing the mock server binary
2026-07-29 01:23:55 +08:00
imccyu
532b2b9107 Merge origin/master (regenerate the event producer-consumer graph) 2026-07-29 01:21:29 +08:00
imccyu
f741b79e54 ci: retrigger checks (push event for cc7703449 was dropped) 2026-07-29 01:09:02 +08:00
imccyu
b0fc3b971b Merge remote-tracking branch 'origin/master' into goal-ui-merge-master 2026-07-29 01:08:09 +08:00
Tianyi Cui
9161d9bf32 Merge branch 'master' into worktree/fix-test-mock-server-bin 2026-07-29 01:08:07 +08:00
Wenlu Wang
b6b13441ac Merge pull request #623 from deepseek-harness/feature/subagent-policy-inheritance
subagent: inherit parent sandbox/approval overrides in in-process children
2026-07-29 01:01:24 +08:00
imccyu
f42d9653c1 Merge origin/master (session ISession face) and adapt the goal ref read
The runtime's new outward session contract exposes projections as a
ProjectionsFace (faceOf only); the ui-goal verb closure reads the current
value through faceOf('goal').getSnapshot() instead of the store-level get.
Catalogs regenerated after the merge.
2026-07-29 00:56:50 +08:00
Tianyi Cui
4a9278e205 Merge branch 'master' into feature/subagent-policy-inheritance 2026-07-29 00:55:32 +08:00
Tianyi Cui
a03989aa36 Merge pull request #860 from deepseek-harness/worktree/pnpm-setup-runner-isolation-20260729
fix(ci): isolate pnpm setup per runner
2026-07-29 00:54:06 +08:00
imccyu
20dd8e8d05 Merge remote-tracking branch 'origin/master' into goal-ui-merge-master 2026-07-29 00:52:03 +08:00
Tianyi Cui
8f867cc709 Merge branch 'master' into feature/subagent-policy-inheritance 2026-07-29 00:49:35 +08:00
imccyu
37f34af15f fix(plan): gate the immediate commit on the open-turn fold, not agent status
The TUI keyless smoke exposed the wrong idle signal: /plan submitted while
the driver is between turns still saw status running (checkpointing), so
the selection queued and the immediate copy never appeared. The commit
gate is now the log's own open-turn fold — plan/mode commits at once
whenever no turn is open, and queues only inside one. Specs drive the
distinction through explicit turn/start / turn/end events instead of a
fake status; the keyless smoke pins the new idle copy on both /plan and
/plan off; regenerated cordis/service catalogs ride along.
2026-07-29 00:46:56 +08:00
Tianyi Cui
f75ee1ddad Merge branch 'master' into worktree/pnpm-setup-runner-isolation-20260729 2026-07-29 00:46:34 +08:00
Tianyi Cui
c13d1a4285 fix(ci): isolate pnpm setup per runner 2026-07-29 00:45:52 +08:00