Commit Graph

746 Commits

Author SHA1 Message Date
Tianyi Cui
cc15ef54ef Sync remaining chars-per-token prose in overview READMEs
The convergence pass found four summary-level sites still describing
the estimator as fixed char/4: packages/README.md (twice), the compact
group and interface READMEs, and compact-basic's package.json
description. All now say chars-per-token with the charsPerToken
default, matching the authoritative package README/module doc/RFC.
2026-07-04 18:15:54 +08:00
Tianyi Cui
48d25cdd44 Fix review findings: validate the hooks cap, integer read caps, doc drift, config plumb-through test
A Codex review pass on the draft caught four real gaps and two solid
suggestions; all addressed except one pushed back on the merits:

- hooks-claude/hooks-codex: stderrSummaryMaxChars was the one new knob
  with NO range validation — a negative/NaN cap would silently
  misbehave inside slice(). Both bridges now assert a positive integer
  at the TOP of apply() (before the config-file parse's early return,
  so a bad value fails the load loudly), with rejection tests.
- tool-fs: the read caps count lines/chars/bytes, so positive-FINITE
  was too loose (a fractional readLimit would flow into windowing
  arithmetic and the schema description). All four now require a
  positive integer, matching tool-web's cap.
- Doc drift the gates cannot catch: tool-web's README tools table
  still named WEB_SEARCH_MAX_RESULTS as the mechanism; compact-basic's
  README/module doc and the compaction-capability-seam RFC still
  described estimation as fixed char/4 rather than the charsPerToken
  default.
- subagent-acp: the dispose graces were tested only at the
  startAcpRun level, so a regression that stopped threading plugin
  config into AcpRunSpec would have survived. A provider-path test now
  drives the trap-escalation scenario through ctx.subagents.start with
  small config graces and bounds dispose at 4s.

Pushed back on: converting compact-basic's charsPerToken to a
schemastery field. The package's whole config is deliberately
hand-rolled (resolveConfig, every threshold REQUIRED with no default —
a documented design posture); one schemastery field beside it would be
incoherent. The knob is cordis.yml-reachable, defaulted, and validated,
which is what the convention requires; migrating the package to
schemastery wholesale is pre-existing config-surface hygiene out of
this change's scope.
2026-07-04 18:06:35 +08:00
Tianyi Cui
774d460889 Expose audited hardcoded tunables as plugin config
The audit swept every packages/*/* plugin for the new AGENTS.md
convention (no hardcoded tunables in plugins) and exposes each finding
as a defaulted, validated Config field. Defaults are the previously
hardcoded values throughout, so no deployment or golden changes.

- tool-fs (had NO Config): readLimit, readMaxLineLength, readMaxBytes,
  readStreamMinSize. The caps thread through ReadToolCaps/ReadWindow —
  read-render already documented that the consumer applies the caps, so
  they become explicit per-request fields.
- tool-web: searchMaxResults (WEB_SEARCH_MAX_RESULTS stays as the
  schemastery default). Also fixes the stale GREP_LIMIT references in
  search.ts and the web-capability-seam RFC (no such constant exists).
- bash-local: graceMs (SIGTERM->SIGKILL escalation grace). The
  RunInternals.graceMs test seam is gone: graceMs is now a required
  SpawnSpec field filled from config, so tests exercise the real
  config path and the defaults live in exactly one place.
- subagent-acp: disposeEofGraceMs / disposeGraceMs. The AcpRunSpec
  fields become required for the same one-defaulting-layer reason.
- session-persistence-sqlite: journalMode ('wal' default; the
  rollback-journal modes serve filesystems where WAL's shared-memory
  files do not work, e.g. network mounts).
- hooks-claude + hooks-codex: stderrSummaryMaxChars for the persisted
  hook/result stderr summary. The duplicated summarize() helpers merge
  into hook-protocol's summarizeStderr(stderr, maxChars), beside the
  HookResultRecord field it feeds, with the bound parameterized the
  same way runHook's defaultTimeoutMs already is.
- compact-basic: charsPerToken for the token estimator (default 4, the
  English-text heuristic; CJK-heavy deployments need ~1-2 or compaction
  fires far too late). Also corrects the BasicCompactService class doc,
  which claimed defaults the required-field config never had.
- fs-local: deletes the dead STREAM_MIN_SIZE constant and the dead
  FsIoInternals.streamMinSize seam — the read-routing bound lives in
  the consumer (tool-fs), where it is now config. This is item 1 of
  the proposed prune-write-only-fs-surface RFC, annotated accordingly.

Every new field gets range validation (following the existing
assertPositiveFinite pattern), a README row, and tests covering the
configured behavior, the schema default, and load-time rejection.
2026-07-04 17:37:23 +08:00
Tianyi Cui
bee8132a7f Add the no-hardcoded-tunables convention and its review check
A number or string that two reasonable deployments could want set
differently — a timeout, grace period, output cap, result-count limit,
model name, base URL — belongs on the plugin's schemastery Config with
the shipped value as its default, not in a bare literal or module
constant. A DEFAULT_* constant or a test-only injection seam is not
configurability: the test is whether a cordis.yml deployment can change
the value without a code edit. Protocol/wire constants, semantic
constants, values pinned by an external spec, and security invariants
stay hardcoded.

The convention lands in AGENTS.md § Conventions (the authoritative
source the review skill cites); dsh-code-review gains the matching
reviewer-only check, since no mechanical gate can detect a hardcoded
tunable.
2026-07-04 17:37:05 +08:00
Tianyi Cui
049e04f4a2 Merge pull request #140 from deepseek-harness/worktree-simplification-rfcs-0704
docs(rfc): propose pruning dead surface, speculative capabilities, and duplicated scaffolding
2026-07-04 14:08:37 +08:00
Tianyi Cui
fa139c88b7 docs(rfc): reject prune-unimplemented-subagent-vocabulary — reserved surface
Maintainer decision: the subagent seam's deferred capability vocabulary
(outputSchema/structured, toolFilter, sendMessage/resume) is
intentionally reserved — the seam advertises the full intended contract
ahead of its implementations so providers and consumers grow into a
stable shape. Moved to rejected/ with the rationale on the status line;
the consumer-evidence analysis stays as the record of what is currently
unimplemented.
2026-07-04 14:06:26 +08:00
Tianyi Cui
3395d463fd docs(rfc): fix fold-round review findings — reference census scope, test-caller wording
The fold-stdio RFC claimed the two e2e doc comments and packages/README
were the only non-runtime references; the package name also appears in
the generated module graph, sibling READMEs, and tsconfig references —
rescope the sentence to the runtime-importer census (the load-bearing
claim) and fold the mechanical references into the update list. The web
RFC's status-caller census now says 'the web packages' own tests'
(the seam's tests use the methods too, not only provider tests).
2026-07-04 13:13:03 +08:00
Tianyi Cui
09f131f78e docs(rfc): fold PR #139's simplification sweep into this set
Deduplicate the parallel sweep from codex/exhaustive-simplification-rfcs
(merged in the parent commit) against the twelve RFCs already here, on
the merits per item:

Ported (rewritten to this set's evidence standard):
- fold-stdio-ui-helper — verified: dsh-stdio-agent is the only runtime
  importer; the fold resolves the documented product-app-depends-on-
  support-package tension. The false acp-agent analogy is replaced with
  the real distinction (protocol product surface vs one app's front-door
  scaffolding).
- generate-rfc-index-tables — verified: the classification RFC records
  rejecting generation; the index tables are the repo's only
  systematically conflicting docs region. Process framing made timeless.

Consolidated into existing owners:
- web searchStatus()/fetchStatus()/WebCapabilityStatus (verified: zero
  production callers; the tool-web README and architecture.md claims are
  drift) → drop-web-providers-change-event, renamed
  drop-unconsumed-web-observation-surface.
- hook/result.durationMs (unread, nondeterministic, normalizer-scrubbed)
  and the double-defaulted defaultTimeoutMs knob →
  tighten-hook-protocol-contract.
- the exercised-but-unadvertised exec.arguments mutation path (a
  tool-bash integration shim rewrites through it) → a sanction-or-seal
  note in the pre-tool-input-rewrite proposal.
- the dormant-guard critique of subagent depth machinery → recorded in
  prune-unimplemented-subagent-vocabulary as the considered-and-rejected
  alternative, with the keep sharpened (uncapped-today acknowledged;
  wiring the cap is the completion, not deletion). getProvider()/list()
  and lastAssistantMessage recorded as examined-and-kept (bash-revert
  precedent; observe-enrich recorded keep).

Not ported (with reasons):
- tools/change + system-prompt/change removal — recorded keeps in the
  adapter-change RFC, unengaged by the sweep; no new facts.
- LlmService.models() — flagged by both surveys, but two lines with a
  plausible consumer: TODO-or-drive-by territory per the RFC bar, not
  a proposal.
- SchemaProp.default RFC — already XXX(unused-default)-tagged; the RFC
  bar excludes TODO-tracked provisional cleanups.
- PreToolDecision 'ask' removal — FIXME(permissions)-anchored deferral
  with the permission system as its named consumer.
- Codex bridge Config.model, merged systemMessages — wire-faithful
  tested surface / README-documented deferral.

Their in-code TODO notes (acp-test-harness, hook-snapshot-noise,
catalog-type-links) and the stale hook-prompt-block name fixes ride the
merge unchanged.
2026-07-04 12:53:21 +08:00
Tianyi Cui
768876284c Merge remote-tracking branch 'origin/codex/exhaustive-simplification-rfcs' into worktree-simplification-rfcs-0704
# Conflicts:
#	docs/rfc/README.md
2026-07-04 12:43:12 +08:00
Tianyi Cui
8f0d924222 Merge remote-tracking branch 'origin/master' into codex/exhaustive-simplification-rfcs 2026-07-04 12:25:03 +08:00
Tianyi Cui
e6418398ff docs(rfc): address Codex round findings — timeless framing + narrowed fs acceptance
Rewrite the hook-protocol RFC's process-relative wording (freshly-landed
/ days-old / week-old) as timeless evidence anchored to the recorded
RFCs, and sweep the same class from the steering, replay-config,
subagent-vocabulary, and vocabulary RFCs. Narrow the fs RFC's acceptance
criterion: replaceAll survives on the request spec and version on other
outcome types by design — name the exact removed surfaces instead of
claiming the spellings vanish.
2026-07-04 11:47:12 +08:00
Tianyi Cui
de1089250a Merge remote-tracking branch 'origin/master' into worktree-simplification-rfcs-0704 2026-07-04 11:27:34 +08:00
Tianyi Cui
9ebc38badf docs(rfc): revise the batch for the hooks-stack base; add three post-stack RFCs
The branch now bases on the hooks stack (PR #138's head), so every
'in-flight' reference to stack content became a current-state fact.
Audited all nine RFCs + three supplements claim-by-claim against the
merged tree (none invalidated; several strengthened):

- prune-dead-core-spine-surface: describe the landed tools/pre-execute →
  dispatch → tools/post-execute pipeline — listeners return Decisions,
  the registry builds every result and snapshots it to protect callId,
  and a second (mutation-guard) test pins the field; drop the resolved
  wait-for-interception hedge; scope the additionalContext ferry out.
- prune-producerless-vocabulary-variants: the ui-stdio fixture migrated
  off the continuation trigger (llm-replay is the sole writer now); the
  stack's own additions (rejected, prompt/blocked, hook/invoked+result)
  all arrived with producers — the admission policy demonstrated live.
- prune-unimplemented-subagent-vocabulary: enrichment landed as
  lastAssistantMessage only (agentType was dropped in the stack's own
  review — the same judgment this RFC extends); the seam RFC now names
  tools/pre-execute deny, which exists, sharpening the re-add path.
- drop-inert-request-knobs / drop-image-content-block /
  trim-acp-bridge-unreachable-surface: current-state rewordings (shipped
  bridges set no request fields; only compact-basic has explicit image
  arms; 13 hook goldens also pin agentInfo).
- generic-long-running-tool-runtime census: second production seam
  consumer (hook-protocol runHook: resolve+run, stdin/env, foreground
  only — background machinery stays single-consumer); scrub-duplication
  blast radius.
- discover-package-inventory: identical 54-entry tsconfig reference
  sets; the comparesLog scenario knob (fixture-derivable, like recorded).
- unify-agent-and-session-id: third divergence site (in-process subagent
  children mint two UUIDs), the hooks bridge id-lookups, and ui-stdio's
  labelBySession map as a consumer that deletes under unification.

New RFCs from the post-stack survey:
- remove-agent-steering-mirror: the last mirror-of-durable event; zero
  production listeners; both retention RFCs deferred its fate, and the
  'no durable twin' rationale is contradicted by the adjacent append.
- tighten-hook-protocol-contract: producer-less 'native' dialect,
  parsed-and-discarded suppressOutput, and hook/result semantics
  (truncation + decision-string) defined twice in the bridges instead
  of the lib that owns the event.
- single-source-acp-replay-config: cordis.yml/cordis.snapshot.yml differ
  by exactly one plugin entry, with no gate on the forced symmetry.
2026-07-04 11:24:44 +08:00
Tianyi Cui
95b9ac0d3e docs: refresh simplification RFC sweep 2026-07-04 11:04:49 +08:00
Tianyi Cui
af584e5dc1 Merge pull request #138 from deepseek-harness/worktree-hooks-i-snapshots
test(hooks): snapshot the CC + Codex hook matrix end-to-end
2026-07-04 10:58:14 +08:00
Tianyi Cui
9a0dda64d4 Merge remote-tracking branch 'origin/master' into worktree-hooks-i-snapshots 2026-07-04 10:57:36 +08:00
Tianyi Cui
5278ee3d74 Merge pull request #131 from deepseek-harness/worktree-hooks-h-retro
docs(AGENTS): add a 'gates and judgment' note distilled from the hooks stack
2026-07-04 10:56:37 +08:00
Tianyi Cui
4377fa9801 Merge remote-tracking branch 'origin/master' into worktree-hooks-h-retro 2026-07-04 10:56:19 +08:00
Tianyi Cui
6a8adf9c80 Merge pull request #129 from deepseek-harness/worktree-hooks-g-stream-chunk
refactor(events): remove the agent/stream-chunk mirror (hooks stack PR-G)
2026-07-04 10:56:06 +08:00
Tianyi Cui
2e7688c96d Merge remote-tracking branch 'origin/master' into worktree-hooks-g-stream-chunk 2026-07-04 10:55:50 +08:00
Tianyi Cui
bffb209d7f Merge pull request #124 from deepseek-harness/worktree-hooks-f-bridges
feat(hooks): dsh-hooks-claude + dsh-hooks-codex bridges (hooks stack PR-F)
2026-07-04 10:55:37 +08:00
Tianyi Cui
536c208a7f Merge remote-tracking branch 'origin/master' into worktree-hooks-f-bridges 2026-07-04 10:55:19 +08:00
Tianyi Cui
ff21a788e3 Merge pull request #123 from deepseek-harness/worktree-hooks-e-protocol
feat(hooks): dsh-hook-protocol — shared CC/Codex hook wire-protocol core (hooks stack PR-E)
2026-07-04 10:54:57 +08:00
Tianyi Cui
74c34d63a3 Merge remote-tracking branch 'origin/master' into worktree-hooks-e-protocol 2026-07-04 10:54:41 +08:00
Tianyi Cui
2610fddfc7 Merge pull request #122 from deepseek-harness/worktree-hooks-d-subagent
feat(subagent): enrich lifecycle events — agentType + lastAssistantMessage (observe-only) (hooks stack PR-D)
2026-07-04 10:54:30 +08:00
Tianyi Cui
f7412d7494 Merge remote-tracking branch 'origin/master' into worktree-hooks-d-subagent 2026-07-04 10:54:14 +08:00
Tianyi Cui
9cedc2d1c0 Merge pull request #121 from deepseek-harness/worktree-hooks-c-interception
feat(events): interception seams — typed-Decision surface for hooks (hooks stack PR-C)
2026-07-04 10:54:01 +08:00
Tianyi Cui
152a8322d0 Merge remote-tracking branch 'origin/master' into worktree-hooks-c-interception 2026-07-04 10:53:39 +08:00
Tianyi Cui
a935de7380 Merge pull request #120 from deepseek-harness/worktree-hooks-b-bash-seam
feat(bash): stdin + extra env on the executor seam (trusted-plugin surface) (hooks stack PR-B)
2026-07-04 10:53:17 +08:00
Tianyi Cui
e8d01f6800 Merge remote-tracking branch 'origin/master' into worktree-hooks-b-bash-seam 2026-07-04 10:52:31 +08:00
Tianyi Cui
34ae0f9df5 Merge pull request #118 from deepseek-harness/worktree-hooks-a-taxonomy
refactor(events): event-domain semantics + drop step-boundary mirror emits (hooks stack PR-A)
2026-07-04 10:52:11 +08:00
Tianyi Cui
7774d427de Merge remote-tracking branch 'origin/worktree-hooks-i-snapshots' into worktree-simplification-rfcs-0704
# Conflicts:
#	docs/rfc/README.md
2026-07-04 10:50:58 +08:00
Tianyi Cui
cf550f3feb Merge PR #138 into simplification RFC sweep
# Conflicts:
#	docs/rfc/README.md
2026-07-04 10:49:33 +08:00
Tianyi Cui
f04b25478e docs(rfc): align acceptance criterion with corrected runLoop scope; two more image doc sites
The core-spine RFC's acceptance criterion still asserted all three
surfaces 'appear only in this RFC', contradicting the corrected scope
(runLoop/Inbox stay as package-internal symbols; only the public
re-exports go). Also add the deepseek README image-skip row and the
compact-basic [image]-placeholder row to the image RFC's removal set.
2026-07-04 04:33:06 +08:00
Tianyi Cui
9389c5df19 docs(rfc): address Codex review findings on the RFC batch
Two overstated evidence claims, reworded to the precise fact:
- prune-dead-core-spine-surface: runLoop has no importer OUTSIDE the
  package (its own agent.ts drives the loop with it); the dead surface
  is the public re-export, not the function.
- generic-long-running-tool-runtime census: BashTask.done has no
  consumer through the public seam, but is production-load-bearing
  inside dsh-bash-local (disposal awaits it); only the public
  completion surface is single-consumer.

Also fold the reviewer-located doc sites into the removal sets so the
implementing PRs need no re-discovery: the llm/pi-ai/compact-basic
README rows and the adding-an-llm-adapter cookbook line (prefill/image),
the content-block-vocabulary RFC's has-a-home consequence lines
(cache/prefill/image), the tools.md paste + type-equiv manifest row +
tools README row (callId), and the session-surface RFC's
full-rebuild-after-replacement sentence (invalidate).
2026-07-04 04:21:38 +08:00
Tianyi Cui
1546c6060a Merge branch 'worktree-hooks-h-retro' into worktree-hooks-i-snapshots 2026-07-04 03:31:31 +08:00
Tianyi Cui
f63ca8f00f Merge branch 'worktree-hooks-g-stream-chunk' into worktree-hooks-h-retro 2026-07-04 03:26:19 +08:00
Tianyi Cui
81c27bed36 Merge branch 'worktree-hooks-f-bridges' into worktree-hooks-g-stream-chunk
# Conflicts:
#	docs/rfc/README.md
2026-07-04 03:21:00 +08:00
Tianyi Cui
38cd1a150c Merge branch 'worktree-hooks-e-protocol' into worktree-hooks-f-bridges
# Conflicts:
#	examples/acp-agent/cordis.snapshot.yml
#	examples/acp-agent/cordis.yml
2026-07-04 03:09:37 +08:00
Tianyi Cui
7d69d759f6 Merge branch 'worktree-hooks-d-subagent' into worktree-hooks-e-protocol
# Conflicts:
#	docs/module-graph.md
#	pnpm-lock.yaml
2026-07-04 03:01:22 +08:00
Tianyi Cui
e13bbcb5d5 docs(rfc): propose nine simplification RFCs from a five-domain survey
Survey of master for surface area whose consumers are tests/docs only,
classified per candidate (production vs non-production corpus, rg + call-site
reads). New proposed/simplification RFCs:

- prune-producerless-vocabulary-variants: CacheHint/cache? fields,
  MessageSource 'agent', TurnTrigger 'continuation' (the TurnEndReasonMap
  omitted-until-emitted policy, applied)
- drop-inert-request-knobs: GenerateOptions.prefill (both adapters throw
  UNSUPPORTED), ToolSchema.strict (zero setters; beta-URL-only feature)
- drop-web-providers-change-event: the llm/adapter-change precedent replayed
- drop-image-content-block: no producer; every consumer silently drops it
- prune-write-only-fs-surface: fs-local STREAM_MIN_SIZE/streamMinSize,
  FsTarget.inputPath, FsEditOutcome.replacements/replaceAll,
  FileReadOutcome.limit/version
- prune-unimplemented-subagent-vocabulary: outputSchema/structured,
  toolFilter, sendMessage/resume (depthLimit stays)
- trim-acp-bridge-unreachable-surface: agentName/agentVersion knobs
  (resolves TODO(double-default)), toolKindFor name-sniffing
- prune-dead-core-spine-surface: SurfaceManager.invalidate(), runLoop/Inbox
  exports, ToolExecutionResult.callId
- share-app-bin-boot-glue: the twin coverage-exempt bin helpers

Also supplements three existing proposed RFCs with survey evidence: the bash
seam consumption census (generic-long-running-tool-runtime), three more
static inventories (discover-package-inventory), and the bridge's already-1:1
id usage (unify-agent-and-session-id).
2026-07-04 03:00:25 +08:00
Tianyi Cui
92be2724bd Merge branch 'worktree-hooks-c-interception' into worktree-hooks-d-subagent 2026-07-04 02:48:41 +08:00
Tianyi Cui
9033837081 Merge branch 'worktree-hooks-b-bash-seam' into worktree-hooks-c-interception
# Conflicts:
#	docs/architecture.md
#	docs/cordis-catalog/events-and-services.md
#	docs/core-data-structures/tools.md
#	packages/core/tools/README.md
#	packages/core/tools/src/index.ts
2026-07-04 02:44:26 +08:00
Tianyi Cui
955e8d2913 docs: propose simplification RFCs 2026-07-04 02:39:50 +08:00
Tianyi Cui
89f3c484c1 Merge branch 'worktree-hooks-a-taxonomy' into worktree-hooks-b-bash-seam
# Conflicts:
#	docs/rfc/README.md
2026-07-04 02:26:19 +08:00
Tianyi Cui
c5ed5ff490 Merge remote-tracking branch 'origin/master' into worktree-hooks-a-taxonomy
# Conflicts:
#	docs/rfc/README.md
2026-07-04 02:15:52 +08:00
Tianyi Cui
b735c766c6 Merge pull request #134 from deepseek-harness/codex/fs-directory-listing
feat(fs): add directory listing seam
2026-07-04 01:31:10 +08:00
Tianyi Cui
ecd5ca6ce6 Merge branch 'master' into codex/fs-directory-listing 2026-07-04 01:27:42 +08:00
Tianyi Cui
43ab04d944 Merge pull request #137 from deepseek-harness/docs/update-readme-for-sdk
docs: refresh SDK README and demo naming
2026-07-04 01:27:02 +08:00
Tianyi Cui
571f5b383a Merge branch 'master' into docs/update-readme-for-sdk 2026-07-04 01:20:27 +08:00