Commit Graph

966 Commits

Author SHA1 Message Date
Tianyi Cui
440384fdb4 Merge remote-tracking branch 'origin/master' into worktree/acp-automation-protocol
# Conflicts:
#	.agents/notes/implemented/architecture/2026-06-14-session-persistence.md
#	.agents/notes/implemented/architecture/2026-06-20-package-hierarchy.md
#	.agents/notes/implemented/architecture/2026-07-02-tool-render-intent-union.md
#	.agents/notes/implemented/feature/2026-06-14-acp-agent-client-protocol.md
#	.agents/notes/implemented/feature/2026-06-14-acp-multi-session.md
#	.agents/notes/implemented/feature/2026-06-18-acp-terminal-and-tool-rendering.md
#	.agents/notes/implemented/feature/2026-07-19-model-facing-goal-tools.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-19-model-facing-goal-tools.md
#	.agents/notes/implemented/feature/2026-07-19-model-facing-goal-tools.zh.md
#	.agents/notes/implemented/simplification/2026-07-04-trim-acp-bridge-unreachable-surface.md
#	docs/architecture.i18n.yaml
#	docs/cookbook/extension-cookbook.i18n.yaml
#	docs/cookbook/extension-cookbook.md
#	docs/cookbook/extension-cookbook.zh.md
#	docs/core-data-structures/approval.md
#	docs/core-data-structures/user-interaction.md
#	docs/event-producer-consumer.md
#	docs/persistence-catalog.md
#	docs/testing.md
#	docs/tool-catalog.md
#	examples/acp-agent/tests/fixtures/live-mode-switching-2026-07-07.session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
#	examples/acp-agent/tests/snapshots/permission-switching/session.jsonl
#	packages/goal/tool-goal/README.md
#	packages/ui/acp/README.md
#	packages/ui/acp/acp-feature-support.md
#	packages/ui/acp/src/index.ts
#	packages/ui/acp/tests/bridge.spec.ts
#	packages/ui/acp/tests/dispose.spec.ts
#	packages/ui/acp/tests/edges.spec.ts
#	packages/ui/acp/tests/turns.spec.ts
2026-07-24 23:43:10 +08:00
Tianyi Cui
46dfd503e0 Merge origin/master into codex/sqlite-metadata-contracts 2026-07-24 21:07:23 +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
Tianyi Cui
b01fc33492 Merge remote-tracking branch 'origin/feat/send-unify' into worktree/agent-message-intents
# Conflicts:
#	.agents/notes/implemented/architecture/2026-07-22-unified-send-and-coalesced-user-messages.i18n.yaml
#	.agents/notes/implemented/architecture/2026-07-22-unified-send-and-coalesced-user-messages.md
#	.agents/notes/implemented/architecture/2026-07-22-unified-send-and-coalesced-user-messages.zh.md
#	docs/cordis-catalog/events.md
#	docs/event-producer-consumer.md
#	packages/core/agent-loop/src/agent.ts
2026-07-24 13:59:37 +08:00
Tianyi Cui
d6d50deb24 refactor(agent): expose resolved input acceptance 2026-07-24 13:52:25 +08:00
Turtle
d613fdb073 fix(agent-loop): third review pass — disposal discard ordering, flush guard, docs
Address a fresh-eye review of the disposal/injection fixes:
- disposal now snapshots, clears, and marks disposed BEFORE emitting
  agent/inbox/discard (mirroring cancel's snapshot→clear→emit), so a
  re-entrant send/cancel from a discard listener throws 'disposed' or
  finds an empty inbox instead of leaking or double-discarding an id.
  The discard is unconditional (even on unpublished setup-rollback) to
  match send's unconditional enqueue, keeping every id balanced.
- restore the turnRecorded guard on the idle-injection flush: a
  turn/start rejected pre-commit (append reentrancy / internal-dispatch
  veto) records nothing and owes no flush; the previous unconditional
  flush emitted a phantom-turn agent/error. The isTurnOpen/turnRecorded
  branches are reachable (reentrant inject from a session/event
  listener) and now covered by a regression test rather than v8-ignored.
- rewrite the agent/inbox/discard event JSDoc to enumerate all three
  emitters (cancel, terminal turn-stop, disposal) — every enqueued id
  gets exactly one terminal dequeue-or-discard.

Per-file coverage stays 100%.
2026-07-24 13:39:06 +08:00
Tianyi Cui
1595f4c851 refactor(agent-loop): rename private input boundary 2026-07-24 13:01:48 +08:00
Tianyi Cui
086e454931 refactor(agent): name delivery methods by intent 2026-07-24 12:27:20 +08:00
Turtle
c7c1b97501 fix(agent-loop): address second-round review — disposal discard, injection validation, frozen payloads
Address the review bot's five genuinely-new findings on the current code:
- disposal now discards any still-pending inbox items before the loop
  exits, so every enqueued id gets a terminal lifecycle event.
- injection (next-step/no-wakeup) validates its payload up front, before
  opening the idle one-shot turn, honoring 'invalid input throws before
  any append'; and rejects attached contexts (which belong only to inbox
  messages) rather than silently dropping them.
- agentMessage() freezes the agent/inbox/* payload so a listener cannot
  mutate the shared correlation object mid-dispatch.
- refresh the package READMEs (compact, goal, guard, hook-protocol,
  plan-mode, time-context, workspace-context) that still referenced the
  removed context/message event, with the source-based user/message
  distinction.

The up-front injection validation makes two finally branches unreachable
(v8-ignored as the turn-enclosure backstop). Adds regression tests for
disposal discard, context rejection, up-front validation, and the frozen
payload; per-file coverage stays 100%.
2026-07-24 12:05:57 +08:00
Tianyi Cui
d07875947b Merge remote-tracking branch 'origin/master' into worktree/acp-automation-protocol
# Conflicts:
#	packages/examples/acp-demo/README.md
2026-07-24 11:50:56 +08:00
Hypatia May
19b96037f6 fix(sqlite): enforce integer session metadata 2026-07-24 10:35:09 +08:00
Tianyi Cui
e819a586b0 refactor(acp): reduce bridge to automation protocol 2026-07-24 01:40:25 +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
Turtle
d5f88f1221 Merge remote-tracking branch 'origin/master' into feat/send-unify
# Conflicts:
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/pty/pty-local/tests/index.spec.ts
#	packages/session-query/session-query/tests/tracing.spec.ts
2026-07-23 22:41:45 +08:00
Turtle
1f9a3e1bee fix(agent-loop): second review pass — late-steering discard, dead-branch, catalog leaks
Address a second fresh-eye review of the review fixes:
- MAJOR: late steering that lands after runTurn returns terminally
  stopped (e.g. during the post-turn flush) was drained by runLoop and
  dropped without a discard, leaving a dangling outstanding id the
  negative-only invariant can't catch. Emit agent/inbox/discard for it,
  symmetric with the in-turn terminal-stop drop.
- remove the dead cancel() idle-settle branch: whenIdle's fast path
  already resolves for a lone quiet item, so no waiter is ever left for
  it to settle. Document why.
- gen-cordis-api classShape now drops private/protected/#private members
  and strips getter/setter bodies, so Session no longer leaks private
  fields and getter bodies into the model catalog.
- document that AgentMessage intentionally omits meta (durable-only).

Adds a regression test for the late-steering discard.
2026-07-23 22:33:12 +08:00
Turtle
98ee4ce429 fix(agent-loop): address review — quiet-item parking, meta, discard balance
Resolve six review findings on the unified-send change:
- quiet (wakeup:false) queued items no longer un-park the driver; the
  inbox distinguishes hasWakingQueued (drives the loop, idle/quiescence)
  from hasQueued (anything to dequeue), so a lone quiet item parks at idle
  and rides the next waking send. whenIdle/cancel settle off the waking
  signal, so cancelling a parked quiet item no longer hangs whenIdle.
- SendOptions.meta on queued/steering sends now reaches the durable
  user/message and steering/message (was dropped except on injection).
- a terminal agent/turn-stop that drops pending steering emits
  agent/inbox/discard so the enqueue-dequeue-or-discard ledger balances.
- the loop-authored continuation reason is snapshotted and frozen like a
  public send.
- gen-cordis-api collects exported classes (body-stripped) so the now-
  abstract-class Agent and its transitive shapes reappear in the API
  catalog.

Adds regression tests for each and re-records the affected snapshot.
2026-07-23 21:41:42 +08:00
Turtle
a3ad5241ba Merge remote-tracking branch 'origin/master' into feat/send-unify
# Conflicts:
#	docs/persistence-catalog.md
#	examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
#	packages/context/time-context/tests/time-context.spec.ts
#	packages/cordis/tool-cordis/src/api-catalog.ts
2026-07-23 20:54:48 +08:00
Tianyi Cui
26bfd37da0 Merge commit 'refs/codex-unblock/20260723/master' into worktree/pty-review-fixes
# Conflicts:
#	.agents/notes/implemented/feature/2026-06-30-interception-seams.md
#	docs/config-catalog.md
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/tools.md
#	docs/event-producer-consumer.md
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/core/tools/README.md
#	packages/core/tools/src/index.ts
#	packages/core/tools/src/schema.ts
#	packages/core/tools/tests/tools.spec.ts
#	packages/pty/tool-pty/README.md
#	packages/pty/tool-pty/src/index.ts
#	packages/pty/tool-pty/src/render.ts
#	packages/tasks/tool-tasks/README.md
#	packages/tasks/tool-tasks/src/index.ts
2026-07-23 20:50:45 +08:00
Turtle
866b543700 docs(agent): fix stale 'info' param name in agent/inbox/enqueue JSDoc
The @param was renamed info→message; the body sentence still named info.
Found by fresh-eye review. Regenerated the catalog/graph docs.
2026-07-23 20:50:13 +08:00
Turtle
3fd72f7c74 feat(agent): rename InboxItemInfo to AgentMessage with an id; send returns it
Add a branded AgentMessageId assigned to each accepted send message and
returned from send/followup/steer/inject (was void). Rename the inbox
event payload InboxItemInfo to AgentMessage, carrying that id so a caller
can correlate a queued item with its enqueue/dequeue/discard events.
2026-07-23 20:45: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
Turtle
95e75ba3e0 fix(agent-loop): balance inbox invariant on continuation-reason steer
The FIFO-conservation invariant fired on the loop-authored continuation
reason path: a continue-with-reason decision entered the steering FIFO
without an agent/inbox/enqueue, so its later dequeue/discard had no
matching enqueue. Emit the enqueue for that steer too, add a regression
test that mounts the invariant over a continue-with-reason turn and a
cancel, and hoist the duplicated inboxInfo helper into inbox.ts.

Found by fresh-eye review.
2026-07-23 19:37:21 +08:00
Turtle
44fd93fd06 feat(agent): unify send(target × wakeup), coalesce context/message into user/message
Replace send/steer/inject with one Agent.send primitive over the
(target × wakeup) matrix; followup/steer/inject become fixed-preset
alias methods on the now-abstract Agent class. Coalesce context/message
into user/message (injected context is a non-user source). Replace
agent/queued with agent/inbox/enqueue/dequeue/discard, add cancel
keepInbox, and add a FIFO-conservation invariant.
2026-07-23 19:15:45 +08:00
_Kerman
7f5ba286fe fix: keep crash repair away from live sessions 2026-07-23 18:31:37 +08:00
Tianyi Cui
43a2c0a0af fix(tools): avoid duplicate run_code result views 2026-07-23 04:08:27 +08:00
Tianyi Cui
94adb60e1a fix(tools): preserve bounded fallback guidance 2026-07-23 03:15:15 +08:00
Tianyi Cui
2821826e2c fix(pty): close final review gaps 2026-07-23 02:53:43 +08:00
Tianyi Cui
77f0f3e632 Merge branch 'codex/code-mode-typed-results' into codex/code-mode-complete-result-card
# Conflicts:
#	.agents/notes/implemented/architecture/2026-07-20-canonical-tool-output-contract.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-20-code-mode-typed-tool-returns.i18n.yaml
2026-07-23 01:38:52 +08:00
Tianyi Cui
fb74156cf8 fix(code-mode): generalize failures and bound diagnostics 2026-07-23 01:32:17 +08:00
Tianyi Cui
8c1a9b7752 Merge branch 'codex/canonical-tool-output' into codex/code-mode-typed-results 2026-07-23 01:15:13 +08:00
Tianyi Cui
dd9124468f Merge codex/tool-json-schema-dsl into codex/canonical-tool-output
# Conflicts:
#	docs/core-data-structures/tools.md
#	packages/core/tools/src/schema.ts
2026-07-23 01:08:18 +08:00
Tianyi Cui
e20dea1629 fix(schema): align projected and enforced declarations 2026-07-23 01:05:41 +08:00
Tianyi Cui
d626b2582d fix(tools): scope canonical provenance to dispatch 2026-07-23 00:39:55 +08:00
Tianyi Cui
e35a419ba8 fix(code-mode): keep deep host boundaries iterative 2026-07-23 00:30:36 +08:00
Tianyi Cui
3f547a83d1 Merge branch 'codex/code-mode-typed-results' into codex/code-mode-complete-result-card
# Conflicts:
#	.agents/notes/implemented/architecture/2026-07-20-canonical-tool-output-contract.i18n.yaml
2026-07-23 00:03:56 +08:00
Tianyi Cui
8dbea80294 Merge branch 'codex/canonical-tool-output' into codex/code-mode-typed-results 2026-07-22 23:55:07 +08:00
Tianyi Cui
8d42d3c979 Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output
# Conflicts:
#	docs/config-catalog.md
#	docs/persistence-catalog.md
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/core/agent-loop/tests/contract-regressions.spec.ts
#	packages/ui/acp/src/index.ts
#	packages/ui/tui/src/index.ts
2026-07-22 23:50:41 +08:00
Tianyi Cui
065d20c249 Merge remote-tracking branch 'origin/master' into codex/tool-json-schema-dsl
# Conflicts:
#	scripts/type-equiv.manifest.json
2026-07-22 23:34:17 +08:00
Tianyi Cui
d5d6960184 Merge remote-tracking branch 'origin/master' into worktree/pr468-retarget-latest-master
# Conflicts:
#	docs/architecture.i18n.yaml
#	docs/module-graph.md
2026-07-22 23:17:02 +08:00
Tianyi Cui
fed32c767d Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output 2026-07-22 23:12:20 +08:00
Tianyi Cui
1429c5d22f Merge remote-tracking branch 'origin/master' into codex/tool-json-schema-dsl 2026-07-22 23:03:02 +08:00
Tianyi Cui
b65afd320a Merge remote-tracking branch 'origin/master' into worktree/pr468-retarget-latest-master
# Conflicts:
#	docs/cordis-catalog/events.md
#	docs/cordis-catalog/services.md
#	docs/event-producer-consumer.md
2026-07-22 23:00:05 +08:00
Tianyi Cui
d1564f062b Merge refreshed typed Code Mode results into result card fix 2026-07-22 22:54:55 +08:00
Tianyi Cui
cf5dfe46e7 Merge remote-tracking branch 'origin/rfc/pty' into worktree/pr467-retarget-latest-master 2026-07-22 22:50:55 +08:00
Tianyi Cui
d92bb12963 Merge refreshed canonical outputs into typed Code Mode results 2026-07-22 22:50:28 +08:00
Tianyi Cui
3d9240e423 Merge refreshed schema DSL into canonical tool outputs 2026-07-22 22:46:10 +08:00
Tianyi Cui
d99094b1ac Merge updated rfc/pty into feature/persistent-pty-sessions
# Conflicts:
#	docs/architecture.i18n.yaml
#	docs/core-data-structures/core.md
#	pnpm-lock.yaml
#	scripts/gen-cordis-catalog.ts
2026-07-22 22:43:20 +08:00
Tianyi Cui
c51c02cafa Merge latest master into schema DSL 2026-07-22 22:42:43 +08:00
Tianyi Cui
59e325f571 Merge refreshed typed Code Mode results into result card fix 2026-07-22 22:38:23 +08:00