Commit Graph

864 Commits

Author SHA1 Message Date
Tianyi Cui
00cf8b693a feat(agent-loop): open every prompt with the harness identity section
A static harness:identity section at order -100 — the first occupant of
the documented negative band — states that the agent is powered by the
DeepSeek Harness SDK before the deployment's persona renders. Harness
attribution is a harness fact: it lives on the loop plugin, not in each
deployment's persona, so every agent (subagents included) carries it and
no YAML can forget it. A deployment that must drop it can remove the
section in the system-prompt/assemble waterfall.

Order-band docs updated in all five homes (PromptSection JSDoc, the
system-prompt and agent-loop READMEs, architecture.md, the RFC).
2026-07-05 11:37:32 +08:00
Tianyi Cui
2f191cc72b docs(agent): state the persona's template contract in its JSDoc
The AgentOptions.systemPrompt doc said the persona 'may reference'
variables without saying that every complete {{...}} group IS interpreted,
strictly, and that literal {{...}} prose has no escape syntax yet (the
RFC's recorded deferral). A persona author reads this line first; it now
carries the contract. (ds-review-bot inline finding: the escape mechanism
itself stays deferred per the RFC — pre-release, no external consumers,
and the failure is loud with the fix in the message.)
2026-07-05 10:48:40 +08:00
Tianyi Cui
e890a3373e test(review): pin the tool-subagent plugin fiber's lifecycle ownership; doc nits
Codex round-2 findings:

- A committed test now proves the REAL plugin fiber (not a direct apply)
  owns the provider-lifecycle listeners: disposing a mounted tool's fiber
  unmounts the tool and leaves the provider intact, and a fiber disposed
  while WAITING never zombie-mounts when its provider arrives later.
- TODO(subagent-dup-toolname) records the invalid-config blast radius of
  two waiting fibers sharing a toolName (the duplicate throw propagates
  through subagent/provider-added and rolls back the provider).
- CONTEXT.md drops its creation-history sentence; the RFC's acceptance
  checklist becomes present-tense shipped invariants (docs/AGENTS.md
  writing rules).
2026-07-05 03:40:22 +08:00
Tianyi Cui
e85e21c8b0 fix(review): close interpolation strictness holes; make tool-subagent mirror provider lifecycle
Codex round-1 findings, both confirmed:

- renderPrompt: variable lookup now uses Object.hasOwn (an unregistered
  {{constructor}} previously resolved through Object.prototype and spliced
  function source into the prompt), and a {{ that opens no complete group
  while a }} still follows ({{{model}}}, {{a{b}}) now throws instead of
  passing or partially interpolating. A lone {{ with no }} after it stays
  verbatim; substituted values are never re-scanned.
- tool-subagent: the apply-time provider lookup assumed a load order the
  cordis Loader does not guarantee (siblings start concurrently). The seam
  now announces subagent/provider-added/-removed and the tool mirrors the
  provider's lifecycle: registers when the provider is (or becomes)
  available, unregisters when it goes away, re-derives wording on reload.
  No load-order requirement remains.
- loop.spec containment test now proves live continuation: after the
  contained render failure, a waterfall listener rescues {{cwd}} and the
  same agent completes a real model turn.

RFC/READMEs updated to the shipped contract; cordis catalog regenerated.
2026-07-05 02:42:48 +08:00
Tianyi Cui
f256f3961d feat(system-prompt): prompt variables, persona-as-section, tool-guidance ownership
One principle: every fact in the assembled prompt has exactly one owner.

- dsh-system-prompt: merge-extensible AssembleContext on assemble();
  a variable(name, provider) registry; {{name}} interpolation in
  renderPrompt, strict (unknown/valueless/malformed references throw);
  duplicate section and variable names rejected; assembly carries
  resolved section text + variables through the assemble waterfall.
- dsh-agent declares AssembleContext.agent; dsh-agent-loop registers
  the agent:persona section (order 0 - identity renders before tool
  guidance) and the model/cwd variables, and drops its string join:
  renderPrompt(assembly) IS the full prompt.
- Tool guidance moves to its owners: descriptions carry per-tool
  semantics; sections only cross-call habits (tool:bash exit-code
  habit at order 105; read's not-shell nudge). todo/subagent need no
  section - their descriptions already carry the contract.
- SubagentProvider.inheritsParentContext (spawn/acp false, fork true);
  dsh-tool-subagent derives truthful per-provider wording and resolves
  the provider at load (backend must be listed first).
- Example personas shrink to identity + behavior with {{model}} (and
  {{cwd}} in the ACP tree); the welcome banner stops enumerating tools.

RFC: docs/rfc/implemented/architecture/2026-07-05-prompt-variables-and-tool-guidance-ownership.md
2026-07-05 01:54:46 +08:00
Tianyi Cui
1e2efc861e Merge pull request #81 from deepseek-harness/codex/app-attribution-rfc
Mandatory User-Agent attribution for provider requests (RFC + implementation)
2026-07-05 01:08:25 +08:00
Tianyi Cui
e06807ce0e Merge remote-tracking branch 'origin/master' into codex/app-attribution-rfc 2026-07-05 01:00:40 +08:00
Tianyi Cui
b9e2d7ed85 Merge master into app attribution RFC 2026-07-05 00:45:39 +08:00
Tianyi Cui
34f9d00227 Merge pull request #161 from deepseek-harness/persistence-log-catalog
Auto-generate a persistence log event catalog
2026-07-05 00:30:18 +08:00
Tianyi Cui
a52c27ee07 Merge remote-tracking branch 'origin/master' into persistence-log-catalog
# Conflicts:
#	packages/hooks/hook-protocol/README.md
#	packages/hooks/hook-protocol/src/types.ts
2026-07-05 00:06:47 +08:00
Tianyi Cui
d91b82ea61 Merge pull request #152 from deepseek-harness/simpl-e-acp-trim
refactor(acp): trim unreachable bridge surface (branding knobs, kind-sniffing fallback)
2026-07-04 23:45:21 +08:00
Tianyi Cui
021dae58e2 Merge remote-tracking branch 'origin/master' into simpl-e-acp-trim
# Conflicts:
#	docs/rfc/README.md
2026-07-04 23:43:20 +08:00
Tianyi Cui
a23982b30a Regenerate catalog for post-merge line shifts; drop pruned continuation trigger from turn/start JSDoc
Merging master brought the producerless-vocabulary prune that removed
TurnTriggerMap's continuation variant: the source pointers above
SessionEventMap shifted by one line (the staleness CI caught on the
merge tree), and the new turn/start JSDoc still named the pruned
variant.
2026-07-04 23:42:47 +08:00
Tianyi Cui
f56b09c5ce Merge pull request #151 from deepseek-harness/simpl-g-hook-contract
refactor(hooks): tighten the hook-protocol contract surface
2026-07-04 23:42:30 +08:00
Tianyi Cui
2c9e5ee756 Merge remote-tracking branch 'origin/master' into persistence-log-catalog 2026-07-04 23:41:57 +08:00
Tianyi Cui
9857bb0c07 Merge remote-tracking branch 'origin/master' into simpl-g-hook-contract
# Conflicts:
#	docs/rfc/README.md
2026-07-04 23:40:05 +08:00
Tianyi Cui
b46e805207 Merge pull request #148 from deepseek-harness/simpl-d-fs-write-only
refactor(fs): prune write-only fields and the dead routing knob from the seam
2026-07-04 23:38:51 +08:00
Tianyi Cui
f90f1c358e Merge remote-tracking branch 'origin/master' into simpl-e-acp-trim
# Conflicts:
#	docs/rfc/README.md
2026-07-04 23:22:16 +08:00
Tianyi Cui
c01d8c0dfc Merge remote-tracking branch 'origin/master' into simpl-g-hook-contract
# Conflicts:
#	docs/rfc/README.md
2026-07-04 23:22:08 +08:00
Tianyi Cui
54fc3d65ab Merge remote-tracking branch 'origin/master' into simpl-d-fs-write-only
# Conflicts:
#	docs/rfc/README.md
2026-07-04 23:21:46 +08:00
Tianyi Cui
2728e3bd5b Close remaining keyof-join holes the review verification found
- The owning top-level interface SessionEventMap must now be the SINGLE
  EXPORTED declaration in @deepseek-ai/dsh-session: a non-exported local
  interface (even inside the owning package) and a second exported copy
  are hard errors, so a same-named helper can no longer be catalogued as
  the on-disk vocabulary.
- Any SessionEventMap declaration carrying an extends clause is a hard
  error: inherited keys join keyof SessionEventMap but have no catalog
  row, so heritage is a silent-skip path the gate must reject.

Three new spec cases; RFC and module doc updated to match.
2026-07-04 23:21:23 +08:00
Tianyi Cui
a8b6fb6989 Merge pull request #158 from deepseek-harness/simpl-a3-knobs
refactor(llm): drop the inert request knobs — prefill and strict
2026-07-04 23:20:19 +08:00
Tianyi Cui
c64cfbbe5d Merge remote-tracking branch 'origin/master' into simpl-a3-knobs
# Conflicts:
#	docs/rfc/README.md
2026-07-04 23:17:51 +08:00
Tianyi Cui
9cce15919f Merge pull request #157 from deepseek-harness/simpl-a2-vocab
refactor(vocab): prune producer-less variants — cache hints, agent source, continuation trigger
2026-07-04 23:16:42 +08:00
Tianyi Cui
53dc3c8a28 Harden generator against Codex review findings
- A SessionEventMap member that is not a property signature with an
  explicit payload type is now a hard error instead of silently skipped —
  a method-form or type-less member joins keyof SessionEventMap and must
  not escape the catalog.
- A top-level interface SessionEventMap outside @deepseek-ai/dsh-session
  (ownership read from the package manifest) is now a hard error — an
  unrelated same-named local interface was previously catalogued as the
  on-disk vocabulary.
- JSDoc tag detection runs on the trimmed line, so an extra-indented
  '*  @mode' can no longer bypass the forbidden-tag check and leak into
  prose.

Four new spec cases cover these; RFC and module doc updated to describe
the enforced (not just assumed) invariants.
2026-07-04 23:11:42 +08:00
Tianyi Cui
9862eae898 Merge remote-tracking branch 'origin/master' into simpl-a2-vocab
# Conflicts:
#	docs/rfc/README.md
2026-07-04 23:11:07 +08:00
Tianyi Cui
daa737fe9c Merge pull request #155 from deepseek-harness/simpl-b3-replay
test(acp): derive the replay config from the live config
2026-07-04 23:09:17 +08:00
Tianyi Cui
e13217ef49 Merge remote-tracking branch 'origin/master' into simpl-b3-replay 2026-07-04 23:06:59 +08:00
Tianyi Cui
2bd155291a Merge pull request #153 from deepseek-harness/simpl-b2-app-boot
feat(ui): share the app bins' boot glue in dsh-app-boot
2026-07-04 23:06:31 +08:00
Tianyi Cui
c961850302 Condense the ui/ tree line to fit the AGENTS.md word ceiling 2026-07-04 23:04:50 +08:00
Tianyi Cui
232f314c3a Add generated persistence log event catalog with freshness + completeness gates
docs/persistence-catalog/log-events.md enumerates every SessionEventMap
member — the owning dsh-session vocabulary plus the dsh-compact and
dsh-hook-protocol declaration merges — with payload, surface/log-only badge,
JSDoc prose, and declaration site. scripts/gen-persistence-catalog.ts is a
pure AST pass in the gen-cordis-catalog mold: verify-persistence-catalog
(--check) joins doc-sync, so a stale committed catalog fails pre-push and CI.

The walk enforces JSDoc completeness (every member needs description prose;
@mode is rejected as a category error — log events do not dispatch on the
cordis bus), derives the surface badge from the SurfaceEventType union with a
stale-member cross-check, and hard-errors on duplicate declarations. Payloads
render through the TypeScript printer so newline-separated multi-line type
literals still emit valid one-line fragments.

Documented the five previously JSDoc-less core events (turn/step boundaries,
tool/call), removed the two stray @mode tags on the hook/* merges, and
replaced the hand-restated event enumerations (session.md hook/* table,
compact README table, hook-protocol README bullets, session README name-list
— whose merge note had already drifted) with links to the catalog. RFC:
docs/rfc/implemented/process/2026-07-04-persistence-log-catalog.md.
2026-07-04 22:58:28 +08:00
Tianyi Cui
8f62086feb Merge remote-tracking branch 'origin/master' into simpl-b2-app-boot
# Conflicts:
#	docs/rfc/README.md
2026-07-04 22:58:26 +08:00
Tianyi Cui
31c2f49725 Merge pull request #147 from deepseek-harness/simpl-f-steering-mirror
refactor(events): remove the agent/steering mirror emit
2026-07-04 22:56:49 +08:00
Tianyi Cui
a6feec6d04 Merge remote-tracking branch 'origin/simpl-f-steering-mirror' into simpl-f-steering-mirror 2026-07-04 22:54:09 +08:00
Tianyi Cui
5f295de096 Merge remote-tracking branch 'origin/master' into simpl-f-steering-mirror
# Conflicts:
#	docs/rfc/README.md
2026-07-04 22:50:47 +08:00
Tianyi Cui
5d6b1fd24a Merge pull request #154 from deepseek-harness/simpl-a1-drop-image
refactor(llm): drop the image content block until a path can honor it
2026-07-04 22:49:14 +08:00
Tianyi Cui
544cc0439e Merge remote app attribution branch
Resolve the RFC and implementation to defer OpenRouter-specific attribution headers and keep mandatory attribution to User-Agent only.
2026-07-04 22:47:53 +08:00
Tianyi Cui
1ddd6a9eea Merge remote-tracking branch 'origin/master' into simpl-a1-drop-image
# Conflicts:
#	docs/rfc/README.md
2026-07-04 22:46:55 +08:00
Tianyi Cui
e72aa84eb3 Merge pull request #150 from deepseek-harness/simpl-c-web-observation
refactor(web): drop the unconsumed observation surface (providers-change, status methods)
2026-07-04 22:45:17 +08:00
Tianyi Cui
80609cca11 Merge remote-tracking branch 'origin/master' into simpl-c-web-observation
# Conflicts:
#	docs/rfc/README.md
2026-07-04 22:39:41 +08:00
Tianyi Cui
c0349051c6 Merge pull request #149 from deepseek-harness/simpl-b1-fold-ui-stdio
refactor(ui): fold the stdio UI helper into the stdio app
2026-07-04 22:36:43 +08:00
Tianyi Cui
8d4153d5fa Merge branch 'master' into simpl-f-steering-mirror 2026-07-04 22:33:24 +08:00
Tianyi Cui
1891cb52d5 Defer OpenRouter-specific attribution headers 2026-07-04 22:33:15 +08:00
Tianyi Cui
0b97b2f7c1 restore hook/result durationMs — review keeps wall-clock audit timing durable
Reverses item 3 of the tighten-hook-protocol-contract RFC per review:
a persistence log is written for future readers, and hook wall-clock
runtime is audit signal (which hook made a turn slow). runHook keeps
its injected now clock and RunHookResult wrapper, the bridges pass the
measured duration through HookResultRecord, the snapshot normalizer
keeps its replay scrub, and the hook fixtures carry the field again.
The RFC records the reversal; the other three prunes stand.
2026-07-04 22:00:12 +08:00
Tianyi Cui
663e57c6d6 Merge branch 'simpl-a2-vocab' into simpl-a3-knobs
# Conflicts:
#	packages/core/tools/src/index.ts
2026-07-04 21:20:55 +08:00
Tianyi Cui
060f272093 Merge branch 'simpl-b2-app-boot' into simpl-b3-replay 2026-07-04 21:18:39 +08:00
Tianyi Cui
5441665585 Merge branch 'simpl-b1-fold-ui-stdio' into simpl-b2-app-boot
# Conflicts:
#	AGENTS.md
#	packages/README.md
2026-07-04 21:14:15 +08:00
Tianyi Cui
7ab322909f Merge branch 'simpl-a1-drop-image' into simpl-a2-vocab 2026-07-04 21:14:14 +08:00
Tianyi Cui
456cb3b532 Merge remote-tracking branch 'origin/master' into simpl-a1-drop-image
# Conflicts:
#	docs/architecture.md
#	packages/compact/compact-basic/README.md
2026-07-04 21:12:33 +08:00
Tianyi Cui
e2cd7379ed Merge remote-tracking branch 'origin/master' into simpl-e-acp-trim 2026-07-04 21:11:25 +08:00