Commit Graph
100 Commits
Author SHA1 Message Date
_Kerman 53c8f64eed Merge pull request #2781 from deepseek-harness/xtr/projection-per-session-cache
feat(session-projection-cache): per-session checkpoint documents on a per-record storage layout
2026-08-25 21:37:09 +08:00
_Kerman cef391487a Merge remote-tracking branch 'origin/master' into xtr/projection-per-session-cache 2026-08-25 21:23:28 +08:00
_Kerman 380334436e fix(storage-json): preserve legacy cache after bootstrap 2026-08-25 21:02:39 +08:00
_Kerman 741083f03b Merge remote-tracking branch 'origin/master' into xtr/projection-per-session-cache 2026-08-25 20:54:08 +08:00
_Kerman 83459fa476 perf(storage-json): load record files concurrently 2026-08-25 20:50:54 +08:00
_Kerman d79ff0b589 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2781 2026-08-25 20:15:26 +08:00
_Kerman 3f34c026e3 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2781 2026-08-25 20:04:32 +08:00
_Kerman 96db1c8c81 fix(snapshot): canonicalize cache-split chunk runs 2026-08-25 15:10:26 +08:00
_Kerman 38355623a2 Merge remote-tracking branch 'origin/master' into xtr/projection-per-session-cache
# Conflicts:
#	packages/bundle/web-app/README.i18n.yaml
#	packages/bundle/web-app/README.md
#	packages/bundle/web-app/README.zh.md
2026-08-25 14:45:03 +08:00
_Kerman b588675ccf Merge remote-tracking branch 'origin/master' into xtr/projection-per-session-cache
# Conflicts:
#	pnpm-lock.yaml
2026-08-25 14:40:22 +08:00
_Kerman 2c17b3048e fix(bundle): enable projection cache in base-backed profiles 2026-08-25 14:33:05 +08:00
_Kerman ee2ee398ce test(credentials-local): seed fixtures atomically to close a boot-read race
The concurrent-migrator test wrote the winner document with a plain
writeFile, whose truncate-then-write window lets the boot's unlocked
initial read observe an empty file and boot an empty store under load.
Seed fixtures through writeFileAtomic instead, matching how the provider
itself persists, so a reader sees either the old or the new complete
document.
2026-08-25 14:13:06 +08:00
_Kerman 3fefcdbe3f Merge pull request #2698 from deepseek-harness/xtr/session-format-migration
feat(session): add streaming format migration pipeline
2026-08-25 13:47:43 +08:00
_Kerman 2664200844 Merge remote-tracking branch 'github/master' into xtr/session-format-migration 2026-08-25 13:04:23 +08:00
_Kerman e5a41d164b Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2781 2026-08-25 13:04:04 +08:00
_Kerman e62d6d3d15 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2781 2026-08-25 12:49:32 +08:00
_Kerman d385dfb3e3 Merge remote-tracking branch 'github/master' into xtr/session-format-migration
# Conflicts:
#	docs/config-catalog.i18n.yaml
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	packages/session/session-persistence-jsonl/src/index.ts
#	packages/session/session-persistence/src/coordinator.ts
#	packages/session/session-persistence/src/index.ts
2026-08-25 12:41:23 +08:00
_Kerman ce65310183 fix(ci): keep the base projection cache out of listing-less profiles
The base-mounted projection cache's write-behind forces session-log flushes
at cache-chosen times, splitting packed chunk rows and changing the durable
JSONL batching the keyless headless and sdk replay fixtures pin. Neither
profile exposes a session-listing surface — the one-shot runner and the SDK
protocol — so both bundles disable the base row, restoring the pre-base
behavior the fixtures were recorded against (the same pattern acp-app uses).
2026-08-25 11:48:12 +08:00
_Kerman 3c8b5a26a4 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2781
# Conflicts:
#	docs/config-catalog.i18n.yaml
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/event-producer-consumer.i18n.yaml
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/subsystems/session-projection.i18n.yaml
#	docs/subsystems/session-projection.md
#	docs/subsystems/session-projection.zh.md
#	packages/api/session-controller/src/history.ts
#	packages/api/session-controller/tests/session-cold.host.spec.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
#	packages/session/session-projection-cache/src/index.ts
#	packages/session/session-projection-cache/tests/cache.spec.ts
#	packages/session/session-projection/src/index.ts
#	scripts/run-gates.ts
2026-08-25 10:52:45 +08:00
_Kerman 5fe36b513e fix(ci): restore acp snapshot transcripts and windows coverage gate ordering
- The base-mounted projection cache's write-behind forces session-log
  flushes at cache-chosen times, splitting packed chunk rows and collapsing
  the persistence window the keyless acp transcripts pin. ACP exposes no
  session-listing surface, so the automation profile disables the base row,
  restoring the pre-base behavior the fixtures were recorded against.
- The windows coverage lane runs suites that read built lib/ output (the
  webworker-packer image tests) and raced the build gate's tsdown writes
  against a partial tree; every coverage gate now waits for the build gate.
2026-08-24 16:17:19 +08:00
_Kerman 334dd53c92 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2781
# Conflicts:
#	.agents/notes/proposed/architecture/2026-07-28-storage-root-and-derived-medium-recovery.i18n.yaml
#	.agents/notes/proposed/architecture/2026-07-28-storage-root-and-derived-medium-recovery.md
#	.agents/notes/proposed/architecture/2026-07-28-storage-root-and-derived-medium-recovery.zh.md
#	docs/event-producer-consumer.i18n.yaml
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	packages/api/session-controller/tests/session-cold.host.spec.ts
#	packages/bundle/web-app/package.json
#	packages/host/apiproxy/src/api-proxy.ts
#	packages/session/session-projection-cache/package.json
2026-08-24 15:13:10 +08:00
_Kerman 04abeddd3e Merge origin/master into xtr/session-format-migration 2026-08-24 10:31:05 +08:00
_Kerman 65295d5b68 docs(session): refresh persistence pairing record 2026-08-22 21:51:49 +08:00
_Kerman 2ba721f799 Merge github/master into xtr/session-format-migration 2026-08-22 21:51:30 +08:00
_Kerman 3d660d2db2 ci: raise host TypeScript heap budget 2026-08-22 16:26:31 +08:00
_Kerman 421a577b1c Merge remote-tracking branch 'origin/master' into xtr/session-format-migration
# Conflicts:
#	.agents/notes/implemented/architecture/2026-08-10-session-log-version-mechanism.i18n.yaml
#	.agents/notes/implemented/architecture/2026-08-10-session-log-version-mechanism.md
#	.agents/notes/implemented/architecture/2026-08-10-session-log-version-mechanism.zh.md
#	docs/subsystems/persistence.i18n.yaml
#	docs/subsystems/persistence.md
#	docs/subsystems/persistence.zh.md
#	packages/session/session-persistence-jsonl/src/format.ts
#	packages/session/session-persistence/src/coordinator.ts
2026-08-22 16:01:15 +08:00
_Kerman 95ed302c9c fix(session): remove unreachable listing branch 2026-08-21 22:08:53 +08:00
_Kerman 7e3d5332dc fix(session): address migration review feedback 2026-08-21 17:48:45 +08:00
_Kerman 9ab59b8001 Merge remote-tracking branch 'origin/master' into xtr/session-format-migration 2026-08-21 17:01:51 +08:00
_Kerman 8cf2445f11 Merge remote-tracking branch 'origin/master' into xtr/session-format-migration
# Conflicts:
#	.agents/notes/implemented/architecture/2026-06-14-session-persistence.i18n.yaml
#	.agents/notes/implemented/architecture/2026-06-14-session-persistence.zh.md
#	docs/config-catalog.i18n.yaml
#	docs/subsystems/persistence.i18n.yaml
#	docs/subsystems/persistence.md
#	docs/subsystems/persistence.zh.md
#	packages/session/session-persistence-jsonl/README.i18n.yaml
#	packages/session/session-persistence/README.i18n.yaml
#	packages/session/session-persistence/README.zh.md
2026-08-21 15:55:20 +08:00
_Kerman 2da00047f3 refactor(session-persistence): make format migrations one-to-one 2026-08-21 15:50:30 +08:00
_Kerman 265f02fbf5 perf(session-projection): index contiguous restore tails 2026-08-21 14:24:28 +08:00
_Kerman a216756222 perf(session-projection): avoid restore tail copies 2026-08-21 14:09:33 +08:00
_Kerman a693e0764b docs: revert spurious BRAND-GUIDELINES.md change from master merge 2026-08-21 13:09:33 +08:00
_Kerman b70f27f764 Merge pull request #2739 from deepseek-harness/xtr/speed-up-doc-sync
perf(infra): shorten doc-sync critical path
2026-08-21 12:36:36 +08:00
_Kerman d72713c1b3 Merge pull request #2702 from deepseek-harness/xtr/2701-stable-session-snapshots
test: omit persistence envelopes from session snapshots
2026-08-21 12:35:16 +08:00
_Kerman 36a10618df Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2739
# Conflicts:
#	scripts/run-gates.spec.ts
2026-08-21 12:01:02 +08:00
_Kerman 0ee3d664ba Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2702 2026-08-21 11:53:00 +08:00
_Kerman bb3105d7b5 refactor(apiproxy): restore the single-line listProjectionsFor signature
An intermediate cache iteration made cachedSnapshot async, which forced
listProjectionsFor onto a multi-line async signature; the final design
kept the sync read but the formatting residue stayed. No behavior
change.
2026-08-21 11:49:52 +08:00
_Kerman 6fb8e9a4b9 Merge remote-tracking branch 'origin/master' into xtr/2701-stable-session-snapshots 2026-08-21 11:43:58 +08:00
_Kerman d0d5b00095 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2739
# Conflicts:
#	.agents/notes/implemented/process/2026-07-06-parallel-pre-push-gates.i18n.yaml
#	.agents/notes/implemented/process/2026-07-13-documentation-site-projection.i18n.yaml
2026-08-21 11:35:58 +08:00
_Kerman 87c01d9966 test(storage-json): reach the unreadable-record branch on every platform
The per-record contract test forced readFile to fail via chmod 0o000,
which is a no-op on win32, so the readRecord catch stayed uncovered on
the windows native coverage gate. Route record documents without an
isFile pre-filter: a directory where the document should be throws
EISDIR on every platform, and readRecord's existing contract already
reads an unreadable document as absent. Drop the win32 skip.
2026-08-21 11:34:22 +08:00
_Kerman 4760c40e84 docs(session-projection): apply master's locale link fixes after merge
The master merge brought the doc-sync regenerations (locale-specific
paired document paths). Re-apply the zh-side link fixes to the agent
note and the session-projection intro, re-record translation pairing,
and keep the e2e event arrays as asserted literals like master.
2026-08-21 11:14:07 +08:00
_Kerman ff9735cb8c Merge origin/master into xtr/projection-per-session-cache 2026-08-21 11:07:27 +08:00
_Kerman 8baa987387 test(storage): harden windows-native teardown and chmod probe
The per-record rm in the cache spec hits an EPERM flake on windows
native (directory still draining); retry the recursive rm like the
subagent spec does. The unreadable-record probe is meaningless on
windows, where chmod 0o000 is a no-op; skip it there.
2026-08-21 10:46:21 +08:00
_Kerman 1134c2a98e test(web): seed cold subagent fixtures through the per-record cache
The reworked cache moved from the awaited coldSnapshot(id) to a sync
coldSnapshot(meta, events) whose write-back is fire-and-forget, and the
e2e fixture dropped the seeding call with it. The web bundle mounts the
cache again, so list rows read projection columns from stored rows only;
the one-shot and grandchild fixtures therefore lost their projections
column and the tree golden drifted. Re-seed both through the new API and
poll for the write-back to land.
2026-08-21 10:46:17 +08:00
_Kerman a577a48acd Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2702 2026-08-20 17:52:56 +08:00
_Kerman cdb918c4b0 chore(storage-json): exempt the shared unit lifecycle from the duplication gate
The two standalone unit classes deliberately mirror the KvUnit drain/guard
lifecycle (close + assertOpen); mark the block with a reason-carrying
jscpd ignore so the duplication gate stays green.
2026-08-20 17:34:08 +08:00
_Kerman f6080c3753 docs(session-projection-cache): sync catalogs, type-equiv, and event consumers after master merge
Regenerate config/cordis catalogs and doc graphs (the master merge changed
configs and consumers), add the DomainSpec layout field to the storage
type-equiv block, record session-projection-cache as a session/created
consumer, and drop the leftover experimental/team ghost directories from
the master rename. All 37 static gates pass.
2026-08-20 17:26:32 +08:00
_Kerman 2c11e73c55 Merge remote-tracking branch 'origin/master' into xtr/projection-per-session-cache 2026-08-20 17:15:25 +08:00
_Kerman eb1f167fa4 refactor(session-projection-cache): restore the base method order
Keep the base class's relative method order (write before coldSnapshot) so
the diff against the base shows the cold-read methods as a pure insertion
instead of a reorder of existing methods.
2026-08-20 17:14:05 +08:00
_Kerman b67761a8a5 fix(session-projection-cache): checkpoint at session creation
A session that never talks — a forked child seeded with its ancestor's
title, say — previously got its first cache row only at detach; a crash,
or a fork held live in the store, left the seed-derived values (the
title) unreadable on the cold list. Session creation is now a third
mandatory write point: the creation checkpoint folds the seed and
persists immediately. Write-policy docs (README + catalogs) updated.
2026-08-20 16:37:41 +08:00
_Kerman 08e546eff1 feat(storage-json): one-time migration of a legacy whole-unit file to per-record
Opening a per-record unit splits a legacy `<root>/<name>.json` (the
pre-per-record single-file layout) into per-record documents; an
already-present new record wins, and the legacy file is deleted once
every record migrated. The migration also runs when the new tree is
absent — the fresh-upgrade shape — and foreign, shapeless, or malformed
legacy files are left alone. This preserves previously cached session
titles, list metadata, stats, and subagent identity across the medium
change.
2026-08-20 16:25:39 +08:00
_Kerman 84db39cec4 feat(session-projection-cache): seed cold reads from the cache and write back
A detached history read still traverses the complete log, but each unit's
fold is now seeded from its cached checkpoint: the registry's restore
slices off the already-folded prefix (events at or below the row's seq)
and applies only the tail. The first cold read writes the refreshed
checkpoint back (fail-soft), so the cache row is created on first read
and kept current afterwards. The recipe lives on the cache
(cachedCheckpoint, coldSnapshot, writeBack); the api-proxy carrier only
supplies the stored header and the full log.
2026-08-20 16:25:39 +08:00
_Kerman 4347ee17f3 fix(test): use unique temp dirs for acp-demo composition persistence
The composition tests hardcoded shared /tmp/dsh-acp-demo-* persistence
roots. On the shared self-hosted CI VM, concurrent jobs running the same
master-level test file opened the same SQLite session-query.db and one
failed with "database is locked". Use mkdtemp-unique directories so each
run owns its SQLite index while still exercising explicit
persistenceRoot forwarding.
2026-08-20 16:04:40 +08:00
_Kerman 02a608271e Merge origin/master into xtr/projection-per-session-cache 2026-08-20 16:03:51 +08:00
_Kerman 28b265c1e9 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2702
# Conflicts:
#	examples/headless-agent/tests/snapshots/headless-profile/session.expected.jsonl
2026-08-20 15:26:37 +08:00
_Kerman e333dfc8f5 Merge pull request #2794 from deepseek-harness/fix/web-new-session-first
fix(ui-workspace): pin the current blank New Session row first
2026-08-20 14:53:08 +08:00
_Kerman 9a2dc3327d test(web): align blank-session activity snapshot 2026-08-20 14:40:09 +08:00
_Kerman 07cf16d57c docs(session-projection-cache): sync the per-record domain medium across docs
Cache README (EN/ZH): the medium is the session_projcache domain in
per-record layout (one version-stamped document per session under the
json backend root), reads are synchronous from the domain's in-memory
tables, and the storage stack rides in base. storage-json README
documents both layouts and their contracts; web-app README notes that
storage and the projection cache live in the shared base. Regenerated:
session-projection subsystem catalog (sync cachedSnapshot, domain
medium), config-catalog (Config.root gone), module-graph (cache now
depends on storage-domain, not session-persistence), cli composition
(storage rows in base), and the projection-cache Agent Note — which now
records the file-root revision and its revert as rejected alternatives.
2026-08-20 14:38:39 +08:00
_Kerman 9226d9bbf6 test(session-projection-cache): rewrite for the per-record domain medium
cache.spec now boots the real storage stack (storage, storage-json,
storage-domain) and asserts the per-record medium directly:
<root>/session_projcache/sessions/<id>.json carries a version-stamped
{version, record} document, cachedSnapshot is synchronous (zero-I/O from
the domain's in-memory tables), and the write-policy / fail-soft / listing
coverage is preserved at 100%. json-backend.spec gains a per-record layout
block (per-record documents, overwrite/delete/reopen, unsafe keys and
undeclared tables rejecting, foreign-document discard on open, closed
guard, close drain, unreadable-as-absent); storage-domain domain.spec
covers layout validation and descriptorOf projection. list-children.spec
mounts the storage stack for its projectionCache cases and its
cachedSnapshot mocks and reads go synchronous; the api-proxy specs' cache
mocks go synchronous too. devDeps and tsconfig references updated for the
storage stack.
2026-08-20 14:38:33 +08:00
_Kerman b3b6407a2c fix(ui-workspace): promote new sessions only once 2026-08-20 14:21:55 +08:00
_Kerman 50ad2aba19 fix(session-persistence): repair persistence CI gates
- document the exported SqliteStore prefix/suffix loaders (verify-export-jsdoc)
- share createStoredEventRead from session-persistence so the standalone
  SQLite store stops duplicating the service helper (duplication gate)
- route replaceStored header upserts through writeRow (duplication gate)
- move replacement/conflict test SQL into closed test resources so the
  SQLite SQL resource boundary test passes
2026-08-20 14:21:47 +08:00
_Kerman 3a4232a8fa fix(bundle): promote the storage stack and the projection cache to base
The storage hub, json backend, and domain form are general infrastructure,
and the projection cache is a session-layer service that depends on them —
both belong in the shared base, not in the web overlay. Base now provides
storage / storage-json / storage-domain / session-projection-cache; the
web-app overlay keeps its surface consumers (workspace, message-feedback),
which inherit storageDomain from base (a child layer sees parent services).
This reverts the storage stack's historical web-app-only placement and the
file-root design's base mount of the cache.
2026-08-20 13:56:23 +08:00
_Kerman 4ea6f4df24 Merge pull request #2730 from deepseek-harness/xtr/projection-state-schema
refactor(projection): separate host state from client views
2026-08-20 13:55:58 +08:00
_Kerman e01c1a4b41 fix(bundle): mount the projection cache in the web-app overlay
The cache now opens its domain through ctx.storageDomain, which the
web-app overlay provides (storage-json + storage-domain, backend json).
A parent layer cannot see a child layer's services, so the base-layer
mount from the file-root design is reverted: the cache mount moves back
to web-app next to its storage dependencies, and Config.root is gone.
2026-08-20 13:47:53 +08:00
_Kerman 1201ecc828 fix(session-projection-cache): store checkpoints on a per-record storage domain
Restore the storage-domain medium the file-root design replaced: the cache
opens the session_projcache domain (per-record layout — one document per
session under the json backend root) and checkpoint writes land through
the domain's write chain. Reads and writes now share ONE coherent state:
cachedSnapshot reads synchronously from the domain's in-memory tables,
and every write is durability-first-then-memory, so a read can never go
around the write chain to the medium. The hand-rolled write chains,
in-flight tracking, per-session file paths, owner-only file modes, and
the sqlite no-path special case are gone; Config.root is removed and the
domain's version stamp makes a checkpointRecord bump discard stale
sessions per record instead of rejecting the whole medium. The async
ripple of the old file read is reverted: api-proxy's listing column and
subagent's cold identity read go back to synchronous cachedSnapshot.
2026-08-20 13:47:47 +08:00
_Kerman 501f387b46 feat(storage): add the per-record layout to the json backend
The json backend now serves two layouts. single (the default) keeps the
whole unit as one document at <root>/<name>.json; per-record keeps one
version-stamped document per record at <root>/<name>/<table>/<key>.json
(plus global.json), so one write rewrites one record instead of the whole
unit. The per-record unit is stateless — the directory is the state,
loadAll re-reads the tree, and every write is a single durable file
operation — while single keeps its authoritative in-memory state and
whole-file publish. Records keys must be path-safe ([a-zA-Z0-9_-]+);
an unsafe key rejects. A record document that is malformed or stamped
with another version reads as an absent record: one bad or stale file
never bricks the unit, and a version bump discards stale records instead
of migrating them. DomainSpec and KvUnitDescriptor gain the optional
layout field (defineDomain validates it, descriptorOf projects it).
2026-08-20 13:47:39 +08:00
_Kerman d53292b30a fix(ui-workspace): make the blank-session pin render-only and skip masked drags
Review follow-up on #2794: the pin was applied inside nextSessionOrderAccount,
whose output syncSessionOrderAccount persists into sessionOrderByAccount, so a
reused blank stayed first forever after turning non-blank (even across
reloads). Move the pin to the render-derived layer (orderedWorkspaces,
orderedUngroupedSessionIds, ungrouped order, flat rows) so the persisted
account order is never touched, and skip drags the pin would mask (dragging
the pinned blank, or parking another row into the pinned slot) entirely,
including the Host account write.

Adds regression tests for the masked-drag skip and for the pin releasing when
the blank turns real; updates the sidebar-order Agent Note (EN + ZH) and its
pairing hash.
2026-08-20 13:25:55 +08:00
_Kerman fa39fb0881 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2730 2026-08-20 13:25:35 +08:00
_Kerman f9cd580a33 Merge remote-tracking branch 'origin/master' into xtr/projection-state-schema 2026-08-20 13:21:03 +08:00
_Kerman c9f51173c3 test(acp): keep persistent-pwsh-tool-turn fixture in canonical packed layout
Migrate the fixture merged from master through the canonical projection so
the repository-wide snapshot layout check passes without re-recording.
2026-08-20 13:13:56 +08:00
_Kerman 98723525c6 docs(notes): record current-blank pinning in the sidebar order note
The New Session being created renders first in its account while selected,
in both order modes; opening or reusing a blank never advances its
updatedAt, so the pin keeps the reused row at the front.
2026-08-20 12:51:59 +08:00
_Kerman d0b7dea8af fix(ui-workspace): pin the current blank New Session row first
Clicking New Session reuses the workspace's existing blank session when one
exists; reuse only opens it, so its updatedAt (host: max(createdAt,
lastPromptAt)) never advances and the row kept its old creation-time
position in the sidebar. nextSessionOrderAccount now pins the currently
selected blank session to the front of its account in both Manual and Last
updated modes; non-blank navigation stays untouched.

Fixes #2788
2026-08-20 12:51:51 +08:00
_Kerman bb79203f53 fix(docs): drop stale persist field from projection type-equiv block
ProjectionDefinition lost its persist?: boolean opt-in when every
projection unit became uniformly checkpointed, but the subsystem doc's
type-equiv paste still carried the field, so verify-type-equiv drifted
from packages/session/session-projection/src/index.ts. Remove the field
and its JSDoc from both language sides and re-record the bilingual
pairing record.
2026-08-20 10:29:56 +08:00
_Kerman 83a3457b4a Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2730 2026-08-20 10:04:04 +08:00
_Kerman f62986c01a docs(session-projection): sync persist removal, cache root, and catalogs
- subsystem docs: drop the removed persist flag from the ProjectionDefinition
  type block (both languages).
- config-catalog regenerated (cache requires sessionProjections/sessions,
  config gains root) and the zh side synced by hand; doc graphs regenerated.
- Agent Notes: the per-session cache note records the owned root tree and
  no-persistence design; the storage-root proposal's link to it is corrected
  (two levels up).
2026-08-19 22:26:16 +08:00
_Kerman 32ed3e2bce test: adapt consumers to the cache's own root tree
The web e2e seeds no longer warm the deleted coldSnapshot; assertions do not
depend on the cache path. list-children mounts the cache with a scratch
root instead of a storage-domain backend, and drops the now-unused storage
devDependencies.
2026-08-19 22:26:08 +08:00
_Kerman a9a51f8096 fix(bundle): mount the projection cache in the base overlay
The cache now owns its storage root (dshHomePath('projections')), so the
mount moves from the web-app overlay to base with that root declared, next
to the other base session layers. web-app inherits it; its overlay mount is
removed.
2026-08-19 22:26:02 +08:00
_Kerman 89321489db refactor(session-projection-cache): own the cache tree under a config root
Store each session's projection_cache.json under the cache's own root tree
(<root>/<session-id>/projection_cache.json, wired to dshHomePath('projections')
in the base bundle) instead of beside the session log via
sessionPersistence.locate(). The cache owns its directory layout, keys
directories by the code-generated session id, and never consults the
persistence layer; the service now injects only sessionProjections and
sessions.

Drop the coldSnapshot method and its readFrom-tail fold ladder: every cold
consumer refolds from the log itself, so the cache only serves the listing
read (cachedSnapshot, one async file read per session) and the write side.
Fail-soft durability, per-path write serialization, in-flight drain, and
atomic 0600 writes are unchanged; the chain cleanup now observes its own
rejection so a failed write cannot surface as an unhandled error.

dsh-session-persistence leaves peer/dev dependencies and the tsconfig
reference; dsh-atomic-write moves to peerDependencies. Config gains a
required root.
2026-08-19 22:25:54 +08:00
_Kerman 3f4c5f0563 fix(session-projection-cache): address review — atomic-write reuse, sqlite no-path, ordering and drain
- Write through @deepseek-ai/dsh-atomic-write with { mode: 0o600,
  dirMode: 0o700 } instead of exporting a second atomic-write primitive
  from dsh-storage-json; the session tree stays owner-only like the jsonl
  backend's own directories.
- Serialize atomic replacements per cache path so an older cut can never
  overwrite a newer one; track in-flight writes and drain them on
  disposal so a late flush cannot land after teardown.
- Detect the absent per-session directory before the checkpoint cut and
  durability flush: sqlite-style backends no-op the write entirely.
- Cold-read write-back path and identity both come from the stored log
  header (tail.meta), so a stale caller header cannot mint an orphan
  cache file.
- Add no-path coverage (write no-op, cachedSnapshot undefined, cold
  fallback to the full-log rung) and a concurrent-write ordering test;
  the package now holds 100% statement/branch/function/line coverage.
- Sync README.md/zh (inject list, coldSnapshot signature, per-session
  file read wording), package description, the Agent Note alternatives,
  and the superseded proposed/implemented notes (EN/ZH); add the
  concurrent-checkpoint Known Limitation.
2026-08-19 21:40:12 +08:00
_Kerman bb6faaf87b Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2698 2026-08-19 21:08:03 +08:00
_Kerman cdb4cc3c68 feat(session-projection-cache): store one projection_cache.json per session
Replace the single global session_projcache domain with a per-session
cache file inside the session's own persistence directory, resolved
through sessionPersistence.locate(meta) — the persistence backend owns
the session-directory layout, the cache service keeps every checkpoint
and cold-read responsibility.

- cachedSnapshot(meta) becomes async (one file read per session);
  coldSnapshot takes the session header so it can locate the file, with
  the stored log header remaining the identity witness.
- Backends without a per-session directory (sqlite) disable the durable
  cache: writes no-op and cold reads fall to the full-log rung. An
  obsolete global cache is never read — derived data refolds on first
  cold read (no migration).
- writeAtomic is exported from dsh-storage-json as the shared atomic
  whole-file replace primitive; api-proxy listing and subagent cold
  reads await the now-async cachedSnapshot.
- READMEs and a new Agent Note document the per-session medium.
2026-08-19 21:03:20 +08:00
_Kerman 270a06b38b fix(session-persistence-jsonl): drop crash-unsafe cross-process log lock
The product model has no cross-process writer exclusion (the coordinator
serializes per-session operations in-process; the README documents one
live writer per session), so the wx-created .lock sibling only guarded
byte-level races while adding two failure modes: a crash leaves a stale
lock that permanently wedges that log's appends/repairs/replacements, and
a post-commit lock cleanup failure makes a committed append look failed,
so the retained write-behind batch retries into duplicate seqs.

Remove withLogLock and keep replaceStored's revision compare-and-swap at
the commit boundary (recheck immediately before the atomic rename).
2026-08-19 20:42:56 +08:00
_Kerman c1b67c901d Merge remote-tracking branch 'origin/master' into xtr/2701-stable-session-snapshots 2026-08-19 20:39:44 +08:00
_Kerman e8f4315cee fix(session): scope format registry completeness to per-session decode
buildStepIndex rejected the whole decoder at initialization whenever any
registered step could not reach the current version, so one retired old
upgrader blocked every session, including later versions whose path to
the current version is complete. planSteps already refuses a specific
stored version when a needed step is missing; initialization now checks
only step legality and duplicates.
2026-08-19 20:31:31 +08:00
_Kerman e7d24de36c Merge pull request #2300 from deepseek-harness/feat/pwsh-persistent-pty
feat(pty): persistent pwsh over the PTY seam on Windows
2026-08-19 18:03:56 +08:00
_Kerman 917ef58f79 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2300 2026-08-19 17:09:18 +08:00
_Kerman 327b86d2ea refactor(session-projection): checkpoint every projection unit uniformly
Drop the persist?: boolean opt-in: every unit's state — client-visible and
host-only alike — is now written to the projection cache. A unit can no
longer silently skip the durable cache, host-only units no longer need an
explicit flag to participate in cold restore, and the persist-sharing
conflict check disappears with the field.

- ProjectionDefinition/ErasedDefinition lose persist; register overloads
  simplify; checkpoint/restoreFloor/restore fold every registered unit.
- Registry and cache tests drop the persist:true fixtures and the
  persistence-policy sharing test.
- READMEs and the state-and-client-views note record the uniform rule;
  cordis API catalog and subsystem signatures regenerated.
2026-08-19 16:55:10 +08:00
_Kerman 7d3ba2a85b Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2300 2026-08-19 15:39:30 +08:00
_Kerman ea35359b86 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2300 2026-08-19 15:12:21 +08:00
_Kerman e0984854a1 Merge remote-tracking branch 'github/master' into xtr/2701-stable-session-snapshots 2026-08-19 15:01:40 +08:00
_Kerman cb0747091b Merge remote-tracking branch 'origin/master' into xtr/projection-state-schema 2026-08-19 14:52:29 +08:00
_Kerman 571dba37cb Merge remote-tracking branch 'origin/master' into xtr/projection-state-schema 2026-08-19 14:50:24 +08:00
_Kerman ad94c35a77 docs: refresh config catalog source links 2026-08-19 14:40:23 +08:00
_Kerman 4729554c5b Merge remote-tracking branch 'github/master' into xtr/2701-stable-session-snapshots
# Conflicts:
#	examples/acp-agent/tests/acp.snapshot.ts
#	examples/acp-agent/tests/snapshots/code-mode-read-image/session.jsonl
#	examples/acp-agent/tests/snapshots/inline-image-prompt/session.jsonl
#	examples/acp-agent/tests/snapshots/read-image-dimension/session.jsonl
#	examples/acp-agent/tests/snapshots/read-image/session.jsonl
2026-08-19 14:35:52 +08:00
_Kerman da463ddebc refactor(subagent): normalize optional timing output 2026-08-19 14:34:00 +08:00
_Kerman e1a71c08bc fix(test): retain session fixture line diagnostics 2026-08-19 14:33:27 +08:00
_Kerman 9127d7e8b7 fix(session-projection): keep host state off wire 2026-08-19 14:32:48 +08:00
_Kerman f281933dde fix doc-site fence cache safety 2026-08-19 14:27:56 +08:00