Commit Graph

214 Commits

Author SHA1 Message Date
kingwl
49a4ebd4bc persistence: include the seed boundary in the adoption policy-identity check
Review fix (ds-review-bot on #623): matching baselines with differing
seedLength still resolve different policies — overrideOf folds own switches
past the boundary, so a stored seedLength: 1 marks event 0 as subsumed seed
history while a live seedLength: 0 lets the same event tighten the session;
adoption retained the stored header and a restart silently restored the
wide baseline. When either side carries a baseline, the seed boundary is
part of the policy identity and a mismatch rejects as an id collision.
Red-first in the shared coordinator contract (both backends).
2026-07-27 00:16:54 +08:00
kingwl
290e1acc45 policy: guard adoption baselines, resolve-time validation, and inherited-delta narration
Review fixes (ds-review-bot on #623):

- Persistence adoption compares the immutable policy baselines: onCreated's
  ownerless claim and adoptLivePrefix retain the STORED header, so a
  same-id live session with a conflicting baseline now rejects as a
  collision instead of appending under read-only and resuming under the
  stored danger-full-access.
- resolve() resolves the session override BEFORE applying an explicit
  approved mode: the one-shot grant no longer bypasses the unconditional
  durable-header validation.
- The approval narrator attributes positionally over the session's OWN
  events (past the seed boundary): a fork child whose baseline delta has
  no own override narrates 'inherited from the delegating session' instead
  of misattributing a stale seed-carried switch to the user or the
  operator.

Red-first: baseline-conflict adoption in the shared coordinator contract
(both backends), resolve-with-explicit-mode validation, and the fork-child
narration attribution case.
2026-07-26 23:56:41 +08:00
kingwl
ffb6435a41 test(session): cover the header baseline validation and persistence round-trip
CI per-file coverage flagged the new sandboxMode/approvalPolicy branches:
invalid-type cases in both session header validation tables, and a shared
persistence-contract case pinning that both backends round-trip the
baselines verbatim and keep absent fields ABSENT (presence is the signal
the policy owners branch on).
2026-07-26 19:30:27 +08:00
kingwl
c53e9c90db subagent: carry inherited policy overrides in the child session header
Review fix (ds-review-bot critical #2 on #623): the first-turn event stamp
had a durability hole no turn anchoring can close — an idle SessionStart-
style injection persists a complete one-shot turn before any prompt turn
opens, so a crash in that window left a resumable-looking child with no
inherited policy, falling back to a possibly wider deployment default.

The captured overrides now ride the child's creation meta into its
immutable SessionHeader (sandboxMode/approvalPolicy, neutral strings at the
session boundary — the delegationDepth precedent), durable from the moment
the session exists: no listener ordering can starve the baseline and no
crash window can lose it. overrideOf(session) on both policy services
resolves fold(events past header.seedLength) ?? header baseline, validating
against the closed vocabulary on read; stampOverride and the prompt-submit
listener machinery are deleted. The header field rides both persistence
backends (JSONL header line; SQLite sessions columns, SCHEMA_VERSION 11 —
pre-release, no migration). pty-local reads through overrideOf so PTY
spawns see the baseline too.

Red-first: header-durability-before-any-turn test (the injection crash
window shape), baseline/seed-boundary/closed-vocabulary contract tests in
both service suites; the real-wall suite (race, veto, fork stale-seed,
grandchild) re-anchored on header assertions and green. The Agent Note's
Alternatives now records the superseded event-stamping iteration with the
review evidence; bilingual docs updated.
2026-07-26 18:16:45 +08:00
Tianyi Cui
226dc7a249 docs: translate remaining READMEs 2026-07-26 05:06:39 +08:00
Hypatia May
7cf5b08d07 Merge remote-tracking branch 'origin/master' into session-query-tool
# Conflicts:
#	docs/core-data-structures/persistence.i18n.yaml
#	packages/session-persistence/session-persistence-jsonl/src/index.ts
2026-07-25 15:43:45 +08:00
Tianyi Cui
8a7bb03aab fix(persistence): reconcile project session layout 2026-07-25 15:11:17 +08:00
Tianyi Cui
c09397f833 Merge branch 'master' into codex/session-directory-layout 2026-07-25 14:53:20 +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
Tianyi Cui
f9a638b8a6 Stabilize master CI across platforms 2026-07-25 00:10:37 +08:00
Turtle
1ffdacb2c4 fix(jsonl): handle filesystem path aliases 2026-07-24 21:50:11 +08:00
Hypatia May
224e00b2bd fix: quiesce cancelled session reconciliation 2026-07-24 21:27:07 +08:00
Turtle
c14f488b00 fix(persistence): use normalized project directory names 2026-07-24 21:15:53 +08:00
Tianyi Cui
46dfd503e0 Merge origin/master into codex/sqlite-metadata-contracts 2026-07-24 21:07:23 +08:00
Hypatia May
cbc6d81fc3 Merge remote-tracking branch 'origin/master' into session-query-tool
# Conflicts:
#	docs/architecture.i18n.yaml
2026-07-24 20:59:18 +08:00
Turtle
4e295221f3 refactor(persistence): group sessions in project directories 2026-07-24 19:52:47 +08:00
Hypatia May
fec4ce52cc fix: batch cancellable title reads 2026-07-24 18:13:11 +08:00
Turtle
bb124c2869 Merge branch 'master' into feat/send-unify 2026-07-24 16:31:00 +08:00
Turtle
b02b438667 refactor(agent): align delivery method names 2026-07-24 15:08:36 +08:00
Hypatia May
dc2ea3a1b4 fix(sqlite): lock before ownership validation 2026-07-24 11:20:47 +08:00
Hypatia May
e54a4ad986 fix(sqlite): match reserved object names literally 2026-07-24 11:11:45 +08:00
Hypatia May
352934b9ec fix(jsonl): reject negative-zero timestamps 2026-07-24 11:01:08 +08:00
Hypatia May
19b96037f6 fix(sqlite): enforce integer session metadata 2026-07-24 10:35:09 +08:00
Hypatia May
3b3a7232a7 Merge remote-tracking branch 'origin/master' into codex/sqlite-metadata-contracts 2026-07-24 09:48:06 +08:00
Tianyi Cui
f27f8f6162 Merge commit 'refs/codex-unblock/20260723/pr570-master-initial' into worktree/pr570-merge-master-20260723
# Conflicts:
#	.agents/notes/implemented/architecture/2026-06-18-shared-persistence-write-coordinator.md
#	docs/core-data-structures/persistence.md
#	packages/session-persistence/session-persistence/README.md
2026-07-23 23:21:08 +08:00
Hypatia May
0e7fee95c0 fix(sqlite): preserve session metadata contracts 2026-07-23 22:08:58 +08:00
Hypatia May
9482affc48 fix(session-query): make persisted observation non-mutating 2026-07-23 21:33:28 +08:00
_Kerman
c596dddfe1 fix: return stored metadata from live loads 2026-07-23 21:28:52 +08:00
Hypatia May
c1fa985c20 Merge remote-tracking branch 'origin/master' into session-query-search
# Conflicts:
#	docs/architecture.i18n.yaml
#	packages/client/ui-sidebar/tests/sidebar-root.spec.tsx
#	packages/session-persistence/session-persistence-jsonl/src/index.ts
#	packages/session-persistence/session-persistence/README.md
2026-07-23 21:13:29 +08:00
_Kerman
4e5166828b fix: reserve cold loads across repair 2026-07-23 20:58:20 +08:00
_Kerman
816907ba2d Merge remote-tracking branch 'origin/master' into refactor/eager-session-persistence
# Conflicts:
#	.agents/notes/implemented/architecture/2026-06-18-shared-persistence-write-coordinator.md
#	packages/session-persistence/session-persistence-jsonl/README.md
#	packages/session-persistence/session-persistence/src/coordinator.ts
#	packages/session-persistence/session-persistence/tests/persistence.spec.ts
2026-07-23 20:32:19 +08:00
_Kerman
d0e5987c4a fix: serialize persistence ownership selection 2026-07-23 20:24:27 +08:00
Tianyi Cui
a5cb16cc0e Merge master into codex/jsonl-storage-identity 2026-07-23 20:12:26 +08:00
_Kerman
e5d16d5e58 fix: close eager persistence races 2026-07-23 19:55:52 +08:00
_Kerman
d2fcf385e8 test: cold-load persisted session metadata 2026-07-23 19:27:37 +08:00
_Kerman
7f5ba286fe fix: keep crash repair away from live sessions 2026-07-23 18:31:37 +08:00
_Kerman
406c82d1a7 refactor: eagerly persist session events 2026-07-23 17:57:26 +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
Tianyi Cui
3d9240e423 Merge refreshed schema DSL into canonical tool outputs 2026-07-22 22:46:10 +08:00
Tianyi Cui
b0f5d9e313 Merge commit 'refs/codex-unblock/20260722-pr338-master' into HEAD
# Conflicts:
#	docs/event-producer-consumer.md
#	examples/acp-agent/tests/acp.snapshot.ts
#	packages/core/session/src/index.ts
#	packages/examples/acp-demo/src/index.ts
#	packages/session-persistence/session-persistence-jsonl/src/format.ts
#	vitest.config.ts
2026-07-22 22:37:16 +08:00
Tianyi Cui
8930a63b18 Merge refreshed schema DSL into canonical tool outputs
# Conflicts:
#	docs/event-producer-consumer.md
2026-07-22 22:28:50 +08:00
Tianyi Cui
ecb77f5e0c test(ci): stabilize cancellation and crash checkpoints 2026-07-22 22:14:14 +08:00
Tianyi Cui
2478ef7d6d Merge master into worktree/semantic-session-checkpoints 2026-07-22 20:50:46 +08:00
Tianyi Cui
842164553d fix(plan): reject legacy mode events on load 2026-07-22 17:25:25 +08:00
kingwl
3922e956db Merge remote-tracking branch 'origin/master' into jsonl-packed-chunk-rows
Master removed the stdio demo (#702c8cc30) — accept the deletion; this
branch's packChunks passthrough survives in acp-demo (auto-merged), and
cli-demo/tui-demo arrived from master without one (the follow-up snapshot
PR decides which demos expose the switch). Generated catalogs regenerated
over merged sources; the hand-written session.md durability paragraph
re-weaves this branch's lossless-encoding wording with master's invariant-
companion sentence.
2026-07-22 15:46:12 +08:00
Yichen Jiang
a5302d4d64 Merge remote-tracking branch 'origin/master' into worktree/semantic-session-checkpoints
# Conflicts:
#	packages/session-persistence/session-persistence-jsonl/README.md
2026-07-22 10:54:08 +08:00
Tianyi Cui
ac86055020 Merge commit 'refs/private/gh-unblock-approved-prs/master' into HEAD
# Conflicts:
#	packages/session-persistence/session-persistence-jsonl/README.md
#	packages/session-persistence/session-persistence-jsonl/src/index.ts
2026-07-22 10:35:08 +08:00
Yichen Jiang
28b358650b Merge remote-tracking branch 'origin/master' into worktree/semantic-session-checkpoints
# Conflicts:
#	docs/architecture.md
#	docs/event-producer-consumer.md
#	examples/acp-agent/tests/snapshots/cancel-tool-calls/session.jsonl
#	packages/core/agent-loop/README.md
#	packages/core/agent-loop/src/loop.ts
#	packages/core/agent-loop/tests/cancel.spec.ts
2026-07-22 10:29:09 +08:00
Tianyi Cui
0517d74875 test(persistence): use stored-prefix lookup 2026-07-22 00:03:23 +08:00
Tianyi Cui
53615c91e7 Merge master into worktree-windows-runtime 2026-07-21 23:39:14 +08:00