Commit Graph
118 Commits
Author SHA1 Message Date
xjt de0348bd9e docs(i18n): standardize reviewed README headings 2026-07-29 20:16:45 +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 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 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 fec4ce52cc fix: batch cancellable title reads 2026-07-24 18:13:11 +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 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
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 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
Tianyi Cui a5cb16cc0e Merge master into codex/jsonl-storage-identity 2026-07-23 20:12:26 +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
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
Tianyi Cui 53615c91e7 Merge master into worktree-windows-runtime 2026-07-21 23:39:14 +08:00
Tianyi Cui ec1e1394ed Merge commit 'refs/codex/unblock/master-current' into HEAD
# Conflicts:
#	docs/config-catalog.md
#	packages/session-persistence/session-persistence-jsonl/README.md
#	packages/session-persistence/session-persistence-jsonl/src/index.ts
#	packages/session-persistence/session-persistence-jsonl/tests/jsonl.spec.ts
2026-07-21 20:28:30 +08:00
Yichen Jiang 8ce5989ffb Merge remote-tracking branch 'origin/master' into worktree/semantic-session-checkpoints
# Conflicts:
#	docs/event-producer-consumer.md
#	docs/module-graph.md
#	examples/tui-agent/tests/tui-keyless-smoke.e2e.ts
#	packages/examples/acp-demo/package.json
#	packages/examples/cli-demo/tsconfig.json
#	packages/support/invariants/src/index.ts
#	packages/support/invariants/tests/invariants.spec.ts
#	pnpm-lock.yaml
2026-07-21 20:09:37 +08:00
Yichen Jiang 6d12e3ab41 fix(session): add semantic crash checkpoints 2026-07-21 14:50:06 +08:00
Tianyi Cui 78eb93f7e6 Merge branch 'master' into worktree-windows-runtime 2026-07-20 20:39:13 +08:00
Tianyi Cui 8ee54bcb22 Merge latest invariant registration gate
# Conflicts:
#	docs/event-producer-consumer.md
2026-07-20 20:20:10 +08:00
Tianyi Cui 5f806b96f0 Merge latest invariant service seam 2026-07-20 20:19:14 +08:00
Tianyi Cui 1145ee5fc3 fix(invariants): assert runtime relationships, not API shapes 2026-07-20 19:34:19 +08:00
Tianyi Cui 3b7ce2e682 fix(invariants): require justified empty companions 2026-07-20 18:39:37 +08:00
Tianyi Cui 73e3f658c6 fix(persistence): bind JSONL identity before mutation
JSONL discovered a log by the requested session id but later routed repair and append from the parsed header. A log selected for session A could therefore declare session B and redirect mutation to B.

Validate the requested id and exact header-derived cwd-bucket path before returning a stored prefix, reject duplicate ids across buckets, and repeat the id/cwd guards in the coordinator before repair or state publication. Collapse the redundant loadLive hook into loadStored while retaining the existing bucket layout and one-live-writer topology, avoiding flat-layout churn and a locator generic that SQLite and test backends do not need.
2026-07-20 17:42:44 +08:00
Yichen Jiang f2a813b791 Merge remote-tracking branch 'origin/master' into fix/subagent-depth-budget 2026-07-20 15:15:31 +08:00
Tianyi Cui 684fcf3357 Merge branch 'codex/invariant-package-registration-gate' into codex/package-invariant-checks
# Conflicts:
#	.agents/notes/implemented/architecture/2026-07-19-package-invariant-runtime-contracts.i18n.yaml
#	.agents/notes/implemented/architecture/2026-07-19-package-invariant-runtime-contracts.md
#	.agents/notes/implemented/architecture/2026-07-19-package-invariant-runtime-contracts.zh.md
#	.agents/notes/implemented/architecture/2026-07-19-package-owned-invariant-service.i18n.yaml
#	docs/rfc/INDEX.md
#	packages/AGENTS.md
2026-07-20 00:54:28 +08:00
Tianyi Cui 941b0411d8 feat(invariants): implement package runtime checks 2026-07-20 00:38:37 +08:00
Tianyi Cui 6520f71f94 Merge remote-tracking branch 'origin/codex/invariant-service-seam' into codex/invariant-package-registration-gate
# Conflicts:
#	.agents/notes/implemented/architecture/2026-07-19-package-owned-invariant-service.i18n.yaml
#	docs/core-data-structures/session.md
#	docs/module-graph.md
#	package.json
#	packages/sdk/scripts/tsconfig.json
2026-07-20 00:35:06 +08:00
Tianyi Cui e8eddc7ef8 Rename RFCs to Agent Notes 2026-07-19 22:52:03 +08:00
Tianyi Cui 433670a754 feat(invariants): require package-owned companions 2026-07-19 22:13:50 +08:00
imccyu 6eabba8021 Merge branch 'master' into worktree-windows-runtime 2026-07-19 21:08:12 +08:00
Tianyi Cui a278374e8f docs: structure model experience fields 2026-07-19 18:08:42 +08:00
Tianyi Cui bcc920369c docs: document package KV cache effects 2026-07-19 17:39:50 +08:00
Yichen Jiang 0d00106fa8 fix(session): persist the delegation depth in the session header
A subagent child's recursion depth lived only in runtime AgentOptions,
so a persisted child came back from resume counted as top-level and
maxDepth stopped binding after every restart. Add
SessionHeader.delegationDepth, round-trip it through the JSONL and
SQLite backends (SQLite schema v5), restore it on agent-loop resume,
and write it when the in-process backends create a child. The seam now
owns the shared depth vocabulary (delegationDepthOf): the persisted
header is authoritative and monotone — runtime options may deepen it
but never lower it.
2026-07-19 17:20:36 +08:00
Tianyi Cui a61b725a20 Merge remote-tracking branch 'origin/master' into codex/pr335-merge-master-20260719 2026-07-19 13:30:10 +08:00
Tianyi Cui ddd3370477 test(session-persistence): pin rollback journal permissions 2026-07-19 12:12:16 +08:00