Commit Graph

48 Commits

Author SHA1 Message Date
imccyu
ecbd8babc1 Merge remote-tracking branch 'origin/master' into mergebot/pr711
# Conflicts:
#	apps/cli/README.i18n.yaml
#	apps/cli/README.md
#	apps/cli/README.zh.md
#	apps/cli/cordis.yml
#	apps/cli/package.json
#	docs/config-catalog.md
#	packages/client/runtime/README.i18n.yaml
#	packages/client/runtime/src/client/contract/sessions.ts
#	packages/client/test-runtime/src/sessions.ts
#	packages/client/ui-workspace/README.i18n.yaml
#	packages/client/ui-workspace/README.md
#	packages/client/ui-workspace/README.zh.md
#	packages/client/ui-workspace/src/client/WorkspaceBrowser.tsx
#	packages/client/ui-workspace/src/client/tree.ts
#	packages/client/ui-workspace/tests/apply.spec.ts
#	packages/client/ui-workspace/tests/tree.spec.ts
#	packages/host/apiproxy/README.i18n.yaml
#	packages/host/apiproxy/src/api-proxy.ts
#	packages/host/apiproxy/src/api/index.ts
#	packages/host/apiproxy/tests/client-handler.spec.ts
#	packages/host/apiproxy/tests/rpc-schemas.spec.ts
#	pnpm-lock.yaml
2026-07-31 01:28:15 +08:00
Turtle
3c620a0cb6 Merge remote-tracking branch 'origin/master' into feature/shared-cli-config-foundation
# Conflicts:
#	docs/cordis-catalog/services.md
#	packages/host/apiproxy/README.i18n.yaml
2026-07-30 16:53:55 +08:00
Hypatia May
8527137230 refactor(session): rename the seed boundary to end-seed 2026-07-30 15:32:06 +08:00
Hypatia May
b341155652 feat(session): project the inherited-history boundary into the log
A plugin owning a standalone open/close bracket cannot tell a dead marker
from a live one: an unmatched `compact/start` reads identically whether the
previous writer died mid-compaction or a compaction is running now.
`Session.firstLiveSeq` already holds that answer exactly, but only in memory.

Append the log-only `session/inherited` event at that seq from the seeded
constructor — the single waist all six seeded-start paths pass through
(resume, configured startup on a persisted id, `sessions.fork()`, a subagent
fork child, `adopt()`'s live prefix, and a bare seeded `create`). Read it
through the new `isInheritedSeq(events, seq)`.

The constructor placement means persistence needs no changes: the marker is
already in `events` when a backend captures the creation seed, so it rides
the ordinary seed path with no load-time write. It also covers fork, where
the inherited bracket's owner may still be running — the case a
persistence-layer boundary could not reach.

Activity ordering excludes the boundary through `lastActivityTime()`, since
lazy resume makes browsing a pickup and the three call sites would otherwise
float every opened session to the top of a picker or list.
2026-07-30 11:39:26 +08:00
Hypatia May
61163b7da5 Merge remote-tracking branch 'origin/master' into codex/basic-session-search
Conflict resolutions:

- `session.list`: master's projection columns fold into the PR's cancellable,
  batched `listVisibleSessionSummaries`, which `session.search` shares as its
  visibility baseline; master's goal helpers stay beside it.
- Client sessions face: master narrowed `ctx.sessions` to `ISessions`, so the
  search verb and its protocol-constant bound are declared there and the
  test-runtime double implements them (recorded, empty page unless a scenario
  stubs hits).
- `WorkspaceBrowser`: master's per-row Rename wiring rides the PR's search
  results view; the tree keeps the PR's query-free derivations.
- `dsh web` bin: the PR's shutdown-handlers-before-readiness order with
  master's boot-time LAN address snapshot.
- `session-query-sqlite`: master's `SCHEMA_VERSION` 7 stands; the PR's bump
  carried no schema change.
- Specs: master wraps assistant/steering message payloads and requires an
  `application/json` carrier request, so the search fixtures and tests follow.
- Web aria goldens keep master's recording plus the PR's search placeholder;
  the navigation-panes inventory keeps master's terminal-card golden next to
  the PR's search-results golden.
2026-07-30 09:40:38 +08:00
Turtle
984830c940 fix(tui): isolate each process query index 2026-07-29 21:15:48 +08:00
xjt
de0348bd9e docs(i18n): standardize reviewed README headings 2026-07-29 20:16:45 +08:00
j-xiang
5bd49b1f0e docs(i18n): address final line audit 2026-07-29 16:53:53 +08:00
j-xiang
599e6edc87 docs(i18n): record proofread README pairs 2026-07-29 15:30:44 +08:00
j-xiang
f6c8fe4dcb docs(i18n): proofread README translations 101-120 2026-07-29 15:29:38 +08:00
Tianyi Cui
be23e5b2ac Merge latest master into subagent policy inheritance 2026-07-29 00:40:25 +08:00
imccyu
a79de44c3b feat(session-persistence): readFrom(seq) primitive for watermark tail reads
SessionPersistence grows readFrom(id, fromSeq, signal?): the non-mutating
read-from-seq primitive for checkpoint consumers (the persisted projection
cache folds only the tail past its watermark). Coordinator owns validation,
per-id serialization, and the sequential fallback (loadStored + forward
skip); SQLite implements the optional seek-capable loadStoredFrom hook
(WHERE seq >= ?), JSONL stays sequential by contract. Contract suite covers
suffix exactness, empty-tail, non-mutation, and cancellation; seam README
(both languages) documents the method and the hook.
2026-07-28 22:25:25 +08:00
Tianyi Cui
db0b43bf86 persistence: advance schemas after removing policy columns
The simplification deletes sandbox_mode and approval_policy from the parent branch's SQLite layouts. Restoring master's older version numbers would violate the monotonic schema contract and could make a database created by the parent look current under a different layout.

Advance durable session persistence from schema 11 to 12 and the disposable session-query index from 6 to 7. The former rejects the incompatible parent layout; the latter resets its derived tables through the existing version-mismatch path.

JSONL shares SESSION_FORMAT_VERSION 0 during pre-release, so explicitly reject the retired sandboxMode and approvalPolicy header fields instead of silently dropping the only inherited policy facts from a parent-produced child log. New logs carry those facts as ordinary seeded events.

Focused JSONL, SQLite persistence, and SQLite query suites cover all affected source lines and branches.
2026-07-28 21:40:51 +08:00
Tianyi Cui
cfceb8452b subagent: seed inherited policy events at creation
The parent implementation introduced sandboxMode and approvalPolicy as generic SessionHeader fields, then propagated those fields through both persistence backends, session-query indexes, collision checks, policy-specific seed-boundary folds, catalogs, and a broad test matrix. That storage plane is unnecessary: Session already accepts a validated constructor seed, and persistence captures that seed when the session is announced before committing its first batch.

Capture each parent override synchronously at delegation, append source-tagged sandbox/mode and approval/policy records after the optional fork prefix, and create the child with that combined seed. Keeping header.seedLength at the original fork-prefix length preserves lineage while ordinary last-event-wins folds make the inherited records outrank stale parent history and remain subordinate to later child switches. Unswitched parents still stamp nothing, so children continue to follow deployment defaults.

Remove the generic header fields and every persistence/query/schema branch built around them. Collapse the inheritance suite from ten leaking scenarios to four owned-context cases covering real filesystem confinement, stale fork precedence, delegation-time capture, and the no-override path. The assembled headless snapshot now asserts the persisted inheritance event directly.

This keeps the security behavior while restoring policy ownership to the existing event log and deleting the speculative durability machinery that the original tests did not exercise.
2026-07-28 21:31:17 +08:00
Tianyi Cui
afa38c4b2f Merge latest master into subagent policy inheritance
Retarget the feature branch to the current master tip without rewriting its existing review history. Keeping this as a dedicated merge checkpoint makes the later simplification diff attributable to the stacked child rather than mixing base movement with design changes.

Resolve the identified-message API drift in the feature tests by constructing complete user messages, reading the nested tool-result message shape, and adapting the prompt-submit listener signature. Preserve both sides of the user-approval conflict: master’s createUserMessage wrapper and the feature’s inherited-policy attribution.

Regenerate the Cordis and persistence catalogs, re-record the session README pair, and refresh the affected ACP/headless fixtures so derived artifacts describe the merged source rather than either parent in isolation.

Validated with the focused policy/session/persistence/query suites (430 tests), focused ACP/headless snapshots (3 tests), build, doc-sync (25 gates), lint, hygiene, and git diff checks.
2026-07-28 21:11:20 +08:00
_Kerman
fbf87e660c refactor: identify and freeze messages at creation 2026-07-28 13:55:59 +08:00
kingwl
bb16256782 refactor(session-query): share the header column bindings between both inserts
The baseline columns pushed the two INSERT binding lists past the clone
threshold; one _headerBindings helper now owns the shared header prefix
(the duplication gate's finding).
2026-07-27 18:57:03 +08:00
Hypatia May
4727d742db fix(web): align session search contracts 2026-07-27 18:38:00 +08:00
Hypatia May
0aa7f8c5cf fix(web): converge session search boundaries (round 9) 2026-07-27 14:46:08 +08:00
Hypatia May
ba2925c704 fix(web): converge search runtime boundaries (round 8) 2026-07-27 14:02:35 +08:00
Hypatia May
bd42204e53 fix(cli): keep search index ephemeral 2026-07-27 12:51:47 +08:00
kingwl
9aaa4a871f policy: reject out-of-range seed boundaries; carry baselines through session-query
Review fixes (ds-review-bot on #623):

- overrideOf (both knobs) rejects a seedLength past the log end before
  slicing: a malformed durable boundary would otherwise empty the
  own-switch slice until the log outgrew it, letting a wide baseline
  shadow a REAL later tightening. Malformed durable metadata fails loud,
  never open.
- The session-query derived index carries the two baseline fields end to
  end: schema columns on both session tables (SESSION_QUERY_SQLITE_SCHEMA
  _VERSION 6 — derived, rebuilds in place), inserts, header selects, the
  candidates CTE, rowHeader, sameHeader, and the cross-source
  assertSessionHeadersCompatible — so a search hit's header keeps the
  child's inherited confinement and conflicting live/persisted baselines
  reject.

Red-first: out-of-range seedLength tests in both policy suites;
baseline round-trip and live/persisted baseline-conflict tests in the
session-query sqlite suite.
2026-07-26 23:31:01 +08:00
Tianyi Cui
226dc7a249 docs: translate remaining READMEs 2026-07-26 05:06:39 +08:00
Hypatia May
ddac36e46e Merge remote-tracking branch 'origin/master' into session-query-tool
# Conflicts:
#	docs/architecture.i18n.yaml
#	docs/capability-seams.md
#	examples/acp-agent/composition.md
#	examples/acp-agent/cordis.yml
#	examples/acp-agent/tests/snapshots/model-switching/system-prompt.expected.md
#	examples/acp-agent/tests/snapshots/model-switching/tool-schemas.expected.json
#	examples/acp-agent/tests/snapshots/permission-switching/system-prompt.expected.md
#	examples/acp-agent/tests/snapshots/permission-switching/tool-schemas.expected.json
#	examples/acp-agent/tests/snapshots/plan-mode/system-prompt.expected.md
#	examples/acp-agent/tests/snapshots/plan-mode/tool-schemas.expected.json
#	packages/examples/acp-demo/README.md
#	packages/host/runtime/README.md
#	packages/support/acp-snapshot/src/normalize.ts
#	packages/support/acp-snapshot/tests/normalize.spec.ts
#	packages/ui/acp/tests/harness.ts
#	scripts/type-equiv.manifest.json
#	tsconfig.host.json
2026-07-25 14:17:24 +08:00
Hypatia May
224e00b2bd fix: quiesce cancelled session reconciliation 2026-07-24 21:27:07 +08:00
Hypatia May
66585635c8 fix: serialize paginated session searches 2026-07-24 19:47:23 +08:00
Hypatia May
6be11539e2 fix: bind session authorization to observations 2026-07-24 16:40:08 +08:00
Hypatia May
e54a4ad986 fix(sqlite): match reserved object names literally 2026-07-24 11:11:45 +08:00
Hypatia May
19b96037f6 fix(sqlite): enforce integer session metadata 2026-07-24 10:35:09 +08:00
Hypatia May
0e7fee95c0 fix(sqlite): preserve session metadata contracts 2026-07-23 22:08:58 +08:00
Hypatia May
712c84f06f fix(session-query): validate before service registration 2026-07-23 21:48:12 +08:00
Hypatia May
9482affc48 fix(session-query): make persisted observation non-mutating 2026-07-23 21:33:28 +08:00
Hypatia May
d24a875c5d fix(session-query): protect live reconciliation 2026-07-23 20:50:29 +08:00
Hypatia May
1c6d26c44d fix(session-query): fail mount when index open fails 2026-07-23 20:32:51 +08:00
Hypatia May
1e457b22e0 refactor(session-query): unify query service 2026-07-23 20:18:05 +08:00
Hypatia May
a2a89bf300 fix(session-query): protect derived index permissions 2026-07-23 19:36:05 +08:00
Hypatia May
0a0f19cf57 Merge remote-tracking branch 'origin/master' into session-query-search
# Conflicts:
#	.agents/notes/implemented/feature/2026-07-10-session-query-service.md
#	.agents/notes/implemented/feature/2026-07-10-sqlite-session-query-provider.md
#	.agents/notes/proposed/feature/2026-07-10-sqlite-session-query-provider.md
#	docs/architecture.md
#	docs/capability-seams.md
#	docs/config-catalog.md
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/core.md
#	docs/core-data-structures/persistence.md
#	docs/core-data-structures/session-query.md
#	docs/module-graph.md
#	docs/rfc/INDEX.md
#	packages/README.md
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/hooks/hooks-claude/tests/coverage.spec.ts
#	packages/session-persistence/session-persistence-jsonl/src/index.ts
#	packages/session-persistence/session-persistence-jsonl/tests/jsonl.spec.ts
#	packages/session-persistence/session-persistence-sqlite/README.md
#	packages/session-persistence/session-persistence-sqlite/src/index.ts
#	packages/session-persistence/session-persistence-sqlite/src/schema.ts
#	packages/session-persistence/session-persistence-sqlite/tests/sqlite.spec.ts
#	packages/session-persistence/session-persistence/README.md
#	packages/session-persistence/session-persistence/package.json
#	packages/session-query/README.md
#	packages/session-query/session-query/README.md
#	packages/session-query/session-query/package.json
#	packages/session-query/session-query/src/config.ts
#	packages/session-query/session-query/src/index.ts
#	packages/session-query/session-query/src/types.ts
#	pnpm-lock.yaml
#	scripts/gen-doc-graphs.ts
#	scripts/type-equiv.manifest.json
#	tsconfig.host.json
#	tsconfig.json
2026-07-23 13:56:56 +08:00
Hypatia May
e8abfd6482 fix(session-query): guard FTS predicate planning (round 7) 2026-07-17 11:13:03 +08:00
Hypatia May
f401528941 fix(session-query): preflight SQLite bindings (round 6) 2026-07-17 10:29:49 +08:00
Hypatia May
220076e5e2 fix(session-query): preserve typed query failures (round 5) 2026-07-17 10:15:48 +08:00
Hypatia May
75e9958f11 fix(session-query): close review edge cases (round 4) 2026-07-17 09:39:39 +08:00
Hypatia May
92fd92fa69 test(session-query): name binding retry precisely (round 3) 2026-07-16 14:12:50 +08:00
Hypatia May
de863aab9a fix(session-query): release stale persistence binding (round 2) 2026-07-16 14:04:49 +08:00
Hypatia May
4505c6c55a refactor(session-query): simplify persistence binding (round 1) 2026-07-16 13:55:23 +08:00
Hypatia May
aa82ba4abc Merge remote-tracking branch 'origin/master' into session-query-search
# Conflicts:
#	docs/config-catalog.md
#	docs/cordis-catalog/services.md
#	docs/module-graph.md
#	packages/session-persistence/session-persistence-jsonl/README.md
#	packages/session-persistence/session-persistence-jsonl/src/index.ts
#	packages/session-persistence/session-persistence-sqlite/README.md
#	packages/session-persistence/session-persistence-sqlite/src/index.ts
#	packages/session-persistence/session-persistence-sqlite/src/schema.ts
#	packages/session-persistence/session-persistence-sqlite/tests/sqlite.spec.ts
#	packages/session-persistence/session-persistence/README.md
#	packages/session-persistence/session-persistence/src/coordinator.ts
#	packages/session-persistence/session-persistence/tests/persistence.spec.ts
#	packages/session-query/session-query/README.md
2026-07-15 16:17:59 +08:00
Hypatia May
35edf2a825 fix(session-query): qualify persistence revisions by store 2026-07-15 12:32:18 +08:00
Hypatia May
f88ca85ffd fix(session-query): harden SQLite search reconciliation 2026-07-15 12:10:24 +08:00
Hypatia May
ecf90ff382 feat(session-query): add SQLite full-text search 2026-07-15 10:51:38 +08:00