Merge remote-tracking branch 'origin/master' into worktree/composer-host-confirmed-echo

# Conflicts:
#	docs/capability-seams.i18n.yaml
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-schema.json
This commit is contained in:
Yichen Jiang committed 2026-10-19 15:16:01 +08:00
commit d4aeef0352
1157 files changed
+21809 -3460

No files matched your search

@@ -3,14 +3,19 @@
// Orphaned lineage degrades to root level; cycles fail soft and emit as roots.
import type { SessionId } from '@deepseek-ai/dsh-session/types'
import type { SessionProjectionMap } from '@deepseek-ai/dsh-session-projection/types'
import type { SessionProjectionSummaryValues } from '@deepseek-ai/dsh-session-projection/types'
import type { SessionSummary } from '../../types.ts'
/** Host list summary enriched with the latest Session Controller title projection. */
export interface TitledSessionSummary extends SessionSummary {
title?: string
/** Current host-computed projection values for list consumers. */
projectionValues?: Readonly<Partial<SessionProjectionMap>>
/**
* The row's summary projection values, never the full projection set. A
* connected Session's client store may hold more values from its
* control/follow baseline; those are outside the list contract and must not
* be read here.
*/
projectionValues?: Readonly<Partial<SessionProjectionSummaryValues>>
}
/** One flattened session-list row with lineage depth. */
@@ -30,8 +35,11 @@ export interface SessionListEntry {
/** Format classification supplied by the Host list. */
formatStatus?: SessionSummary['formatStatus']
cwd?: string
/** Current host-computed projection values for list consumers. */
projectionValues?: Readonly<Partial<SessionProjectionMap>>
/**
* The row's summary projection values, never the full projection set; see
* `TitledSessionSummary.projectionValues`.
*/
projectionValues?: Readonly<Partial<SessionProjectionSummaryValues>>
/** Lineage indent depth: root = 0; the UI just multiplies by the indent width. */
depth: number
}
@@ -2,7 +2,7 @@
import type { SubagentAddress } from '@deepseek-ai/dsh-subagent/client'
import { SessionSeq, type SessionId, type SessionSeqCursor } from '@deepseek-ai/dsh-session/types'
import type { SessionProjectionMap } from '@deepseek-ai/dsh-session-projection/types'
import type { SessionProjectionMap, SessionProjectionViewValues } from '@deepseek-ai/dsh-session-projection/types'
import type { WorkspaceId } from '@deepseek-ai/dsh-workspace/types'
import type {
SessionControlBaseline,
@@ -58,9 +58,14 @@ export interface SessionListSnapshot {
}
/** Shared projection values and the lifecycle of their explicit baseline read. */
/**
* Every projection value the store currently holds, with the summary mark
* stripped, and the lifecycle of its explicit baseline read. This is the full
* attached-Session set, not a list row's summary contract (see
* `SessionListEntry.projectionValues`).
*/
export interface SessionProjectionSnapshot {
readonly values: Readonly<Partial<SessionProjectionMap>>
readonly values: Readonly<Partial<SessionProjectionViewValues>>
readonly state: 'idle' | 'loading' | 'ready' | 'migration-required' | 'error'
readonly error: RemoteFailure | null
}
@@ -5,7 +5,7 @@ import { SessionSeq, type SessionId } from '@deepseek-ai/dsh-session/types'
import { workspaceTitleOf } from '@deepseek-ai/dsh-util-workspace-path'
import type { WorkspaceId } from '@deepseek-ai/dsh-workspace/types'
import { SESSION_SEARCH_RESULT_LIMIT } from '../../types.ts'
import type { SessionProjectionMap } from '@deepseek-ai/dsh-session-projection/types'
import type { SessionProjectionSummaryValues } from '@deepseek-ai/dsh-session-projection/types'
import {
createSnapshotStore, notifySubscribers, type ObservableSnapshot, type SnapshotStore,
} from '@deepseek-ai/dsh-client-store'
@@ -49,8 +49,12 @@ export interface SessionSummary {
*/
blank: boolean
updatedAt: number
/** Current host-computed projection values retained by the object layer. */
projectionValues?: Readonly<Partial<SessionProjectionMap>>
/**
* The row's summary projection values retained by the object layer, never the
* full projection set. A connected Session's store may hold more values from
* its control/follow baseline; those are outside the list contract.
*/
projectionValues?: Readonly<Partial<SessionProjectionSummaryValues>>
}
/** Catalog metadata and local source counts; catalog membership owns no Client generation. */
+14 -7
View File
@@ -16,7 +16,7 @@ import {
SESSION_SEARCH_SNIPPET_MAX_CODE_POINTS,
} from './types.ts'
import type {
SessionListMetadata, SessionProjectionHints, SessionProjectionValues, SessionSearchItem,
SessionListMetadata, SessionProjectionHints, SessionSearchItem,
SessionSearchValue, SessionSummary,
} from './types.ts'
@@ -98,6 +98,7 @@ export class ApiSessionList {
wire: {
viewSchema: imageLimitsSchema,
view: () => attachmentCtx.attachments.imageLimits,
summary: false,
},
stateVersion: 1,
})
@@ -293,16 +294,21 @@ export class ApiSessionList {
session: Session | undefined,
): SessionProjectionHints | undefined {
try {
// The registry derives the summary key set from its registrations and
// hands back one stable set until the key table changes; both faces below
// serve only those keys, so a list row cannot carry a unit that declares
// itself summary-excluded.
const keys = this.ctx.sessionProjections.summaryKeys()
if (session !== undefined) {
// The live registry computed the block for this Session: its watermark
// shares the sequence space of the Session's baselines and frames.
return hintsOf('sequenced', this.ctx.sessionProjections.cachedSnapshot(session))
return hintsOf('sequenced', this.ctx.sessionProjections.cachedSnapshot(session, keys))
}
// A cold row reads the persisted cache by header alone; the cache serves
// seeded and unseeded lifecycles alike because a listing never seeds a
// fold. The watermark is the stored record's own.
const cache = this.ctx.get('sessionProjectionCache')
return hintsOf('cached', cache?.cachedSnapshot(header) ?? cache?.cachedPredecessorTitle(header))
return hintsOf('cached', cache?.cachedSnapshot(header, keys) ?? cache?.cachedPredecessorTitle(header))
} catch (error) {
this.ctx.logger.warn(
`api-session.list: projection column for "${header.id}" failed; serving the row without it: ${String(error)}`,
@@ -313,7 +319,8 @@ export class ApiSessionList {
}
/**
* Wrap one projection block as Session-list hints of the named sequence space.
* Wrap one summary projection block as Session-list hints of the named sequence space.
* The block is the summary key set's values, not every value the source holds.
* @param kind - which sequence space the block's watermark belongs to.
* @param block - the block, or `undefined` when no source served one.
* @returns the hints, or `undefined` when the block is absent or carries no value.
@@ -323,9 +330,9 @@ function hintsOf(
block: ProjectionSnapshot | undefined,
): SessionProjectionHints | undefined {
if (block === undefined || Object.keys(block.values).length === 0) return undefined
// Listing hints contain every wire value the source currently holds but
// remain partial: missing cells and cache rows are never materialized here.
return { kind, asOfSeq: block.asOfSeq, values: block.values as SessionProjectionValues }
// Listing hints contain every summary wire value the source currently holds
// but remain partial: missing cells and cache rows are never materialized here.
return { kind, asOfSeq: block.asOfSeq, values: block.values }
}
function normalizeSearchQuery(query: string): string {
+14 -9
View File
@@ -8,7 +8,7 @@ import type { Branded } from '@deepseek-ai/dsh-brand'
import type { LlmAttemptId, MessageId } from '@deepseek-ai/dsh-llm/brand'
import type { TextBlock } from '@deepseek-ai/dsh-llm'
import type { SessionId, SessionSeqCursor } from '@deepseek-ai/dsh-session/types'
import type { SessionProjectionMap } from '@deepseek-ai/dsh-session-projection/types'
import type { SessionProjectionMap, SessionProjectionSummaryExcluded, SessionProjectionSummaryValues } from '@deepseek-ai/dsh-session-projection/types'
import type { Principal } from '@deepseek-ai/dsh-typert-protocol'
import type { JsonValue } from '@deepseek-ai/dsh-util-values'
import type { WorkspaceId } from '@deepseek-ai/dsh-workspace/types'
@@ -25,8 +25,12 @@ declare module '@deepseek-ai/dsh-session-projection/types' {
interface SessionProjectionMap {
/** Persisted facts used to summarize a Session without activating it. */
sessionListMetadata: SessionListMetadata
/** Image-intake limits enforced by the Session prompt endpoint. */
imageLimits: ImageAttachmentLimits
/**
* Image-intake limits enforced by the Session prompt endpoint. Boot
* constant, excluded from Session summary payloads: every Session shares
* it, so a list row would repeat one host-wide fact.
*/
imageLimits: SessionProjectionSummaryExcluded<ImageAttachmentLimits>
/** Durable model selection already used and selected for the next request. */
modelSelection: ModelSelectionProjection
}
@@ -51,10 +55,11 @@ export interface SessionListMetadata {
}
/**
* Every available wire value a Session-list row carries as partial, possibly
* stale hints. `kind` and `asOfSeq` are independent facts: `kind` says which
* sequence space `asOfSeq` belongs to, and therefore how a client may merge
* the block; `asOfSeq` is the producer's watermark in that space.
* Every available summary wire value a Session-list row carries as partial,
* possibly stale hints. The block omits the keys whose unit declares
* `summary: false`. `kind` and `asOfSeq` are independent facts: `kind` says
* which sequence space `asOfSeq` belongs to, and therefore how a client may
* merge the block; `asOfSeq` is the producer's watermark in that space.
*/
export interface SessionProjectionHints {
/**
@@ -67,8 +72,8 @@ export interface SessionProjectionHints {
readonly kind: 'cached' | 'sequenced'
/** Watermark of the block in the sequence space named by `kind`. */
readonly asOfSeq: number
/** Provider-validated values present in the block; omitted keys remain unknown. */
readonly values: SessionProjectionValues
/** Provider-validated summary values present in the block; omitted keys remain unknown. */
readonly values: Partial<SessionProjectionSummaryValues>
}
/** Complete projection values at an exact Session event cursor. */