Commit Graph
104 Commits
Author SHA1 Message Date
imccyu 26ac56f780 chore(release): align master-only packages to 0.2.2-rc.5 2026-11-18 18:29:39 +08:00
liukx0205 6bdb072fbf test(session): cover SQLite group commits and failure isolation 2026-11-18 15:20:49 +08:00
liukx0205 9340e56c4a perf(session): commit concurrent SQLite batches as one group
Each appended batch queues for the next group commit; the yield before a
group lets batches other writers append in the same turn share one
transaction, so a checkpoint costs one commit and one fsync per group
instead of per writer, and the synchronous transaction is bounded by an
event cap. A batch failing on its own terms rolls back to its savepoint
and rejects alone; an error that ends the transaction rejects the group.
2026-11-18 15:20:49 +08:00
liukx0205 55e96102ec fix(session): yield the event loop after each SQLite commit
A writer that checkpoints step after step runs its whole append path on
settled promises and a synchronous transaction, so the process never
returns to the I/O phase: timers, other writers waiting on a lease, and
the UI starve until the writer stops. Yielding once per commit bounds
that stall to one commit.
2026-11-18 03:43:28 +08:00
imccyu 7400626e6e chore(release): sync release/dsh-0.2.2 0.2.2-rc.4 to master
# Conflicts:
#	packages/client/hmr/package.json
#	packages/client/script-realm-iframe/package.json
#	packages/client/ui-jobs/package.json
#	packages/client/ui-session-panel/package.json
#	packages/experimental/action-cards/package.json
#	packages/experimental/client-ui-forge/package.json
#	packages/experimental/cua-bundle/package.json
#	packages/experimental/forge-gitlab/package.json
#	packages/ptc-runtime/ptc-runtime-node/package.json
#	packages/session/tool-working-directory/package.json
#	packages/util/atomic-write/package.json
2026-11-17 21:37:34 +08:00
liukx0205 d16104bd9a test(session): cover SQLite frame storage and document its settings
Fixtures construct the store with the plugin's frame defaults and read
durable history through frames; existing tests query the frames table
and its triggers. New tests cover the frame codec, frame layout per
write and per setting, sliced reads across frame boundaries, decode
grouping, and the corruption refusals for a missing frame, a frame
shorter than its range, an unknown codec, and damaged bytes.

The SQLite README, the persistence subsystem page and the generated
configuration catalog describe `frameEvents` and the frame encoding
selected by `compression`.
2026-11-17 18:00:51 +08:00
liukx0205 64c574c0e2 feat(session): make the SQLite frame size a plugin setting
The SQLite plugin validates its own Config: the JSONL fields plus
frameEvents, the maximum events per new frame, defaulting to 64. Imported
histories reach the cap; larger frames compress a few percent better and cost
proportionally more to decode for a tail read.
2026-11-17 18:00:51 +08:00
liukx0205 cc93a902a0 perf(session): select SQLite frame compression by config and decode frames concurrently
The plugin's compression setting now also selects the physical encoding of
new frames: zstd compresses a frame when that shrinks it, none stores the
text. Stored frames decode by their own codec. A read decodes eight frames
at a time on the thread pool and yields between groups.
2026-11-17 18:00:51 +08:00
liukx0205 ac2e505c35 chore(session): keep the SQLite schema version at 1 for the unreleased store 2026-11-17 18:00:51 +08:00
liukx0205 ddd1850920 perf(session): store SQLite events as compressed frames
Each durable write stores one frame of JSON lines, Zstandard-compressed when
that is smaller than the UTF-8 text, in a rowid table keyed by Segment and
start sequence; the Segment event count is the last frame's end. Reads select
the frames overlapping the requested range and decode their slices, yielding
between frames. The schema version advances to 2; a version 1 database is
refused as before.
2026-11-17 18:00:51 +08:00
Kexin Liu e50e24de40 feat(session): 等父前缀持久化后创建共享 fork (#8392)
* test(session): cover SQLite persistence and document the provider

* test(session): align coverage with the latest SQLite implementation

* test(session): adapt storage coverage to the current SQLite backend

* feat(session)!: pass fork source through agent creation

* refactor: prepare forks privately and append child segment events

* refactor: choose fork sharing in SQLite creation transaction

* fix(session): preserve caller-prepared fork seeds

* feat(session): flush fixed fork prefix before child creation

* fix(session): persist fork sources and await parent drain

* chore: remove test and documentation changes from fork PR

* refactor(agent-loop): reuse agent fork source type

* fix(session): retain SQLite handle and JSONL errors after rebase

* perf(session): create forks from the caller's history without reloading the parent

The fork source carries the complete child history from seq 0. A live
parent's log supplies the shared prefix; a cold parent's prefix is used as
persistence returned it to the caller. The factory no longer reopens the
parent, and the JSONL backend copies the supplied history instead of
decoding the parent log again. The SQLite backend drains a live parent
writer before sharing its persisted prefix, so the factory no longer flushes
the parent or tracks owner disposal during that wait; its fork creation
serializes child events without the read-side validation and reports
publication failures through the shared wrapper.

* refactor(session-query): report the persisted prefix length on live observations

A live observation reports its event count as the persisted prefix, so the
fork command's boundary fallback only covers observations from other
producers.

* test(session): exclude the SQLite POSIX lease from Windows coverage

The SQLite copy of the session write lease executes its POSIX face only off
Windows, matching the JSONL exclusion.

* test(session): report legacy opener failures on stderr

The two-process suite asserts only the error name; the message and cause now
reach the inherited stderr so a CI failure identifies the SQLite error.

* refactor(agent): keep seed as the constructor input and narrow the fork source

CreateAgentOptions.seed stays the only constructor history; source names the
parent and cut a seeded fork shares. The factory stores the constructed log
with that source at creation, so no fork-only seed selection remains in the
loop.

* test(session): complete fork regressions and documentation

* test(session): propagate current SQLite fixtures through fork regressions

* test(session): describe fork creation from the caller's history

The fork source now carries the complete child history and the factory no
longer reopens or flushes the parent, so the fake factories, source
expectations, and cancellation cases follow that flow: a sharing backend
drains the parent writer itself, JSONL copies the supplied history, and
observations always report the persisted prefix. Documentation, the upgrade
guide, and the generated catalogs describe the same behavior.

* test(session): cover fork creation without a factory flush

The in-process fork provider's cases no longer wait for a parent flush: the
live log supplies the completed prefix and cancellation is exercised while
child storage is pending. The Remote fork command's boundary fallback is
covered by an observation that omits its persisted count.

* test(session): drop redundant observation assertions in the fork fallback case

* test(session): describe fork creation with seed beside a parent source

The agent factory keeps seed as the constructor history and source names
only the parent and cut, so the fakes, source expectations, and documentation
follow that split; the case where a live parent replaced the supplied prefix
no longer applies.

* refactor(session): name the fork parent option parentSource

`CreateAgentOptions.source` and `SessionPersistenceCreateOptions.source`
become `parentSource`: the field names the parent Session a seeded fork
shares its prefix with, and the shorter name read as a generic origin.

* refactor(session-query): report persistedEventCount on cold observations only

A live observation holds the Session's own events, none of them read-time
repairs, so its stored prefix is its whole log and the field said nothing;
only a cold read appends interrupted-turn closers in memory and needs to
tell the fork cut where the stored prefix ends.
2026-11-17 17:28:59 +08:00
Dudu-0223 7b1553c31f fix(session): retry contended SQLite WAL initialization 2026-11-17 16:13:30 +08:00
liukx0205 2be76f92a2 test(session): report legacy opener failures on stderr
The two-process suite asserts only the error name; the message and cause now
reach the inherited stderr so a CI failure identifies the SQLite error.
2026-11-16 14:41:50 +08:00
liukx0205 107cc67d9d test(session): adapt storage coverage to the current SQLite backend 2026-11-16 14:41:50 +08:00
liukx0205 fa1fe0dc4a test(session): align coverage with the latest SQLite implementation 2026-11-16 14:41:50 +08:00
liukx0205 9e0c4674b0 test(session): cover SQLite persistence and document the provider 2026-11-16 14:41:50 +08:00
liukx0205 968b78e6f7 fix(session): list SQLite plugin locale files in the required order 2026-11-15 03:14:30 +08:00
liukx0205 4df3740c2f fix(session): publish SQLite plugin locale metadata 2026-11-15 01:47:29 +08:00
liukx0205 2839c3532c refactor(session): name SQLite persistence classes after their roles
SqliteSessionPersistence, SqliteStore, and SqliteSessionHandle mirror the
JSONL backend's class names; Trace and Segment stay storage-internal terms.
2026-11-15 01:42:35 +08:00
liukx0205 ed2b030a84 refactor(session): share SQLite routing checks and record validation
One ENOENT helper, one routing-database check owned by the store, one
routing-record reader that validates identity, and one publication failure
wrapper replace the copies spread across the store and the service.
2026-11-15 01:42:35 +08:00
liukx0205 92d1100c24 refactor(session): keep SQLite Segment storage without pending-fork wiring
Fork creation lands with its own creation flow; the pending-create fork
record, handle cut offsets, and seed marker checks that flow would replace
are removed. The Segment schema stays, and cut() locates a fork attachment
through the segment_ancestors index instead of walking the parent chain.
The new schema starts at version 1, and the busy timeout and live batching
limits are named constants.
2026-11-15 01:42:35 +08:00
liukx0205 16180383ca perf(session): trim SQLite write validation, listing reads, and open prechecks
Write paths serialize already-typed in-process events without re-running the
read-side envelope validation. Listing checks routing records by their hashed
file names instead of reading each one and scans SQLite concurrently with the
JSONL listing. Reads decode long histories in yielding chunks. Create checks
only the retained JSONL identity before SQLite's own existence check, and a
queued legacy open no longer repeats the routing check its caller just made.
2026-11-15 01:42:34 +08:00
liukx0205 0d13ccf03b perf(session): reduce SQLite persistence overhead 2026-11-15 01:42:34 +08:00
liukx0205 4bd6b6882e refactor(session): trim persistence internals 2026-11-15 01:42:34 +08:00
liukx0205 69cec93294 chore(session): exclude documentation from storage PR 2026-11-15 01:42:34 +08:00
liukx0205 669c1ceaab refactor(session): separate persistence plugin entrypoints 2026-11-15 01:42:34 +08:00
liukx0205 0d8fbdd956 chore(session): narrow storage PR to implementation 2026-11-15 01:42:34 +08:00
liukx0205 86ecc66742 fix(session): enable WAL before publishing SQLite schema 2026-11-15 01:42:16 +08:00
liukx0205 b467fa6ee5 fix(session): keep SQLite storage opt-in 2026-11-15 01:41:54 +08:00
liukx0205 1347262dcb fix(session): register persistence synchronously before database initialization 2026-11-15 01:41:29 +08:00
liukx0205 ebf98e1f2a docs: update SQLite upgrade guide links 2026-11-15 01:41:29 +08:00
liukx0205 60177171c7 fix(ci): align release version and session smoke fixtures 2026-11-15 01:41:28 +08:00
liukx0205 7ecfef7473 fix(session): repair SQLite CI fixtures and failure coverage 2026-11-15 01:41:28 +08:00
liukx0205 2f6def1164 fix(session): retain JSONL migration and update profile acceptance tests 2026-11-15 01:41:28 +08:00
liukx0205 e9ff4c7091 docs(session): document SQLite storage and refresh catalogs 2026-11-15 01:41:28 +08:00
liukx0205 f798414231 fix(session): coordinate legacy reads and retain closing live events 2026-11-15 01:38:51 +08:00
liukx0205 1dd3ed37d1 refactor(session): move persistence coordination into SQLite package 2026-11-15 01:38:51 +08:00
liukx0205 75b3dbc9d8 fix(session): retain JSONL internals and remove SQLite plugin settings 2026-11-15 01:38:51 +08:00
liukx0205 d67adbfac7 refactor(session): keep SQLite private and simplify initialization 2026-11-15 01:38:51 +08:00
liukx0205 a3c870e3e4 feat(session)!: use SQLite and import legacy JSONL on open 2026-11-15 01:38:51 +08:00
Tianyi Cui 4553c9d957 refactor(session)!: remove SQLite persistence backend 2026-08-31 13:23:07 +08:00
imccyu 3f1b46a5db release(dsh): 0.1.2-alpha.2 2026-08-30 21:19:29 +08:00
Tianyi Cui 2c6ff296af Revert "Merge pull request #3087 from deepseek-harness/worktree/remove-ignorable-session-events"
This reverts commit 2123b2f418b1c8fbb86dc327b598fb11423da226, reversing
changes made to 3c0b5c68ce697537a21084f9135663017474a2e1.
2026-08-30 12:26:20 +08:00
imccyu b27c8fbc02 chore(deps): refresh package manifests 2026-08-30 02:29:53 +08:00
imccyu 9135a13a8b refactor(consumers): remove cross-package runtime relays 2026-08-30 02:29:52 +08:00
imccyu 6c705be1ce release(dsh): 0.1.2-alpha.1 2026-08-28 00:50:12 +08:00
Yichen Jiang 5661b7a972 Merge pull request #3110 from deepseek-harness/worktree/fix-question-drafts-session-switch
fix(web): preserve ask_user_question drafts across Sessions
2026-08-26 16:10:37 +08:00
Magolor df76bc695b feat(session): reduce persistence storage size (#3048) 2026-08-26 08:01:07 +00:00
Yichen Jiang 4e1c87b1a2 fix(ci): bound Windows process contention 2026-08-26 14:24:24 +08:00
_Kerman d3dd816d67 Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2731
# Conflicts:
#	packages/util/brand/README.i18n.yaml
#	packages/util/brand/README.md
#	packages/util/brand/README.zh.md
2026-08-26 10:35:38 +08:00