mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
# Conflicts: # docs/cookbook/adding-a-package.md # docs/rfc/INDEX.md # package.json # packages/AGENTS.md # packages/bash/bash-sandbox/README.md # packages/sandbox/sandbox-local/README.md # packages/sandbox/sandbox/README.md # packages/session-persistence/session-persistence-sqlite/README.md # packages/support/acp-snapshot/README.md # packages/ui/app-boot/README.md # packages/ui/user-approval/README.md # packages/workflow/tool-workflow/README.md
3.6 KiB
3.6 KiB
AGENTS.md — Harness Packages
This directory contains all @deepseek-ai/dsh-* harness packages. Repo-wide conventions (effects, declaration merging, waterfall semantics, ESM, testing policy) are in the root AGENTS.md § Conventions; the points below are packages-specific.
- Plugin export shape — namespace OR default, never both. A service package exports the service class as
export default(the Loader instantiates it). A function/namespace plugin exportsname/inject/Config/applyas separate named exports and must NOT addexport default— the cordis Loader'sunwrapExportsdoesexports.default ?? exports, so a stray default export collapses the module to the bareapplyfunction and silently discards theinject/name/Confignamespace, leaving the plugin with no injected services (it then throwscannot get property … without injectat load). See docs/postmortem/0001. - Read an optional (non-injected) service via
ctx.get(name), notctx.<name>. For a service a plugin reads opportunistically but deliberately leaves out ofstatic inject(e.g.AgentLoopreadingsessionPersistence), thectx.<name>property proxy resolves by an ancestor-only fiber walk that throws when the call arrives through a foreign traceable shadow (the service lives on a sibling fiber).ctx.get(name)is the topology-independent global-store lookup, strict by default (an inactive/absent backend reads asundefined— prefer it over thectx.get(name, false)overload, which also skips the active-state check). Services that ARE instatic injectresolve fine viactx.<name>. See docs/postmortem/0001. - A plugin shipped via
cordis.ymlneeds at least one test through the REAL Loader/export path — hand-builtctx.plugin({...})mounts bypassunwrapExportsand cannot catch a broken export shape. Full testing policy (tiers, with-key generosity, real-entry-path guards): docs/testing.md.
Naming notes:
- A service
src/index.tsexports the service class asexport default+ all public types; a function/namespace pluginsrc/index.tsexportsname/inject/Config/applyas named exports and NO default (the export-shape rule above). src/types.tscontains only types — no runtime code.- Tests live at package level under
tests/, notsrc/__tests__/. - A package's README and JSDoc are part of the change: altered behavior (config keys, defaults, error codes, wire fields) updates them in the same commit.
doc-syncgates what it can; prose accuracy stays on the author (the documentation standard). - Every package README carries the Model Experience table; update it when code changes a prompt section, session prefix, tool schema/result, history rewrite, auxiliary model call, or indirect visibility policy.
- Every package README carries a
## Known Limitations and Deferred Worksection — condensed bullets for consumer-visible gaps and consciously postponed work;verify-readme-limitations(indoc-sync) gates it. A package with genuinely nothing to declare is instead whitelisted in scripts/verify-readme-limitations.ts and must not carry the section (rationale).
Read the per-package README.md for package-specific details: service API, events, extension points, known limitations.