* feat(system-prompt): admit section updates incrementally
* docs(system-prompt): accept retirement restart gap
* test(system-prompt): cover retirement and reentry before admission
* test(system-prompt): align rebase fixtures and persistence history
* fix: align section prompt consumers and CI fixtures
* test: pin credentials for section snapshot fixtures
* test: align remaining snapshots with section admission
* test: preserve section metadata in Web and PowerShell replays
* refactor(system-prompt): retire sections through Cordis cleanup
* chore: refresh section admission history after rebase
* fix(system-prompt): advance admission head after compaction
* fix(system-prompt): trim sections before admission hashing
* docs: move system upgrade guides to current version
* docs: add system message contribution cookbook
* perf(system-prompt): avoid indexing history for admission
* refactor(system-prompt): derive admission from logged sections
* test(system-prompt): update lifecycle and compaction consumers
* test(system-prompt): refresh CLI section event expectations
* test(system-prompt): refresh question composer section metadata
* feat(system-prompt): resolve same-name sections by scope
* refactor(persona): use ordinary section registrations
* refactor(system-prompt): clarify assembly and related control flow
* test(system-prompt): reconcile rebased section snapshots
* test(python): use current system text helper after rebase
* test(system-prompt): refresh CLI expected section blocks
* test(system-prompt): reconcile latest master integration
* test(agent-loop): seed tools before deferred addition assertion
* refactor(compaction): replace system heads when compacting prefixes
* refactor(system-prompt): separate source text and notice attribution
* fix(system-prompt): preserve legacy instructions in compaction snapshots
* refactor(compaction): build system snapshots while reading the summary prefix
* refactor(compaction): rebuild current system instructions
* refactor(system-prompt): defer compaction rebuild to admission
* refactor(system-prompt): remove redundant fixtures and setup
* fix(plan-mode): announce committed user transitions
* docs(system-prompt): reconcile section lifecycle and compaction design
* refactor(system-prompt): consolidate projection version increments
* fix(system-prompt): reconcile master integration and replay fixtures
* docs(system-prompt): align upgrade guide with current release
* refactor(system-prompt): make admission operations explicit
* fix(system-prompt): reconcile master API and release changes
* docs(system-prompt): regenerate catalogs after master refresh
* refactor(llm-pi-ai): delegate text rendering to pi-ai
* fix(llm-pi-ai): preserve blank lines between system text parts
* refactor(system-prompt): remove redundant retirement metadata
* refactor(system-prompt): own admission and use canonical surface targets
* refactor(system-prompt): compare captured sections at commitment
Assembly fixes section text and lifecycle; PromptAssembly.systemUpdates() compares them with the committed projection when the loop commits. This replaces SystemPrompt.admit(), needsRebuild() and isCurrent(), the SystemAdmission export, the loop's reassembly after compaction, and SessionSurface.systemHeadResetSeq. The projection records a pending rebuild as a boolean that an attributed reset clears.
After a compaction inside a step, the rebuilt head uses the sections captured for that step; later source changes arrive as ordinary updates at the next step.
* test: await the session read fixture and type a matcher for lint
* test(tool-executor-ptc): describe same-name section override on executor replacement
Duplicate section names no longer reject a scoped executor; the earlier registration is overridden and returns as an ordinary update when the executor leaves.
* docs(upgrade-guide): move system-prompt integrations to v0.2.2-rc.3
The root version on master is 0.2.2-rc.3; verify-upgrade-guides rejects a guide added under an earlier version directory.
* refactor(system-prompt): rebuild over system messages without sections
A system message without source.sections now marks rebuilding pending, like a compaction summary. The next model attempt replaces the head with current sections and clears later system messages. This removes the separate legacy flag and its appended whole-prompt replacement and notice.
Sessions written by earlier releases, migrated logs, and imported DeepSeek conversations take the same path, so the importer and its tests return to their master versions.
* test(web): refresh the imported-conversation recording and drop a stray bytecode file
The Web recording for a resumed DeepSeek import was recorded while the prompt was appended after the imported history; the head is replaced again, as on master. The .pyc under the macOS signing skill was staged by accident in an earlier merge.
* refactor(session): scan system nodes on read
surface.systemNodes is read only when a system rebuild is written. Scanning the current surface nodes on each read restores the surface fold's plan types and state to their master definitions, which no longer carry the system message.
* refactor(session): rename SystemSurfaceNode.hasContent to isEmpty
The flag reports that the logged content array has no blocks. isEmpty matches the documented "empty head" wording and covers a head that was written empty without ever being cleared.
* refactor(llm): join system text through extractTextContent
extractTextContent gains a trim option that trims each text block and omits blocks left empty. The DeepSeek serializer, the pi-ai converter, and the prompt inspector use it with a blank-line separator in place of three hand-written joins.
The pi-ai converter now trims system and developer text like the other two, so whitespace-only blocks are omitted there as well.
* test(snapshots): refresh the PowerShell and cordis-inspect recordings
The two PowerShell scenarios still held the initial system message as one unattributed block; replay now writes one block per section with its attribution. The cordis-inspect-jsdoc recording embeds the API catalog, which names SystemSurfaceNode.isEmpty since the rename.
* test(plan-mode,harness-dev-context): cover a rejected pre-step and a repeated legacy prompt
A rejected pre-step must leave a queued plan-mode switch pending and unannounced until the next accepted step. A second unattributed system message with the same legacy paragraphs must keep the admitted paragraphs.
* test(web): refresh Web recordings for section-attributed system messages
Twenty-seven Web recordings still held the initial system message as one unattributed block. Replay now writes one text block per section with its attribution; twenty-six recordings differ only in that line.
plan-review also records the plan-mode switch notice before the first prompt and appends a plan:status update on exit in place of a head replacement and a series header, so its expanded golden gains the notice row.
The Creator persona test joins the system text blocks with blank lines, as the adapters do, before matching the persona line.
* refactor(system-prompt): require the retry argument of systemUpdates
The agent loop passes it on every attempt. A custom loop that omitted it on a retry received a full comparison in place of the pending rebuild, with no diagnostic; the type now makes each caller state which attempt it is.
* docs(upgrade-guide): move the system prompt integrations guide to v0.2.2-rc.5
The root version is 0.2.2-rc.5 after the master merge, and verify-upgrade-guides rejects a guide added under an earlier version directory.
* test(web): refresh the mention path presence recording for section-attributed system messages
* test: align two specs that master left failing
The DeepSeek settings spec waited for a saved notice carrying the provider label from before the rename to DeepSeek API. The Windows packaging workflow spec seeded one of the two helpers that the Stage workflow helpers step copies.
* chore: remove a Python cache file committed by mistake
The service held a table of the two DeepSeek route ids, which are ids of
its consumers. connect() now takes the provider route its plugin
registers, and routeKind() answers the kind connected under that id, so
the service names no route.
A conversation recorded on deepseek-account or deepseek-official whose
route plugin is not mounted is ordered as any other route: the API key,
then the account sign-in. Before, such a conversation tried only the API
key. With both route plugins mounted the order is unchanged.
The minimal compositions in the dsh-llm, dsh-web, and dsh-tool-web READMEs
mount a DeepSeek route or the DeepSeek web backend, which start only beside
the authentication service. Each example gains its row and one sentence
that says why.
The decision record said both web providers report a route whose settings
do not resolve as WEB_PROVIDER_MISCONFIGURED. Messages search reports
WEB_PROVIDER_ERROR, and only the Search and Fetch APIs word their failures
from the candidates.
The upgrade guide again states that the account route plugin owns the
sign-out cancellation and that the account package drops its dsh-agent and
dsh-llm peer dependencies.
The web tool integration test mounts the Search API provider by hand. The
provider requires ctx.deepseekAuth, so without the service it never
registered and web_search failed. The test mounts the service first.
The built dsh smoke test pins the exact rows of the sdk-minimal profile; it
gains the deepseek-auth row the bundle carries.
The route fixture connects deployments to ctx.deepseekAuth, and two of its
fields kept names from the credential publication it replaced:
withoutCredential and publishedBaseURL. They are withoutConnection and
connectedBaseURL.
The decision record and the upgrade guide described credentials that each
DeepSeek model route published through ctx.llm.providerCredential(). The
routes, the Search and Fetch APIs, and Messages search ask ctx.deepseekAuth
instead, so both documents describe that service: who orders the two
credential kinds, where each kind's deployment comes from, what a consumer
declares, and which alternatives lost. Both take the name of the subject
they cover.
The upgrade guide adds the steps this change asks of a composition: mount
@deepseek-ai/dsh-deepseek-auth beside any DeepSeek route or web provider,
and take the key check from @deepseek-ai/dsh-credentials.
Five older decision records and nine package READMEs still said that routes
publish credentials, that consumers read keys themselves, or that a request
credential carries a bare value. They state the current mechanism, and the
model service README drops the source-map row of the key check that moved
to dsh-credentials.
The transport's cancellation helper returned at once when the caller's signal was already aborted, without observing the credential read it had been handed. A read that cancels its caller and then rejects left that rejection unhandled. The helper now observes the read, as the same helper of the Messages search provider does.
Messages search asked `ctx.llm.providerCredential()` whether the conversation's route published an account credential, compared origins itself, and read and checked `DEEPSEEK_API_KEY` itself. It now asks `ctx.deepseekAuth` for the credential of the search endpoint: the account sign-in in a conversation on the account route, otherwise its referenced key, which stays its own and goes to the search endpoint. The provider's two credential options become one `authorize` option; the literal `apiKey` is unchanged.
Behavior is unchanged except in two places. A key that is blank or cannot travel in an HTTP header is reported with the error name `DeepSeekAuthError` where it named `LlmError`. A base URL that embeds credentials makes the provider unavailable, as one that does not parse already did; `fetch` refused such a URL before.
The provider's cancellation helper now observes a credential read that began before its caller's cancellation was noticed. Such a read can reject after the cancellation it caused, and that rejection was unhandled.
The package no longer depends on `dsh-llm`.
The plugin asked `ctx.llm.providerCredential()` for each route's credential, read `DEEPSEEK_API_KEY` and the account service itself when a route was not mounted, ordered those sources by billing, and rendered the request headers in its transport. It now names the kinds the two APIs accept and the capability's billing, and `ctx.deepseekAuth` returns the ordered credentials, each bound to its endpoint. The plugin keeps the wording of its failures; the transport sends the headers it is given.
Behavior is unchanged except in two places. A key that is blank or cannot travel in an HTTP header is reported with the error name `DeepSeekAuthError` where it named `LlmError`. A capability's own base URL that embeds credentials now leaves the provider unavailable, as one that does not parse already did; `fetch` refused such a URL before.
The package no longer depends on `dsh-llm`, `dsh-launch-environment`, or the account service. The transport's `apiKeyHeaders` request option, which only tests set, is gone, and the tests of adapters that publish the other credential kind under a DeepSeek route id went with that publication.
Both route plugins now require the DeepSeek authentication service and connect the deployment their settings name: the API-key route its base URL and key reference, the account route its base URL. Other DeepSeek consumers will bind each credential kind to that deployment through the service.
The `base` and `sdk-minimal` bundles mount the service, and the SDK server mounts it with its fallback route when the composition has none. Tests that mount a route plugin by hand mount the service first; the pinned row list of the `sdk-minimal` bundle gains the `deepseek-auth` row.
Reviewers found `routeCredential` unclear. The method takes a provider route id, as `providerInfo()` and `providerRetryPolicy()` on the same adapter do, so the method and its types now carry that prefix: `LlmAdapter.providerCredential()`, `LlmRuntime.providerCredential()`, `ProviderCredential`, `ProviderCredentialGrant`, and `DeepSeekProviderCredentialOptions`.
Behavior is unchanged. master never had the old names, so no released surface is renamed; the upgrade guide for this change names the new ones.
The Chinese pages of the route credential change rendered "withdraw" as
收回. The bilingual pages on master render it as 撤回 in most places, so
the seven pages this branch edited now use that term. The English pages
are unchanged; only the Chinese hashes of the pairing records move.
Unloading the account route removed its sign-out listener and running-task
report while a model request it had dispatched kept streaming, so a later
sign-out neither closed that request nor cancelled its turn.
A route credential grant now carries an optional `revoked` signal. The
account service aborts it at each sign-out, after the
deepseek-account/signed-out listeners return, and the shared transport
runs the model request and its file operations under it. The route plugin
names that end ACCOUNT_SIGN_IN_REQUIRED and cancels the route's running
Agents from the request's own failure callback, so a turn whose route was
disabled mid-turn still ends with the signed-out cause, and disabling the
route never waits for a turn.
The Search and Fetch API providers and Messages search run their request
under the same signal and report WEB_PROVIDER_ERROR with sign-in guidance,
keeping WEB_ABORTED for caller cancellation. Account model requests
outside an Agent turn and account-billed web requests therefore end at
sign-out as well. The web-search-account-signout recorded scenario pins
the failure the model sees.
While the route is disabled, a task it started that is executing a tool
is not reported to the sign-out confirmation and ends at its next model
request, which fails because the route is no longer registered.
The API-key route README Summary exceeded its 100-word limit; the origin
detail moves to the usage section.
Search and Fetch picked a route credential by route id without comparing
its kind, so an adapter registered as deepseek-official that publishes an
account credential had that credential sent under API-key billing, and
the reverse held for deepseek-account. A credential whose kind differs
from the route's counts as no route, as an adapter publishing no
credential already does: API-key billing falls back to DEEPSEEK_API_KEY
at the official base, and account billing asks the account service.
Readiness and dispatch share the source, so both follow the same rule.
master moved internal identity construction to brandString (#8214) and
added the empty-catch gate with its recorded baseline (#4862); both touch
files this branch changes or moves.
Conflicts:
- packages/llm/llm-deepseek/tests/adapter.spec.ts,
packages/llm/llm-deepseek-account/tests/provider.spec.ts,
packages/experimental/translator/tests/paid-fixture.ts, and
packages/web/web-search-deepseek/tests/deepseek.spec.ts: master rewrote
the id constructor calls to brandString<T>() with type-only imports,
while this branch replaced the hand-built account stand-ins with
accountStub. The result keeps master's id construction and imports and
this branch's stand-ins; the one Session this branch's own search test
creates follows master's construction.
- packages/web/web-deepseek-api/package.json and
packages/web/web-search-deepseek/package.json: this branch's sorted
devDependencies plus master's dsh-brand entry.
- docs/capability-seams.md and docs/capability-seams.zh.md: master's
cuaPrograms consumer edge and this branch's deepseekAccount consumer
edges coexist; the pairing record is recorded again from the merged
pair.
- docs/module-graph.md, docs/module-graph.zh.md,
docs/persistence-schema.json, and pnpm-lock.yaml: regenerated from the
merged sources.
Beyond the conflicts:
- scripts/empty-catch.baseline.json: master recorded two clauses under
packages/credentials/deepseek-account, which this branch moves to
packages/account/deepseek-account. The two keys are renamed with the
files, as the gate requires for a moved file.
- AGENTS.md: master's checker link and this branch's account/ layout row
together exceeded the frozen 2,080-word ceiling by one word, so the row
reads "account/ DeepSeek".
The config catalog records the source line of the plugin's Config. The
previous commit grew the module comment by one line, which moved that
line and left the generated catalog stale; reflowing the comment keeps
the catalog as committed.
- web-search-deepseek: the initiating route's account credential is used
only when the search endpoint has the origin of that route's base URL.
For another origin the provider does not ask the route and sends the
API key, and readiness answers the same way. A route publishing an
unparsable base URL is treated like settings that do not resolve.
- web-deepseek-api, web-search-deepseek: after HTTP 401 a failure of the
grant's reject() is contained, so the reported error stays the HTTP
rejection whichever owner published the credential.
- deepseek-account: the request credential's reject() re-resolves the
account service through the resolving context, so a reload between a
request and the destination's HTTP 401 still removes the stored grant;
without a mounted service the grant stays for the next one to reject.
resolveToken and rejectToken become private; the e2e sign-in stand-in
and the generated API catalog follow.
- llm-deepseek: routeCredential().resolve() publishes the grant's headers,
value, and rejection only, keeping the adapter's onRequestError behind
the seam.
- web-deepseek-api: a route publishing an unparsable base URL becomes a
misconfigured source instead of throwing from readiness or dispatch.
- RouteCredential.configured: the owner may read its store to answer; the
contract no longer claims "without reading the credential's value". Same
text in the source JSDoc, both llm-streaming type-equiv blocks, and the
seam Agent Note.
- llm-deepseek README: replace the stale resolveAuth(connection) summary
with the resolveAuth(connection, endpoint) contract.
- llm-deepseek-account README: the listing cache is keyed by a SHA-256 of
the credential headers, not of the token.
- web-deepseek-api tests/routes.ts: note that composition.spec.ts covers the
real route plugins.
- packages/README: restore the document/, credentials/, and util/ rows and
raise the verify-doc-budgets ceiling to 1,060 for the account/ row.
`LlmAdapter.routeCredential(provider)` publishes the credential a route
currently sends: kind, resolved base URL, optional reference, a value-free
presence check, and per-endpoint grants carrying protocol headers, the bare
value, and an optional 401 invalidation. `LlmRuntime.routeCredential()`
forwards to the owning adapter.
`dsh-llm-deepseek` reads no credential: `resolveAuth(connection, endpoint)`
returns a grant or `undefined`, `missingCredential` names the failure, and
`credential` declares the publication. The route plugins own their
credentials through the new `dsh-credentials` reference helpers and the
account service's `resolveRequestCredential()`; the account route also owns
sign-out cancellation and registers a running-task report. The account
service inspects no Agents, drops its `dsh-agent` and `dsh-llm` peers, and
moves to `packages/account/`. The web providers consume route publications
and drop their dependencies on `dsh-llm-deepseek`, the route plugins, and the
Loader.
Documented in the Agent Note and the `llm-route-credential` upgrade guide.
Both are hand-checked argument constraints, like the blank web_search
query, so they throw ToolArgsError and gain the invalid arguments:
prefix. SkillError no longer declares SKILL_INVALID_NAME.
Refs #7869
web_search query count and blank-query checks now throw ToolArgsError
(INVALID_ARGS), so their text gains the shared "invalid arguments:"
prefix. A blank web_fetch URL throws WebError with the existing
WEB_INVALID_URL code and keeps its message.
Refs #7869
The Harness-home exemption matched every name case-insensitively, so a
home `.env` line such as `deepseek_base_url=...` passed the check and
landed in `process.env` under that spelling. The launch snapshot looks
names up exactly on POSIX, so llm-deepseek, web-search-deepseek, and
web-deepseek-api never saw it: the launch succeeded with the official
endpoint, where it used to fail. Proxy names keep matching in any letter
case because proxy clients read both spellings; the two endpoint names
now match only as `DEEPSEEK_BASE_URL` and `DEEPSEEK_SEARCH_BASE_URL`, and
another spelling fails the launch with the exact name to use.
The home-layer refusal case now covers `SSL_CERT_FILE`,
`NODE_TLS_REJECT_UNAUTHORIZED`, and `DSH_HOME`. The web-deepseek-api
README states where `DEEPSEEK_BASE_URL` may come from; the
launch-environment README, the development guide, and the configuration
source Agent Note no longer overstate which file is refused, which
Vitest configurations load the root `.env`, or what a checkout may carry.
Refs #8138
`loadLayeredEnv` refused `DEEPSEEK_BASE_URL` and
`DEEPSEEK_SEARCH_BASE_URL` from every discovered `.env`, including the
user's own `$DSH_HOME/.env`, so a machine-level endpoint written there
made both the CLI and Desktop fail at startup.
The refusal exists for the invoking directory's file: it arrives with a
clone, and a repository must not choose where requests carrying the
user's DeepSeek credential go. The home file is the user's own, and the
profile patches in the same directory can already set these endpoints as
plugin `baseURL` fields, so refusing it there protected nothing.
`HOME_LAYER_PROXY_NAMES` becomes `HOME_LAYER_ROUTE_NAMES` and adds the
two endpoint names; a project `.env` that sets either still fails the
launch, and its message now names the home file as the second way out.
`DSH_HOME` stays bootstrap-only, and the CA and TLS names stay refused
everywhere.
Tests cover the project layer refusing both names, the home layer
accepting both below an exported value, and the project-layer message.
The app-boot, launch-environment, llm-deepseek, and web-search-deepseek
READMEs, the development guide, and the two Agent Notes that stated the
old rule now state this one.
Refs #8138