docs: accuracy sweep, architecture restructure, two ADRs, review skill

- AGENTS.md Commands: fix typecheck/build descriptions; add lint, lint:fix,
  test:coverage, knip, publint, hygiene (were undocumented).
- Drop the bare `yarn demo` for explicit `demo:echo` + `demo:coding`; update
  README, examples READMEs (and document coding-agent in examples/README).
- New cookbook guide: adding-a-vendored-package.md (the missing "add" half of
  vendor/README's update-only procedure).
- architecture.md: add a table-of-contents and extract the Extension cookbook
  to docs/cookbook/extension-cookbook.md (link-preserving); drop the completed
  "restructure this document" TODO.
- ADR 0009 (capability seams) + 0010 (twin LLM adapters), and a "when to write
  an ADR" standard in adr/README.
- Add a committed dsh-code-review skill under .agents/skills, exposed to Claude
  Code via a tracked .claude/skills symlink (gitignore carve-out).
This commit is contained in:
Tianyi Cui
2026-06-13 18:50:13 +08:00
parent 066f94c7e0
commit 39b3db4b9c
18 changed files with 246 additions and 118 deletions

49
vendor/README.md vendored
View File

@@ -1,14 +1,10 @@
# Vendored Packages
This directory contains source-vendored copies of the Cordis framework and its
foundation libraries. They are copied into this monorepo instead of being
depended on via npm, so that the harness fully owns its framework layer
(auditable, patchable, pinned).
This directory contains source-vendored copies of the Cordis framework and its foundation libraries. They are copied into this monorepo instead of being depended on via npm, so that the harness fully owns its framework layer (auditable, patchable, pinned).
All vendored packages keep their **original npm names** (they are resolved
through Yarn workspaces) and are marked `private: true` — they are never
published from this repo. Upstream MIT `LICENSE` files are preserved in each
package directory.
All vendored packages keep their **original npm names** (they are resolved through Yarn workspaces) and are marked `private: true` — they are never published from this repo. Upstream MIT `LICENSE` files are preserved in each package directory.
This file covers the manifest, the local-modification log, and the procedure for **updating** an existing vendored package. To **add a new** one, see the cookbook guide: [docs/cookbook/adding-a-vendored-package.md](../docs/cookbook/adding-a-vendored-package.md).
## Manifest
@@ -26,44 +22,25 @@ Upstream workspace: `cordis-workspace` (local checkout: `~/repos/cordis-workspac
| `hmr/` | `@cordisjs/plugin-hmr` | 1.0.15 | https://github.com/deepseek-harness/cordis (`packages/hmr`) | `abb0a307cb1d3b0947f455d590cf5ba922d4caa4` |
| `logger-console/` | `@cordisjs/plugin-logger-console` | 1.0.0 | https://github.com/deepseek-harness/cordis (`packages/logger-console`) | `abb0a307cb1d3b0947f455d590cf5ba922d4caa4` |
Third-party dependencies of the vendored packages stay on npm:
`@standard-schema/spec`, `js-yaml`, `chokidar`, `picomatch`,
`@babel/code-frame`, `supports-color`.
Third-party dependencies of the vendored packages stay on npm: `@standard-schema/spec`, `js-yaml`, `chokidar`, `picomatch`, `@babel/code-frame`, `supports-color`.
Intentionally **not** vendored (verified unused by this set): `reggol`,
`@cordisjs/utils`, `@cordisjs/element`, `@cordisjs/unyaml` (dev-time YAML
import hook only).
Intentionally **not** vendored (verified unused by this set): `reggol`, `@cordisjs/utils`, `@cordisjs/element`, `@cordisjs/unyaml` (dev-time YAML import hook only).
## Local modifications
Keep this log exhaustive — every divergence from upstream must be listed.
1. **`hmr/src/index.ts`**: removed the `./locales/en-US.yml` /
`./locales/zh-CN.yml` imports, the `.i18n({...})` call on the `Config`
schema, and the `src/locales/` directory. Rationale: those imports require
a runtime YAML loader hook (`@cordisjs/unyaml`) that we do not vendor;
the i18n texts only localize config descriptions.
2. **All `package.json` files**: regenerated — added `private: true`, added
`src` to `files` and a `./src/*` export where missing, removed upstream
`devDependencies`/`scripts`/`repository` fields. Dependency and
peer-dependency ranges preserved.
3. **All `tsconfig.json` files**: regenerated to extend the repo-root
`tsconfig.base.json` and declare project references.
4. **`schemastery/tsdown.config.ts` and `logger-console/tsdown.config.ts`**:
ours, not upstream files — per-package build-shape overrides (dual
ESM+CJS output; separate node/browser entries) for the repo-root tsdown
build. Like the regenerated tsconfigs, they are not part of the upstream
sync surface.
1. **`hmr/src/index.ts`**: removed the `./locales/en-US.yml` / `./locales/zh-CN.yml` imports, the `.i18n({...})` call on the `Config` schema, and the `src/locales/` directory. Rationale: those imports require a runtime YAML loader hook (`@cordisjs/unyaml`) that we do not vendor; the i18n texts only localize config descriptions.
2. **All `package.json` files**: regenerated — added `private: true`, added `src` to `files` and a `./src/*` export where missing, removed upstream `devDependencies`/`scripts`/`repository` fields. Dependency and peer-dependency ranges preserved.
3. **All `tsconfig.json` files**: regenerated to extend the repo-root `tsconfig.base.json` and declare project references.
4. **`schemastery/tsdown.config.ts` and `logger-console/tsdown.config.ts`**: ours, not upstream files — per-package build-shape overrides (dual ESM+CJS output; separate node/browser entries) for the repo-root tsdown build. Like the regenerated tsconfigs, they are not part of the upstream sync surface.
## Sync procedure
To update a vendored package from upstream:
1. In the upstream workspace, note `git rev-parse HEAD` of the relevant
submodule.
2. Copy the package's `src/` (and `bin.js`, `README.md`, `LICENSE` if changed)
over the vendored directory.
3. Re-apply the local modifications listed above (or drop them if upstream
made them unnecessary — update the log either way).
1. In the upstream workspace, note `git rev-parse HEAD` of the relevant submodule.
2. Copy the package's `src/` (and `bin.js`, `README.md`, `LICENSE` if changed) over the vendored directory.
3. Re-apply the local modifications listed above (or drop them if upstream made them unnecessary — update the log either way).
4. Update the version and commit hash in the manifest table.
5. Run `yarn install && yarn test && yarn build` at the repo root.