2nd dokployH
Find a file
Tianyi Cui 4535bfab75 fix(agent-loop): decide turn balance + idle-injection flush from the log (review #32)
Session.append pushes the event BEFORE notifying session/event listeners,
so a throwing listener leaves the event in the log while the line after
the append (a boolean flag) never runs. Both turn-balance decisions were
gated on such flags, so a throwing listener could strand an open turn or
skip a durability checkpoint.

- loop.ts: the outer catch decided "turn/end owed" from `turnStarted`.
  A throwing listener on the turn/start append left turn/start logged but
  the flag false → catch rethrew and skipped turn/end → permanently open
  turn (violating ADR 0017). Now decided from the log (this turn's
  turn/start present), so the turn is always balanced; only a genuine
  pre-push failure (non-serializable trigger — turn/start never logged) is
  rethrown to the runLoop backstop. Removed the now-dead `turnStarted`.

- agent.ts inject(): the idle one-shot-turn flush was gated on a
  `turnRecorded` flag set after append('turn/end'); a throwing turn/end
  listener skipped the flush, losing the balanced in-memory injection turn
  on crash. Now the flush decision is read from the log, the synthetic
  turn/end append contains a throwing listener (turn stays balanced), and
  a failing idle flush is reported via agent/error (step 0 convention) AND
  the logger — mirroring the loop's post-turn/end flush path — with a
  throwing agent/error listener contained.

Rewrote the test that encoded the old (buggy) "turn/start listener throw
is rethrown, no turn/end" semantics to assert the balanced-turn contract,
and added regressions for the throwing-turn/end-listener flush and the
agent/error report. Updated Agent.inject JSDoc.
2026-06-15 23:44:54 +08:00
.agents/skills/dsh-code-review docs: correct the doc-sync gate claim in the code-review skill (PR1 review) 2026-06-14 23:14:46 +08:00
.claude docs: accuracy sweep, architecture restructure, two ADRs, review skill 2026-06-13 22:05:34 +08:00
.github/workflows build: run doc-sync gates in the local pre-push hook too 2026-06-14 10:40:20 +08:00
docs Merge branch 'split/session-meta' into split/turn-enclosure 2026-06-15 22:13:22 +08:00
examples feat(invariants): dev-mode event-contract assertions + session-log freeze (RFC 005 pt 3, RFC 008) 2026-06-13 23:25:12 +08:00
packages fix(agent-loop): decide turn balance + idle-injection flush from the log (review #32) 2026-06-15 23:44:54 +08:00
scripts fix(scripts): harden event-taxonomy brace walk against JSDoc braces (PR 4) 2026-06-14 00:54:47 +08:00
vendor docs: accuracy sweep, architecture restructure, two ADRs, review skill 2026-06-13 22:05:34 +08:00
.gitignore build: doc-sync gates — typecheck doc code blocks + verify event taxonomy (RFC 006 pts 1-2) 2026-06-14 00:47:38 +08:00
.yarnrc.yml Set up monorepo infra: Yarn 4 workspaces, tsc -b + dumble build, vitest 2026-06-11 10:52:45 +08:00
AGENTS.md docs: sync high-authority docs with the doc-sync gate and dsh-invariants (P1-16) 2026-06-14 23:07:52 +08:00
CLAUDE.md Initialize repo with README, AGENTS.md, and CLAUDE.md symlink 2026-06-10 22:58:56 +08:00
eslint.config.mjs Replace dumble with tsdown for JS bundling 2026-06-11 22:34:43 +08:00
knip.json Add examples/coding-agent and the docs cookbook 2026-06-13 18:30:50 +08:00
lefthook.yml build: run doc-sync gates in the local pre-push hook too 2026-06-14 10:40:20 +08:00
LICENSE Initialize repo with README, AGENTS.md, and CLAUDE.md symlink 2026-06-10 22:58:56 +08:00
package.json build: run doc-sync gates in the local pre-push hook too 2026-06-14 10:40:20 +08:00
README.md docs: split README guidance by audience 2026-06-14 10:50:10 +08:00
tsconfig.base.json feat(invariants): dev-mode event-contract assertions + session-log freeze (RFC 005 pt 3, RFC 008) 2026-06-13 23:25:12 +08:00
tsconfig.build.json feat(invariants): dev-mode event-contract assertions + session-log freeze (RFC 005 pt 3, RFC 008) 2026-06-13 23:25:12 +08:00
tsconfig.json Fix CI: order steps by artifact dependency, resolve fresh-clone builds 2026-06-11 23:10:43 +08:00
tsconfig.test.json Set up monorepo infra: Yarn 4 workspaces, tsc -b + dumble build, vitest 2026-06-11 10:52:45 +08:00
tsconfig.typecheck.json feat(invariants): dev-mode event-contract assertions + session-log freeze (RFC 005 pt 3, RFC 008) 2026-06-13 23:25:12 +08:00
tsdown.config.ts Replace dumble with tsdown for JS bundling 2026-06-11 22:34:43 +08:00
vitest.config.ts Document why vite-tsconfig-paths can't be replaced by resolve.tsconfigPaths 2026-06-11 23:24:41 +08:00
vitest.e2e.config.ts Add examples/coding-agent and the docs cookbook 2026-06-13 18:30:50 +08:00
yarn.config.cjs Add repo hygiene gates: knip, publint, yarn constraints 2026-06-11 15:04:50 +08:00
yarn.lock fix(agent-loop): always close a started turn and any open step on error (P1-5) 2026-06-15 01:06:13 +08:00

DeepSeek Harness

Monorepo for the DeepSeek Harness group.

Projects

  • DeepSeek Code — DeepSeek's coding agent product.

Development

This monorepo is built on the Cordis framework (vendored as source under vendor/), microkernel-style: everything is a plugin.

yarn install
yarn test          # vitest
yarn demo:echo     # runnable echo-agent example (no API key needed)
yarn demo:coding   # the real DeepSeek coding agent (needs DEEPSEEK_API_KEY)

For humans, start with the development guide for local setup, hooks, environment variables, and quality gates, then read the architecture design before package work. Local context lives in packages/ and vendor/.

For agents, follow AGENTS.md.