Files
marqdo-app-harness/packages/marqdo/harness/README.md
T
cflmy 25fc24eea4 feat: add Marqdo Harness product services and workbench
Implement the downstream product in `packages/marqdo`:

- `@marqdo/mdh-harness`: application home layout, atomic writes, locks,
  bounded fixed-argv processes, safe tar extraction, Observation 1 and
  ValueWire validation;
- trusted Gitea release discovery, SHA-256/platform/Bundle verification,
  transactional environment install, rollback and cleanup, CLI Tool changes;
- private knowledge collections with strict import policy, the official
  `marqdo-knowledge` compile/query adapter and a disclosed locator fallback;
- Analysis 3 parsing, approved run/call execution, evidence and staleness;
- the six model operations (find/read/check/program/ecosystem/knowledge_search);
- the `/mdh` workbench over the existing web server with a same-origin fence;
- `mdh` launcher, CI/package/upstream scripts and a Woodpecker pipeline.

Tests: 28 node:test cases (27 PASS, one network-gated install test also PASS
with MDH_TEST_INSTALL=1). Product install/workbench evidence is recorded in
docs/mdh/evidence.

Part of marqdo#25 (MDH-03..MDH-08).
2026-11-28 10:41:39 +08:00

2.6 KiB

@marqdo/mdh-harness

Marqdo Harness product services as one Cordis plugin (host half) plus the /mdh workbench (web half). This package has no runtime import of an upstream @deepseek-ai/* package: it consumes Cordis services through injection and uses only Node built-ins. That keeps the application independently testable and prevents a second copy of the upstream agent state machine.

Surface

  • src/index.ts — mdh-harness plugin: provides mdhRuntime, registers six tools, adds one product prompt section.
  • src/web/index.ts — mdh-web plugin: /mdh page, CSS/JS and same-origin JSON API over ctx.webServer.
  • src/core/ — home layout, atomic files, lock, bounded process, safe tar, Observation 1, ValueWire.
  • src/ecosystem/ — trusted Gitea release discovery, download verification, transactional environment install/rollback/cleanup and CLI Tool changes.
  • src/knowledge/ — private collections, import policy, official marqdo-knowledge adapter, disclosed locator fallback, exact reads, export.
  • src/execution/ — Analysis 3 parsing, fixed-argv CLI adapter, evidence store and freshness.
  • src/tools/ — marqdo_find, marqdo_read, marqdo_check, marqdo_program, marqdo_ecosystem, knowledge_search.

Model Experience

The tool descriptions state the authority boundary: marqdo_find/marqdo_read/marqdo_check and knowledge_search are static reads; marqdo_program and ecosystem mutations require a one-shot user approval. Results carry run ids, Analysis digests and evidence ids so the model can refer to a run instead of repeating it. Large values are not injected into the prompt. Knowledge snippets are marked low-trust in the product prompt; the model receives bounded hits, not the collection.

Tests

node --import tsx/esm --test tests/*.test.ts

tests/execution.test.ts needs MARQDO_BIN pointing at a released CLI. tests/install.test.ts is network-gated by MDH_TEST_INSTALL=1.

Known Limitations and Deferred Work

  • The web half registers an anonymous same-origin route; it relies on the loopback bind plus Host/Origin fences and does not read DSH session credentials. Remote binds require an explicit trusted-host configuration and an external access-control layer.
  • No session-scoped environment pinning yet: evidence records the environment, but an active task would follow a later current switch. Gate E07 is PARTIAL.
  • Ext package/lock validation is delegated to the CLI at run time; no independent lock parser is maintained here.
  • View export binding, reviewed knowledge candidates, knowledge-sharing, multi-tenant and full DSH host-binding PTC are not implemented.