mhproto 0.8.0-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +62 -0
- package/LICENSE +21 -0
- package/README.md +53 -0
- package/THIRD_PARTY_NOTICES.md +40 -0
- package/bin/mhproto.mjs +248 -0
- package/doc/context-design.md +43 -0
- package/doc/context-measurements.json +28 -0
- package/doc/guide.md +138 -0
- package/doc/publishing.md +93 -0
- package/doc/release-notes.md +23 -0
- package/doc/release-review-2026-10-02.md +127 -0
- package/doc/release-review.md +68 -0
- package/doc/viewer-design.md +80 -0
- package/package.json +69 -0
- package/skills/mhproto-discover/SKILL.md +14 -0
- package/skills/mhproto-implement/SKILL.md +14 -0
- package/skills/mhproto-reconcile/SKILL.md +14 -0
- package/skills/mhproto-specify/SKILL.md +16 -0
- package/skills/mhproto-specify/references/format.md +20 -0
- package/skills/mhproto-verify/SKILL.md +14 -0
- package/src/config.mjs +202 -0
- package/src/context.mjs +228 -0
- package/src/core.mjs +471 -0
- package/src/node-reporter.mjs +15 -0
- package/src/paths.mjs +51 -0
- package/src/server.mjs +290 -0
- package/src/verify.mjs +149 -0
- package/src/visuals.mjs +189 -0
- package/viewer/app.js +1463 -0
- package/viewer/diff.js +245 -0
- package/viewer/index.html +51 -0
- package/viewer/style.css +1003 -0
- package/viewer/vendor/LICENSE +21 -0
- package/viewer/vendor/NOTICE.txt +3372 -0
- package/viewer/vendor/README.md +75 -0
- package/viewer/vendor/build-evidence.json +2775 -0
- package/viewer/vendor/bundled-audit.json +88 -0
- package/viewer/vendor/bundled-packages.json +84 -0
- package/viewer/vendor/embedded-notices.txt +33 -0
- package/viewer/vendor/license-inventory.json +1456 -0
- package/viewer/vendor/licenses/braintree__sanitize-url-7.1.2.txt +21 -0
- package/viewer/vendor/licenses/chevrotain-13.2.0.txt +202 -0
- package/viewer/vendor/licenses/chevrotain-allstar-0.5.0.txt +16 -0
- package/viewer/vendor/licenses/chevrotain__cst-dts-gen-13.2.0.txt +202 -0
- package/viewer/vendor/licenses/chevrotain__gast-13.2.0.txt +202 -0
- package/viewer/vendor/licenses/chevrotain__regexp-to-ast-13.2.0.txt +202 -0
- package/viewer/vendor/licenses/chevrotain__utils-13.2.0.txt +202 -0
- package/viewer/vendor/licenses/cose-base-1.0.3.txt +21 -0
- package/viewer/vendor/licenses/cose-base-2.2.0.txt +21 -0
- package/viewer/vendor/licenses/cytoscape-3.34.3.txt +19 -0
- package/viewer/vendor/licenses/cytoscape-cose-bilkent-4.1.0.txt +21 -0
- package/viewer/vendor/licenses/cytoscape-fcose-2.2.0.txt +19 -0
- package/viewer/vendor/licenses/d3-7.9.0.txt +13 -0
- package/viewer/vendor/licenses/d3-array-2.12.1.txt +27 -0
- package/viewer/vendor/licenses/d3-array-3.2.4.txt +13 -0
- package/viewer/vendor/licenses/d3-axis-3.0.0.txt +13 -0
- package/viewer/vendor/licenses/d3-brush-3.0.0.txt +13 -0
- package/viewer/vendor/licenses/d3-chord-3.0.1.txt +13 -0
- package/viewer/vendor/licenses/d3-color-3.1.0.txt +13 -0
- package/viewer/vendor/licenses/d3-contour-4.0.2.txt +13 -0
- package/viewer/vendor/licenses/d3-delaunay-6.0.4.txt +14 -0
- package/viewer/vendor/licenses/d3-dispatch-3.0.1.txt +13 -0
- package/viewer/vendor/licenses/d3-drag-3.0.0.txt +13 -0
- package/viewer/vendor/licenses/d3-dsv-3.0.1.txt +13 -0
- package/viewer/vendor/licenses/d3-ease-3.0.1.txt +28 -0
- package/viewer/vendor/licenses/d3-fetch-3.0.1.txt +13 -0
- package/viewer/vendor/licenses/d3-force-3.0.0.txt +13 -0
- package/viewer/vendor/licenses/d3-format-3.1.2.txt +13 -0
- package/viewer/vendor/licenses/d3-geo-3.1.1.txt +34 -0
- package/viewer/vendor/licenses/d3-hierarchy-3.1.2.txt +13 -0
- package/viewer/vendor/licenses/d3-interpolate-3.0.1.txt +13 -0
- package/viewer/vendor/licenses/d3-path-1.0.9.txt +27 -0
- package/viewer/vendor/licenses/d3-path-3.1.0.txt +13 -0
- package/viewer/vendor/licenses/d3-polygon-3.0.1.txt +13 -0
- package/viewer/vendor/licenses/d3-quadtree-3.0.1.txt +13 -0
- package/viewer/vendor/licenses/d3-random-3.0.1.txt +13 -0
- package/viewer/vendor/licenses/d3-sankey-0.12.3.txt +27 -0
- package/viewer/vendor/licenses/d3-scale-4.0.2.txt +13 -0
- package/viewer/vendor/licenses/d3-scale-chromatic-3.1.0.txt +28 -0
- package/viewer/vendor/licenses/d3-selection-3.0.0.txt +13 -0
- package/viewer/vendor/licenses/d3-shape-1.3.7.txt +27 -0
- package/viewer/vendor/licenses/d3-shape-3.2.0.txt +13 -0
- package/viewer/vendor/licenses/d3-time-3.1.0.txt +13 -0
- package/viewer/vendor/licenses/d3-time-format-4.1.0.txt +13 -0
- package/viewer/vendor/licenses/d3-timer-3.0.1.txt +13 -0
- package/viewer/vendor/licenses/d3-transition-3.0.1.txt +13 -0
- package/viewer/vendor/licenses/d3-zoom-3.0.0.txt +13 -0
- package/viewer/vendor/licenses/dagre-d3-es-7.0.14.txt +23 -0
- package/viewer/vendor/licenses/dayjs-1.11.23.txt +21 -0
- package/viewer/vendor/licenses/delaunator-5.1.0.txt +15 -0
- package/viewer/vendor/licenses/dompurify-3.4.16.txt +202 -0
- package/viewer/vendor/licenses/elk-source-notice.txt +11 -0
- package/viewer/vendor/licenses/elkjs-0.9.3.txt +264 -0
- package/viewer/vendor/licenses/embedded-and-node-notices.txt +45 -0
- package/viewer/vendor/licenses/es-toolkit-1.52.0-1.txt +39 -0
- package/viewer/vendor/licenses/es-toolkit-1.52.0.txt +21 -0
- package/viewer/vendor/licenses/fastdom-1.0.12.txt +221 -0
- package/viewer/vendor/licenses/iconify__utils-3.1.7.txt +21 -0
- package/viewer/vendor/licenses/internmap-1.0.1.txt +13 -0
- package/viewer/vendor/licenses/internmap-2.0.3.txt +13 -0
- package/viewer/vendor/licenses/js-yaml-4.3.2.txt +21 -0
- package/viewer/vendor/licenses/katex-0.16.47.txt +21 -0
- package/viewer/vendor/licenses/khroma-2.1.0.txt +21 -0
- package/viewer/vendor/licenses/langium-4.4.0.txt +16 -0
- package/viewer/vendor/licenses/layout-base-1.0.2.txt +21 -0
- package/viewer/vendor/licenses/layout-base-2.0.1.txt +21 -0
- package/viewer/vendor/licenses/lodash-es-4.18.1.txt +47 -0
- package/viewer/vendor/licenses/marked-16.4.2.txt +44 -0
- package/viewer/vendor/licenses/mermaid-12.1.0.txt +21 -0
- package/viewer/vendor/licenses/mermaid-js__parser-2.0.1.txt +21 -0
- package/viewer/vendor/licenses/path-browserify-1.0.1.txt +20 -0
- package/viewer/vendor/licenses/robust-predicates-3.0.3.txt +24 -0
- package/viewer/vendor/licenses/roughjs-4.6.6.txt +21 -0
- package/viewer/vendor/licenses/stylis-4.4.0.txt +21 -0
- package/viewer/vendor/licenses/ts-dedent-2.3.0.txt +21 -0
- package/viewer/vendor/licenses/upsetjs__venn.js-2.0.0.txt +22 -0
- package/viewer/vendor/licenses/uuid-14.0.2.txt +9 -0
- package/viewer/vendor/licenses/vscode-jsonrpc-9.0.3.txt +11 -0
- package/viewer/vendor/licenses/vscode-languageserver-protocol-3.18.4.txt +11 -0
- package/viewer/vendor/licenses/vscode-languageserver-textdocument-1.0.15.txt +11 -0
- package/viewer/vendor/licenses/vscode-languageserver-types-3.18.4.txt +11 -0
- package/viewer/vendor/licenses/vscode-uri-3.1.0.txt +9 -0
- package/viewer/vendor/manifest.json +21 -0
- package/viewer/vendor/mermaid.min.js +7729 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Publishing MHProto to npm
|
|
2
|
+
|
|
3
|
+
The library is public at https://github.com/rbsx/mhproto. The website lives in the
|
|
4
|
+
private `rbsx/mhproto-site` repository and deploys independently to https://mhproto.dev.
|
|
5
|
+
|
|
6
|
+
## Prepared preview — 2026-10-03
|
|
7
|
+
|
|
8
|
+
Version `0.8.0-preview.0` is configured for public access on the `next` dist-tag.
|
|
9
|
+
The package has not been published. The renderer's previous security gate is
|
|
10
|
+
cleared by a reproducible patched build; see [the release review](release-review.md).
|
|
11
|
+
This machine is not authenticated to npm, and `mhproto` returned E404 when checked.
|
|
12
|
+
An absent package is not a name reservation.
|
|
13
|
+
|
|
14
|
+
## 1. Prepare and test the exact archive
|
|
15
|
+
|
|
16
|
+
From a clean, committed library checkout with Node 22.12+ and Chromium installed:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm ci
|
|
20
|
+
npx playwright install chromium
|
|
21
|
+
npm run release:prepare
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This runs formatting/tests, root audit/signatures, a clean Mermaid rebuild and
|
|
25
|
+
notice verification, the exact bundled-version audit, build dependency audit,
|
|
26
|
+
desktop/mobile browser flows, and a fresh install of the generated tarball.
|
|
27
|
+
The installed CLI and HTTP/offline viewer are exercised from that consumer.
|
|
28
|
+
|
|
29
|
+
Outputs:
|
|
30
|
+
|
|
31
|
+
- `artifacts/release/mhproto-0.8.0-preview.0.tgz`
|
|
32
|
+
- `artifacts/release/release-manifest.json` with source commit, SHA-256, npm SHA-512
|
|
33
|
+
integrity and full file list.
|
|
34
|
+
- `test-results/release/` browser screenshots.
|
|
35
|
+
|
|
36
|
+
Website source, build tools, tests, credentials and local project data are excluded.
|
|
37
|
+
Require all GitHub checks for the manifest's source commit to pass. Review that
|
|
38
|
+
archive and its manifest; publish those exact bytes. Preparation performs no
|
|
39
|
+
registry write.
|
|
40
|
+
|
|
41
|
+
## 2. Authenticate the package owner
|
|
42
|
+
|
|
43
|
+
Use an npm account with two-factor authentication enabled:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
npm login
|
|
47
|
+
npm whoami
|
|
48
|
+
npm view mhproto name version dist-tags --json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
E404 means no package was found; it does not guarantee the registry will accept
|
|
52
|
+
the name. If another owner has claimed it, choose an owned scope and update the
|
|
53
|
+
package metadata, archive and installation instructions before publishing.
|
|
54
|
+
Direct publication requires 2FA or a granular token configured to bypass 2FA;
|
|
55
|
+
interactive 2FA is suitable for this first manual release.
|
|
56
|
+
|
|
57
|
+
Source: [npm's public package publishing guide](https://docs.npmjs.com/creating-and-publishing-unscoped-public-packages/).
|
|
58
|
+
|
|
59
|
+
## 3. Publish the approved archive
|
|
60
|
+
|
|
61
|
+
After owner approval, current audit/name checks and green CI for the recorded
|
|
62
|
+
source commit, publish the tested archive:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npm audit
|
|
66
|
+
npm run audit:vendor
|
|
67
|
+
npm publish artifacts/release/mhproto-0.8.0-preview.0.tgz --access public --tag next
|
|
68
|
+
npm view mhproto@0.8.0-preview.0 version dist.integrity dist-tags --json
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Complete npm's authentication/2FA prompt. Compare registry `dist.integrity` with
|
|
72
|
+
the release manifest, then test `npm install --save-dev mhproto@next` in another
|
|
73
|
+
fresh consumer. `next` keeps the preview explicit without making it `latest`.
|
|
74
|
+
|
|
75
|
+
Tag the manifest's exact commit as `v0.8.0-preview.0` and publish the release notes
|
|
76
|
+
only after registry verification. Update the private website's pinned library
|
|
77
|
+
commit and installation copy to `npm install -D mhproto@next`, then deploy it.
|
|
78
|
+
The source-preview copy remains accurate until publication succeeds.
|
|
79
|
+
|
|
80
|
+
## Later releases
|
|
81
|
+
|
|
82
|
+
Choose a new preview version, update root package/lock metadata, commit the reviewed
|
|
83
|
+
changes and repeat `npm run release:prepare`. Promote a reviewed stable version to
|
|
84
|
+
`latest` separately once preview feedback and supported-platform checks justify it.
|
|
85
|
+
|
|
86
|
+
For automation after the first publication, configure npm trusted publishing for
|
|
87
|
+
`rbsx/mhproto` and the exact GitHub release workflow filename. Use a GitHub-hosted
|
|
88
|
+
runner, `id-token: write`, aligned repository metadata and an explicit release
|
|
89
|
+
approval. Do not configure the private website as the npm publisher.
|
|
90
|
+
Trusted publishing uses OIDC instead of a stored npm token; supported public
|
|
91
|
+
repository releases can receive npm provenance automatically.
|
|
92
|
+
|
|
93
|
+
Source: [npm trusted publishing documentation](https://docs.npmjs.com/trusted-publishers/).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# MHProto 0.8.0-preview.0
|
|
2
|
+
|
|
3
|
+
Prepared development preview for the npm `next` channel. Publication is pending.
|
|
4
|
+
|
|
5
|
+
MHProto keeps behaviour, API contracts, examples and verification checks in your
|
|
6
|
+
repository, with a shared browser view for humans and scoped context for agents.
|
|
7
|
+
|
|
8
|
+
- Browse feature pages, endpoints and linked types; attach design references.
|
|
9
|
+
- Compare iterations and keep evidence linked to contract rules and examples.
|
|
10
|
+
- Scaffold a project and install five skills for Codex, Claude or both.
|
|
11
|
+
- Retrieve scoped context and run structured checks with stale-evidence detection.
|
|
12
|
+
- Export a portable browser preview with diagrams, attachments and notices.
|
|
13
|
+
- Render diagrams with source-built Mermaid 12.1.0 and patched dependencies.
|
|
14
|
+
|
|
15
|
+
Node 22/24 on Linux/macOS are tested targets. Windows and non-Chromium browser
|
|
16
|
+
flows remain unverified. This preview supports a documented OpenAPI 3.1/JSON Schema
|
|
17
|
+
subset, and check results are evidence rather than a proof of correctness.
|
|
18
|
+
|
|
19
|
+
Project overview and demo: https://mhproto.dev/
|
|
20
|
+
Documentation: https://mhproto.dev/docs/
|
|
21
|
+
Source: https://github.com/rbsx/mhproto
|
|
22
|
+
|
|
23
|
+
After npm publication, install explicitly with `npm install -D mhproto@next`.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Pre-release code review
|
|
2
|
+
|
|
3
|
+
Reviewed 2026-10-02. **Decision: keep the package private; do not create or publish a new npm release yet.** The implementation is materially safer and more predictable after the fixes below. Remaining release gates are concrete verification work, not a request for a broad rewrite.
|
|
4
|
+
|
|
5
|
+
## Status update: 2026-10-03
|
|
6
|
+
|
|
7
|
+
The original findings and local-only evidence below are retained as a dated review.
|
|
8
|
+
Subsequent work cleared these gates:
|
|
9
|
+
|
|
10
|
+
- The hosted Linux/macOS, Node 22/24 matrix, dependency audit/signature job and
|
|
11
|
+
desktop/mobile Chromium suite passed for
|
|
12
|
+
[commit 7d75f8b](https://github.com/rbsx/mhproto/actions/runs/37068214828).
|
|
13
|
+
- Live npm audits reported no known vulnerabilities in the locked dependency tree.
|
|
14
|
+
This does not authenticate the copied Mermaid bundle.
|
|
15
|
+
- The library is public at https://github.com/rbsx/mhproto, and the homepage,
|
|
16
|
+
documentation and interactive demo are live at https://mhproto.dev.
|
|
17
|
+
- Desktop/mobile website flows and offline demo save/reload passed in Chromium.
|
|
18
|
+
|
|
19
|
+
The Mermaid bundle is now verified against the official `mermaid@11.16.1` npm
|
|
20
|
+
archive with its deterministic local wrapper. Repeat with
|
|
21
|
+
`node scripts/verify-mermaid.mjs`; hashes and registry integrity are recorded in
|
|
22
|
+
the vendor manifest. Its source map identifies 59 bundled dependency versions.
|
|
23
|
+
The bundled license inventory is now complete: 74 package/version entries,
|
|
24
|
+
including 32 matching parser chunks and their nested dependencies, have verified
|
|
25
|
+
archive integrity and retained license texts. Notices are also embedded in the
|
|
26
|
+
renderer for portable HTML exports. Repeat with `npm run verify:vendor`.
|
|
27
|
+
|
|
28
|
+
A separate live audit of those exact versions found advisories affecting
|
|
29
|
+
DOMPurify 3.4.0, js-yaml 4.1.1 and lodash-es 4.17.23. These include high-severity
|
|
30
|
+
YAML parsing and Lodash advisories. A clean ordinary `npm audit` did not cover the
|
|
31
|
+
vendored code. See `viewer/vendor/bundled-audit.json`; update/rebuild the renderer
|
|
32
|
+
and assess the affected call paths before clearing this release gate.
|
|
33
|
+
A draft `0.7.0` tarball was created and installed into a fresh consumer with only
|
|
34
|
+
runtime dependencies. Its public import, executable CLI, scaffold, both sets of
|
|
35
|
+
five skills, validation, scoped context, structured linked checks, stale evidence,
|
|
36
|
+
snapshot/diff and portable export passed. The installed HTTP viewer and exported
|
|
37
|
+
HTML passed desktop/mobile Chromium checks for diagrams, linked types, comparison
|
|
38
|
+
and offline navigation. The full notice appendix is present in the installed
|
|
39
|
+
package and single-file export. This is a tested draft, not an npm release.
|
|
40
|
+
|
|
41
|
+
Windows remains unverified. No npm version has been published; `private: true`
|
|
42
|
+
remains enabled. See [publishing steps](publishing.md) for the release sequence.
|
|
43
|
+
|
|
44
|
+
## Scope and method
|
|
45
|
+
|
|
46
|
+
Reviewed the CLI, file loading and writes, metadata validation, OpenAPI/schema handling, scoped agent context, verification evidence, HTTP handler, portable exports, visual attachments, type navigation, comparison module, five bundled skills, dependency lockfile and planned npm contents. Checked the isolated Impostor pilot against the revised implementation. The original application was not edited.
|
|
47
|
+
|
|
48
|
+
Used source inspection, actual CLI subprocesses, regression tests, JSDOM, the vendored Mermaid runtime, a fresh locked dependency install and an isolated planned-package layout. This is an engineering review, not a penetration test or a certification of the entire OpenAPI standard. Local checks ran on macOS with Node 24.18.1. The configured Node 22/24, Linux/macOS CI matrix has not run on a hosted repository.
|
|
49
|
+
|
|
50
|
+
## Findings fixed
|
|
51
|
+
|
|
52
|
+
Severity indicates the effect on MHProto's advertised guarantees. High means incorrect verification/contract acceptance or an unintended write/disclosure boundary; medium means incorrect output, comparison or workflow behaviour. It does not assert remote exploitability.
|
|
53
|
+
|
|
54
|
+
| Priority | Finding and prior consequence | Change and evidence |
|
|
55
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
56
|
+
| High | Node TODO tests could count as passing even though Node permits them without a failing exit code. Nonterminal reporter events could satisfy an expected name. | Require completed pass/fail events; reject TODO, skipped, missing and failing tests. Added real TODO and fabricated-event regressions, plus UTF-8 split handling. |
|
|
57
|
+
| High | Unbounded or malformed structured reporter output could undermine verification and consume excessive memory. | Bound structured output to 1 MB, reject malformed/oversized streams and stop the command on overflow. Retain bounded ordinary output. Verification still runs trusted commands with inherited environment; it is not a sandbox. |
|
|
58
|
+
| High | Boolean `false` schemas were treated as absent/empty; invalid inline schemas without examples could escape validation. | Preserve boolean schemas; compile declared inline schemas even without payloads. Validate named media examples. Cache compiled schemas. Regressions cover rejection and display/context preservation. |
|
|
59
|
+
| High | Evidence could remain fresh after configuration, system rules or declared test-file changes. | Include those inputs in the revision digest alongside capability and tracked source files. Bound directory traversal through symlink cycles. Regression mutates each missing input. |
|
|
60
|
+
| High | Several generated writes lacked the same real-path containment as reads and could follow escaping symlinks. | Centralize contained writes and unique atomic replacement. Preflight CLI destinations; reject existing init/skill destinations and root-directory exports, including root aliases. Regressions prove outside files are preserved. This is not protection against a hostile concurrent filesystem mutator. |
|
|
61
|
+
| High | Shareable exports contained captured process output, executed command records and the generated machine root path. | Export an evidence-summary whitelist. Keep status, timing and observed test names; omit captured logs/errors and generated paths. Validate and prepare all output before replacing files. Authored commands/environment values, contracts, examples and attachments remain and require review before sharing. |
|
|
62
|
+
| Medium | Local OpenAPI object references and path-level parameter overrides were not consistently resolved. | Resolve local path/parameter/request-body/response refs, reject cycles and duplicate parameters, apply operation overrides by name/location, decode JSON pointer names and include TRACE. Regression verifies context and payload validation. |
|
|
63
|
+
| Medium | Response example validation mishandled declared status ranges; metadata errors could become incidental runtime failures. | Match explicit status, `2XX` and default responses. Validate MHProto metadata with source-file diagnostics, reject unknown fields and allow `x-*` extensions. Preserve the pilot's existing check description field. |
|
|
64
|
+
| Medium | Viewer nullability/false schemas and unsafe imported design links could be misrepresented. | Preserve nullable object type arrays and `never` schemas. Actionable design links require HTTPS without credentials. Imported preview HTML is read as marked JSON without constructing an HTML document or executing scripts. |
|
|
65
|
+
| Medium | Diff normalization could ignore payload array order when a property happened to be named `rules`; path metadata could be missed. | Distinguish literal payloads from unordered reference sets and compare path-level metadata. Fenced rule examples remain prose rather than invented normative rules. Added regressions for each case. |
|
|
66
|
+
| Medium | Missing CLI values, unsupported flags and invalid skill agents could fail after partial scaffolding. | Validate command-specific options and preflight destinations; help never performs work. Added CLI subprocess regressions. |
|
|
67
|
+
| Release hygiene | License declaration lacked a top-level license file; source style, contributor guidance and dependency provenance were incomplete. | Added MIT LICENSE, third-party notices, contributor guide, formatter/check scripts, CI configuration and vendor hash/provenance manifest. Raised the YAML minimum to 2.8.3. Kept `private: true`. |
|
|
68
|
+
|
|
69
|
+
The YAML minimum follows the [maintainer's security advisory](https://github.com/eemeli/yaml/security/advisories/GHSA-48c2-rrv3-qjmp), which identifies 2.8.3 as the fix for deeply nested input causing a stack overflow. The locked install uses YAML 2.9.1. This specific fix does not establish that all dependencies are free of known vulnerabilities.
|
|
70
|
+
|
|
71
|
+
## Validation results
|
|
72
|
+
|
|
73
|
+
- **58/58 framework tests pass**, with no skips or TODOs. The previous suite had 44 tests; 14 additional regressions cover the review findings.
|
|
74
|
+
- Formatting passes. Tests clean up their temporary projects.
|
|
75
|
+
- **23/23 linked Impostor checks pass** with the revised verifier. The final contract check reports **0 errors and 12 warnings** for rules without linked executable checks. Those gaps remain visible; passing linked checks do not imply full behavioural coverage.
|
|
76
|
+
- Pilot tests exercise application services and HTTP handlers in process with a request/response double, an in-memory database and stub witnesses. They do not prove socket transport, deployed behaviour or live model quality. No paid model evaluation was run.
|
|
77
|
+
- A fresh `npm ci --offline --ignore-scripts` installs all 47 locked dependencies into an isolated source checkout. Offline installation verifies lock/cache consistency, not dependency security.
|
|
78
|
+
- The isolated source checkout also passes formatting and all 58 tests.
|
|
79
|
+
- Planned package-layout smoke verifies the public import, executable CLI, scaffold, five skill installs, validation, scoped context, snapshot/diff and portable viewer export from staged npm-listed files. It uses an isolated dependency install; it is not an installation from an npm tarball.
|
|
80
|
+
- `npm pack --dry-run --json --ignore-scripts` inspects the planned files without creating an archive. No application copy, local evidence, screenshots, test fixtures, node_modules or credentials are included. CLI executable mode, skills, viewer assets and licenses are included.
|
|
81
|
+
- The planned package now contains 33 files including the separate guide, approximately 1.05 MB packed and 3.80 MB unpacked. The reused Mermaid bundle accounts for about 94% of the unpacked bytes; a reproducible renderer build is the main dependency/size decision.
|
|
82
|
+
- Standalone exports execute their shared comparison in JSDOM with network access disabled; Mermaid examples render with the actual local bundle. These checks do not establish painted layout, keyboard behaviour in a real browser or real HTTP transport. Local socket/browser preview was unavailable in this environment.
|
|
83
|
+
- The final exported Impostor preview passes an offline DOM smoke with six endpoints, a linked type page, rendered Mermaid SVG and 23 fresh passing evidence summaries. It performs no fetch; SVG text measurement is approximate.
|
|
84
|
+
|
|
85
|
+
## Release gates still open
|
|
86
|
+
|
|
87
|
+
| Gate | Required evidence |
|
|
88
|
+
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
89
|
+
| Live dependency audit | Run a current audit and inspect relevant advisories for runtime dependencies and the vendored renderer. The attempted npm audit failed because registry DNS was unavailable; it did not return a clean audit. |
|
|
90
|
+
| Mermaid provenance and licenses | Obtain an official upstream artifact or reproducible build; verify the bundle identity and complete transitive license inventory. The reused bundle's claimed version is 11.16.1, but that claim is **not authenticated**. Its recorded SHA-256 identifies the local bytes only. Embedded notices are preserved. |
|
|
91
|
+
| Supported runtimes and real viewer smoke | Run the configured hosted Linux/macOS, Node 22/24 matrix. Test actual HTTP transport and review desktop/mobile pixels, keyboard navigation, attachment ownership, type pages and offline import/export in real browsers. Windows remains unverified. |
|
|
92
|
+
| Actual package installation | After the preceding gates, create a tarball, install it into a clean consumer and repeat the CLI/import/offline viewer smoke. Review final packed contents. The older downloadable 0.7.0 prototype predates this review and is not a reviewed release. |
|
|
93
|
+
| Public project metadata | Choose the public repository and add accurate repository/issue links; verify npm package/scope ownership and the Cloudflare homepage setup. Remove `private: true` only as part of the reviewed release. Nothing was published or deployed by this review. |
|
|
94
|
+
|
|
95
|
+
## Maintainability and declared limits
|
|
96
|
+
|
|
97
|
+
Backend responsibilities are now separated into metadata validation, contained paths, contract handling, context, verification, visuals and serving. Comparison stays a single pure module shared by Node and the browser. Attachment actions retain one owner; fields render types and expansion only.
|
|
98
|
+
|
|
99
|
+
The viewer remains a large DOM module. Before adding another major flow, separate type indexing, rendering and attachment/diff controllers behind the existing observable tests. A framework migration or comprehensive rewrite is not necessary for the current preview.
|
|
100
|
+
|
|
101
|
+
The contract validator implements a documented subset of OpenAPI 3.1 and JSON Schema 2020-12 with local references. Viewer signatures primarily handle application/json. Check success is evidence, not proof; trusted commands can forge their own output. Evidence tracks files, not tool upgrades or external environment/service state. Separate viewer processes do not coordinate attachment writes. Diff is a contract delta, not breaking-change classification; unchanged visual metadata does not detect changed asset bytes. Scoped context reduces supplied material but does not guarantee billed token savings.
|
|
102
|
+
|
|
103
|
+
Treat these as documented preview boundaries. Do not hide them behind an expansive “fully validated” claim.
|
|
104
|
+
|
|
105
|
+
## Release-check preparation after the documentation move
|
|
106
|
+
|
|
107
|
+
The concise README and separate guide are preserved. Repository/issue metadata now
|
|
108
|
+
points to rbsx/mhproto. CI has additional dependency advisory/signature checks and a
|
|
109
|
+
desktop/mobile Chromium flow suite using pinned Playwright 1.63.0. Browser artifacts
|
|
110
|
+
include screenshots and console diagnostics; tests cover actual HTTP, navigation,
|
|
111
|
+
type expansion/backlinks, attachment ownership/persistence, diff details and offline
|
|
112
|
+
preview save/reload without external requests. These tests use a synthetic contract,
|
|
113
|
+
not production data or live model calls.
|
|
114
|
+
|
|
115
|
+
The preparation has not cleared those gates. GitHub/npm DNS is unavailable in this
|
|
116
|
+
execution environment, so the new jobs cannot be pushed or inspected here, and the
|
|
117
|
+
real-browser suite cannot run under the local socket/browser restrictions. The
|
|
118
|
+
existing 58-test suite still passes. Browser syntax, fixture contract validity and
|
|
119
|
+
the new locked dependency install are checked separately; none is reported as a
|
|
120
|
+
successful real-browser run. Mermaid provenance/licences and actual tarball
|
|
121
|
+
installation remain open. No package was created or published.
|
|
122
|
+
|
|
123
|
+
The updated 49-dependency lock installs successfully from the offline cache into
|
|
124
|
+
an isolated checkout, and that checkout passes formatting and all 58 tests. The
|
|
125
|
+
browser fixture validates with no contract errors and produces the intended
|
|
126
|
+
linked-type diff. Planned npm contents exclude the browser fixture, browser suite
|
|
127
|
+
and screenshots. Offline installation does not clear the live audit/signature gate.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Preview release review
|
|
2
|
+
|
|
3
|
+
Reviewed 2026-10-03. **Prepared version: `0.8.0-preview.0`, for the npm `next` tag.**
|
|
4
|
+
The previous renderer security gate is cleared by an independently repeatable
|
|
5
|
+
source build with patched dependencies. No npm publication has occurred.
|
|
6
|
+
|
|
7
|
+
## Changes that cleared the gate
|
|
8
|
+
|
|
9
|
+
The renderer is rebuilt from Mermaid 12.1.0 at upstream commit
|
|
10
|
+
`21f72f07ea22c0af48a3149c550654e80d8e40cb`. The verified source archive,
|
|
11
|
+
unmodified upstream schema/Jison plugins and committed dependency lock reproduce
|
|
12
|
+
the vendored executable bytes. DOMPurify is 3.4.16, js-yaml is 4.3.2, and all
|
|
13
|
+
bundled Lodash is 4.18.1. The new parser uses Chevrotain 13.2.0 and Langium 4.4.0;
|
|
14
|
+
the old vulnerable nested Lodash dependency is gone.
|
|
15
|
+
|
|
16
|
+
The exact-version registry audit reports no known advisories for the 79 recorded
|
|
17
|
+
renderer package versions, including dependencies inside 32 compiled parser
|
|
18
|
+
chunks. Both the library's dependency tree and the renderer build dependency tree
|
|
19
|
+
audit clean. Registry signatures and available provenance for the library's
|
|
20
|
+
installed dependencies verify. Recheck these time-sensitive results before
|
|
21
|
+
publication; an audit is not a penetration test.
|
|
22
|
+
|
|
23
|
+
The retained license inventory covers those 79 entries. Original archive bytes,
|
|
24
|
+
parser source-map identities and flattened vscode-uri/path-browserify sources
|
|
25
|
+
verify. Full notices remain embedded in the renderer for offline exports. ELK's
|
|
26
|
+
EPL-2.0 text, copyright and source availability links are included. DOMPurify's
|
|
27
|
+
Apache-2.0 alternative is selected. See [third-party notices](../THIRD_PARTY_NOTICES.md)
|
|
28
|
+
and [the renderer manifest](../viewer/vendor/manifest.json).
|
|
29
|
+
|
|
30
|
+
## Required candidate evidence
|
|
31
|
+
|
|
32
|
+
`npm run release:prepare` requires a clean committed checkout, then runs:
|
|
33
|
+
|
|
34
|
+
- Formatting and all 58 tests, including actual flow/state/sequence SVG rendering.
|
|
35
|
+
- Library advisory/signature checks, a clean renderer rebuild, archive license
|
|
36
|
+
verification, the exact bundled-version audit and build dependency audit.
|
|
37
|
+
- Desktop/mobile Chromium flows over HTTP and offline save/reload.
|
|
38
|
+
- A fresh install of the exact tarball: public import, executable CLI, scaffold,
|
|
39
|
+
ten Codex/Claude skill copies, validation, scoped context, linked checks,
|
|
40
|
+
evidence freshness, snapshot/diff and portable export.
|
|
41
|
+
- Installed-package HTTP and offline browser flows with diagrams and linked types.
|
|
42
|
+
|
|
43
|
+
It writes `artifacts/release/mhproto-0.8.0-preview.0.tgz` and a manifest containing
|
|
44
|
+
its source commit, SHA-256, SHA-512 integrity and complete packed file list.
|
|
45
|
+
Website source, test fixtures, build tooling and credentials are excluded.
|
|
46
|
+
GitHub runs the Linux/macOS, Node 22/24 matrix, audits, renderer verification,
|
|
47
|
+
desktop/mobile browser suite and packed-consumer smoke for the release commit.
|
|
48
|
+
Require all jobs to pass before publication.
|
|
49
|
+
|
|
50
|
+
## Remaining publication steps and limits
|
|
51
|
+
|
|
52
|
+
This machine has no npm login (`npm whoami` returned ENEEDAUTH). The `mhproto` name
|
|
53
|
+
returned E404, which is not a reservation or ownership guarantee. Publication
|
|
54
|
+
requires the package owner's npm authentication, approval of the tested archive,
|
|
55
|
+
and a final current audit/name check. Follow [the publishing steps](publishing.md).
|
|
56
|
+
|
|
57
|
+
Node 22 and 24 on Linux/macOS are the tested targets. Windows and browsers other
|
|
58
|
+
than Chromium remain unverified. Mermaid 12's browser targets are Safari/iOS 17.4,
|
|
59
|
+
Chrome/Edge 121 and Firefox 123 or newer. The package remains a development preview:
|
|
60
|
+
check results are evidence, the validator supports a documented OpenAPI/JSON
|
|
61
|
+
Schema subset, evidence does not track external service or tool-version changes,
|
|
62
|
+
and multiple viewer processes do not coordinate attachment writes. Diff reports
|
|
63
|
+
contract changes, not a breaking-change classification.
|
|
64
|
+
|
|
65
|
+
The website is maintained in a separate private repository. Its npm installation
|
|
66
|
+
copy must change only after the package becomes available. The
|
|
67
|
+
[dated original review](release-review-2026-10-02.md) preserves earlier findings
|
|
68
|
+
and historical limitations; its old release gates are superseded here.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# MHProto viewer design
|
|
2
|
+
|
|
3
|
+
Start with the feature the developer is working on, its app route, and the data exchanged to implement it.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
- Sidebar: [mh] logo linked to https://mhproto.dev/, Project → Impostor, Features → Daily case (blue link). Sources stays in the sidebar footer.
|
|
8
|
+
- Search at the top of every page.
|
|
9
|
+
- Feature overview: title, product/logic description, relative URL, API visible by default, play-state diagram, then Checks.
|
|
10
|
+
- Endpoint page: back to the feature, method/path, purpose, copyable page link, inline request/response types, attached behaviour, useful diagrams, errors, examples and Checks.
|
|
11
|
+
- Type names, Check and Sources links open pages. No tabs or modals.
|
|
12
|
+
|
|
13
|
+
## Reading flow
|
|
14
|
+
|
|
15
|
+
Read what the page loads and shows. Scan the endpoints in client-use order. Read request/response objects beside each endpoint; open it for complete behaviour and failures. Expand a nested object in place when its fields matter. Follow a rule or check through a stable URL.
|
|
16
|
+
|
|
17
|
+
Passing checks and rules without checks are compact disclosures below the API. Failures, unchecked results and stale results are surfaced directly. Full commands and raw payloads stay deferred.
|
|
18
|
+
|
|
19
|
+
## Diagrams
|
|
20
|
+
|
|
21
|
+
Use Mermaid for state transitions, UI decisions, start/retry idempotence, action races and delayed public reveal. Avoid diagrams that repeat a trivial request/response. Mermaid fences and endpoint diagrams render using the bundled runtime, with white fills, black text and neutral lines. Source is available separately. Invalid syntax must not prevent reading the page.
|
|
22
|
+
|
|
23
|
+
The pilot uses six diagrams: play states, page-loading branches, retrying a start, overlapping actions, tap eligibility/transitions, and public reveal timing.
|
|
24
|
+
|
|
25
|
+
## Visual system
|
|
26
|
+
|
|
27
|
+
White background, near-black text, neutral separators. Blue links and purple visited links. Colour accents are limited to HTTP methods, focus, errors and pale-yellow expandable object placeholders. Signature fields stay inline. Type names link to definitions and usage backlinks; no separate shared-type catalogue.
|
|
28
|
+
|
|
29
|
+
## Acceptance
|
|
30
|
+
|
|
31
|
+
- Search is the first main-page control; the project and feature are clear in the sidebar.
|
|
32
|
+
- Daily case describes real client behaviour and shows /daily.
|
|
33
|
+
- API and object signatures are visible without opening a tab or accordion.
|
|
34
|
+
- Every endpoint has a directly loadable URL; Back returns to the feature.
|
|
35
|
+
- Behaviour is attached to endpoints, including privacy, preconditions and failures.
|
|
36
|
+
- Nested fields expand in context, with nullable/optional distinctions retained.
|
|
37
|
+
- Checks appear below API, with freshness and coverage limits clear.
|
|
38
|
+
- Flow, state and sequence diagrams render, including loops and branching.
|
|
39
|
+
- A broken diagram retains its source and does not break navigation.
|
|
40
|
+
- Responsive layout stacks request/response objects on narrow screens.
|
|
41
|
+
|
|
42
|
+
DOM tests cover navigation and actual Mermaid SVG rendering using simulated text measurements. Desktop/mobile Chromium release flows now cover HTTP navigation and offline export/save/reload; non-Chromium browser flows remain unverified.
|
|
43
|
+
|
|
44
|
+
## Visual attachment flow
|
|
45
|
+
|
|
46
|
+
Use the single `+` after a feature/endpoint description, scenario, rule or check text block, or directly alongside a Request/Response header. Attach one image/PDF or design link, give it a descriptive title and optionally note the state or source. The result appears beneath that block/header. Object signatures, nested fields and Path/JSON-body labels do not offer attachment actions. Existing field/shared-object references are displayed beneath the matching header with their field path or type name; their metadata is retained.
|
|
47
|
+
|
|
48
|
+
The workspace viewer writes files and metadata to the app. The exported preview keeps added visuals in memory until Save preview downloads the amended HTML. The footer and save action communicate that state. Existing attachments are embedded when exporting; their bytes live in a separate registry, outside the project model and agent context packets. Images load lazily; external design apps are linked instead of embedded.
|
|
49
|
+
|
|
50
|
+
Collapsed objects show only `{...}` in pale yellow. Keep optional markers and nullable/array types alongside it. Do not squeeze nested keys into that placeholder.
|
|
51
|
+
|
|
52
|
+
## Attachment ownership (0.4.1)
|
|
53
|
+
|
|
54
|
+
One component owns the text/header, its single creation button, a read-only gallery and its editor. An explicit placement policy permits only text blocks and Request/Response headers to create controls. A page-scoped target registry gives repeated semantic targets one editing owner. The schema renderer has no attachment API or project/media dependency.
|
|
55
|
+
|
|
56
|
+
Hover and keyboard focus styles address the creation button directly inside its text/header zone. They do not use API-column, field, gallery or ancestor-section hover selectors. Zones do not nest. This prevents hovering over a field from revealing a header action or multiple schema actions.
|
|
57
|
+
|
|
58
|
+
Regression checks reproduce a request with path parameters plus a shared JSON-body schema, a response with nested shared objects, expanded fields and reused types. They assert one creation control per header, none inside signatures, one matching hover action on a text/header zone and none on fields/columns. Repeated rule targets retain one owner. Existing field/type visuals stay accessible under the header. Cancel restores keyboard focus to the original control. DOM/CSS selector tests do not claim painted browser layout validation.
|
|
59
|
+
|
|
60
|
+
## Type reading flow (0.5)
|
|
61
|
+
|
|
62
|
+
Read `GetTodayQuery { date: string; deviceId: string; }` below Request → Query and `DailyTodayResponse { ... }` below Response. Nested `case` and `play` fields show clickable `DailyCaseView` and `DailyPlayState` names beside their pale-yellow `{...}` expanders. Array items and named enum types are linked too. Keep required/optional markers, nullability and constraints visible.
|
|
63
|
+
|
|
64
|
+
Follow a name to its definition page. Used in links back to every feature overview and endpoint whose request or response includes the type, including nested uses. Referenced by types links to other definitions containing it. Endpoint links include the request part or response status. The copy action and URL make the page shareable; search finds types as well. No type catalogue is added to navigation.
|
|
65
|
+
|
|
66
|
+
The index is a separate logical layer from schema rendering and attachment ownership. Source identity uses the interface file and type/declaration id, not structural similarity or just the name. Anonymous structures get deterministic viewer labels with an explicit source note; they do not become new normative schemas. Recursive type relationships stop at visited identities. The index stays in memory and is regenerated for a new model, rather than expanding the serialized model or agent context.
|
|
67
|
+
|
|
68
|
+
Acceptance: existing type names are preserved; root/nested fields link; generated labels resolve to the exact inline structure; required/optional markers survive; every use has an endpoint and overview backlink; incoming type links are present; shared interfaces link across features while unrelated homonyms stay separate; recursive schemas terminate; direct links, search, standalone export and the single-attachment-owner rules keep working.
|
|
69
|
+
|
|
70
|
+
## Iteration review (0.6)
|
|
71
|
+
|
|
72
|
+
Keep the reading view unchanged until the reader enters Changes. Its sidebar link shows a compact item count when a baseline exists. The Changes page identifies the baseline, shows added/changed/removed counts, and lists only changed items grouped by feature. A category dropdown narrows the list. No modal or raw project dump is introduced.
|
|
73
|
+
|
|
74
|
+
Choose a snapshot JSON/earlier preview, or use the current spec as the iteration baseline. Open a change for a Before/Now table containing only changed fields. Open its current endpoint/type/feature/check page with comparison highlights enabled. Keep named type links and nested field expansion; show added/changed/removed field labels and changed item badges. Use words with pale green/yellow/red accents so colour is not the only signal. Hide highlights restores ordinary reading and preserves a rule deep link. Removed items retain their old definition on their change page.
|
|
75
|
+
|
|
76
|
+
Diff computation is separate from rendering, type indexing and attachment ownership. The same semantic comparator runs in CLI/server/browser. Stable change identities use capability, kind and entity id, never row positions. A saved baseline is a detached snapshot; updates to live visuals cannot silently alter it. Metadata/evidence churn stays outside the comparator. No attachment controls appear in comparison pages or object fields. Type pages still provide affected-endpoint backlinks for indirect schema changes.
|
|
77
|
+
|
|
78
|
+
The live viewer refreshes both model and baseline; a file selected by the reader stays local to that viewer. Explicit --against comparisons are protected from the baseline reset action. Standalone exports embed their baseline and work offline; Save preview retains a new/selected baseline alongside visual attachments. Earlier HTML imports are parsed as inert model data. Invalid imports keep the prior comparison and show an inline error.
|
|
79
|
+
|
|
80
|
+
Acceptance: compare additions/changes/removals, including required/nullable/constraint edits; retain removed definitions; link to current pages and preserve comparison URLs; omit evidence/key-order/set-order noise; keep null distinct from absence; support legacy/new JSON snapshots and earlier HTML previews; preserve baseline on invalid files; save/reload offline with no network request; keep one attachment owner per text/header.
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mhproto",
|
|
3
|
+
"version": "0.8.0-preview.0",
|
|
4
|
+
"description": "Machine–Human Protocol: a shared contract workspace for humans and coding agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mhproto": "./bin/mhproto.mjs"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./src/core.mjs"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"bin",
|
|
14
|
+
"src",
|
|
15
|
+
"viewer",
|
|
16
|
+
"skills",
|
|
17
|
+
"doc",
|
|
18
|
+
"README.md",
|
|
19
|
+
"CONTRIBUTING.md",
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"THIRD_PARTY_NOTICES.md"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "node --test test/*.test.mjs",
|
|
25
|
+
"format": "prettier --write .",
|
|
26
|
+
"format:check": "prettier --check .",
|
|
27
|
+
"check": "npm run format:check && npm test",
|
|
28
|
+
"prepack": "npm run check",
|
|
29
|
+
"test:browser": "node --test test/browser.mjs",
|
|
30
|
+
"verify:vendor": "node scripts/verify-mermaid.mjs && node scripts/verify-mermaid-licenses.mjs",
|
|
31
|
+
"audit:vendor": "node scripts/audit-mermaid.mjs",
|
|
32
|
+
"test:packed": "node test/packed.mjs",
|
|
33
|
+
"release:prepare": "node scripts/prepare-release.mjs"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=22"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"ajv": "^8.17.1",
|
|
40
|
+
"ajv-formats": "^3.0.1",
|
|
41
|
+
"yaml": "^2.8.3"
|
|
42
|
+
},
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"jsdom": "^26.1.0",
|
|
46
|
+
"playwright": "1.63.0",
|
|
47
|
+
"prettier": "3.6.2"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://mhproto.dev/",
|
|
50
|
+
"keywords": [
|
|
51
|
+
"specification",
|
|
52
|
+
"contracts",
|
|
53
|
+
"openapi",
|
|
54
|
+
"agents",
|
|
55
|
+
"spec-driven-development"
|
|
56
|
+
],
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "git+https://github.com/rbsx/mhproto.git"
|
|
60
|
+
},
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/rbsx/mhproto/issues"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public",
|
|
66
|
+
"tag": "next",
|
|
67
|
+
"registry": "https://registry.npmjs.org/"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mhproto-discover
|
|
3
|
+
description: Discover a capability in an existing app and produce source-backed MHProto behaviour, interface and example drafts. Use for adopting MHProto or inspecting a capability before specification work.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MHProto Discover
|
|
7
|
+
|
|
8
|
+
Start with `mhproto context` for the feature index, then `mhproto context --capability ID --operation ID` for the affected endpoint. Load only relevant `--rule`, `--schema`, `--example` or `--check` detail; `--section` narrows a packet. Read every deferred rule group the change touches before editing. Inspect the authoritative source when deciding intent or making a change. Do not load the exported HTML or whole `mhproto inspect` model into the prompt. Visual packets contain references; open images/design links only when needed.
|
|
9
|
+
|
|
10
|
+
Read the project’s AGENTS.md and authoritative product docs, then mhproto.yaml and the relevant capability. Inspect providers, consumers, existing schemas and tests. Reuse an existing OpenAPI 3.1 interface or its generator; do not invent a parallel schema.
|
|
11
|
+
|
|
12
|
+
Record behaviour as confirmed, inferred or unknown with source paths. Preserve existing approval provenance. Reverse-engineered code describes observations; it does not approve requirements. Surface disagreements with product docs. Bound discovery to the requested capability.
|
|
13
|
+
|
|
14
|
+
Write small capability drafts, numbered rules and representative examples, including a failure/recovery case. Leave missing checks and unknown decisions visible. Read ../mhproto-specify/references/format.md for the file model. Run `mhproto check` after changes. Do not alter application behaviour as part of discovery.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mhproto-implement
|
|
3
|
+
description: Implement an agreed MHProto contract in a project while preserving its interfaces and behaviour. Use when the user requests implementation of a specified capability or change.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MHProto Implement
|
|
7
|
+
|
|
8
|
+
Start with `mhproto context` for the feature index, then `mhproto context --capability ID --operation ID` for the affected endpoint. Load only relevant `--rule`, `--schema`, `--example` or `--check` detail; `--section` narrows a packet. Read every deferred rule group the change touches before editing. Inspect the authoritative source when deciding intent or making a change. Do not load the exported HTML or whole `mhproto inspect` model into the prompt. Visual packets contain references; open images/design links only when needed.
|
|
9
|
+
|
|
10
|
+
Read AGENTS.md, the capability spec, interface schemas, examples and checks. Confirm unresolved decisions do not affect the requested work; surface contradictions rather than inventing requirements.
|
|
11
|
+
|
|
12
|
+
Implement the requested delta, following the existing schema source and app conventions. Coordinate consumers/providers through the shared interface. Do not silently change the contract to fit the implementation; propose necessary contract changes explicitly.
|
|
13
|
+
|
|
14
|
+
Keep application tests in their normal locations. Reference rule and example IDs in relevant tests. Use ../mhproto-specify/references/format.md when editing links. Run `mhproto check`, the required app checks and `mhproto verify --capability ID`. Report gaps separately from passing checks.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mhproto-reconcile
|
|
3
|
+
description: Find and reconcile disagreements between MHProto specs, interface schemas, examples and application implementation. Use for contract drift or capability upkeep.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MHProto Reconcile
|
|
7
|
+
|
|
8
|
+
Start with `mhproto context` for the feature index, then `mhproto context --capability ID --operation ID` for the affected endpoint. Load only relevant `--rule`, `--schema`, `--example` or `--check` detail; `--section` narrows a packet. Read every deferred rule group the change touches before editing. Inspect the authoritative source when deciding intent or making a change. Do not load the exported HTML or whole `mhproto inspect` model into the prompt. Visual packets contain references; open images/design links only when needed.
|
|
9
|
+
|
|
10
|
+
Read repository authority/provenance and the capability. Run `mhproto check`, inspect stale evidence and review `mhproto diff` if a baseline exists. Inspect the relevant source and tests to distinguish missing checks, stale generated files, implementation bugs and changed product intent.
|
|
11
|
+
|
|
12
|
+
State each discrepancy with its rule ID and evidence. Fix deterministic tooling or generated-artifact drift within scope. When intent is uncertain, present the decision instead of treating code as automatically authoritative. Preserve existing approvals and human examples.
|
|
13
|
+
|
|
14
|
+
After the authorised resolution, update affected specs, schemas, examples and checks together. Run required app checks and `mhproto verify`. State remaining gaps. Read ../mhproto-specify/references/format.md for linking conventions.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mhproto-specify
|
|
3
|
+
description: Create or revise a MHProto capability contract before implementing a feature. Use for agreement on behaviour, interfaces, examples and verification expectations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MHProto Specify
|
|
7
|
+
|
|
8
|
+
Start with `mhproto context` for the feature index, then `mhproto context --capability ID --operation ID` for the affected endpoint. Load only relevant `--rule`, `--schema`, `--example` or `--check` detail; `--section` narrows a packet. Read every deferred rule group the change touches before editing. Inspect the authoritative source when deciding intent or making a change. Do not load the exported HTML or whole `mhproto inspect` model into the prompt. Visual packets contain references; open images/design links only when needed.
|
|
9
|
+
|
|
10
|
+
Read authoritative repository docs and the current capability. Preserve the user’s scope and established decisions. Read references/format.md.
|
|
11
|
+
|
|
12
|
+
Run `mhproto snapshot` before the first change if no baseline exists; do not replace an existing baseline without intent. Propose precise numbered rules, permissions, state transitions, failure/recovery behaviour and concrete examples. Link interfaces to rule IDs. Reuse the app’s schema source/generator rather than editing generated OpenAPI by hand.
|
|
13
|
+
|
|
14
|
+
Separate intended behaviour from observed implementation and unresolved decisions. Identify affected providers/consumers and compatibility consequences. Present the contract delta with `mhproto diff`; resolve decisions that affect implementation with the user, without asking them to reconfirm previously agreed behaviour.
|
|
15
|
+
|
|
16
|
+
Run `mhproto check`. Unbound rules stay visibly unchecked. Changing a spec is not evidence that the app implements it.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# MHProto V0 file format
|
|
2
|
+
|
|
3
|
+
`mhproto.yaml` uses version: 1, name, system (Markdown path), and capabilities.
|
|
4
|
+
Each capability has id (lowercase slug), title, spec (Markdown), interface (OpenAPI 3.1 JSON/YAML), examples (YAML), checks (YAML), sources (tracked implementation files/directories), optional owner, description and gaps.
|
|
5
|
+
All paths are relative to the application root and cannot escape it through symlinks.
|
|
6
|
+
|
|
7
|
+
Rules are Markdown bullets: `- **DAILY-PLAY-1** Behaviour statement.` Indented continuation lines belong to that rule. Link OpenAPI operations through `x-mhproto-rules: [DAILY-PLAY-1]`; existing `x-clauses` also works. Local JSON Schema references are supported. Remote references and OpenAPI 3.0 are not supported in V0. Types stay in the established schema source.
|
|
8
|
+
|
|
9
|
+
An examples.yaml file has an `examples` array. Each entry has id, title, rules (rule IDs), operations (operationIds), given, when and then. Optional request: {operation, body} and response: {status, body} payloads are schema-checked; rejected input scenarios describe the invalid payload in prose instead of claiming it conforms.
|
|
10
|
+
|
|
11
|
+
A checks.yaml file has a `checks` array. Each entry has id, title, rules, examples, files and command (argv array), optional description, env and timeoutMs. Commands execute from the app root without a shell, with the inherited environment plus configured env. They are not sandboxed; run verification only in repositories whose check commands you trust. timeoutMs must be a positive integer (default 60,000).
|
|
12
|
+
For Node’s runner, use runner: node-test, exact testNames, and command: [node, --import, tsx, --test, --test-reporter, "{mhprotoNodeReporter}", relative/test.ts]. Add --test-name-pattern when useful. The reporter requires completed passing events for exact test names, rejects skipped/TODO/missing tests, and fails closed on malformed or oversized (1 MB) structured output. Include test files in tracked sources.
|
|
13
|
+
|
|
14
|
+
Evidence is local in .mhproto/evidence/<capability>.json and carries a digest of the contract and tracked implementation. Inputs include mhproto.yaml, the system document, capability files, tracked sources and declared check files. It becomes stale when an input changes. A passing command is evidence, not a proof of requirements correctness or complete coverage.
|
|
15
|
+
|
|
16
|
+
`mhproto snapshot` stores .mhproto/baseline.json. `mhproto diff` compares rules, operations, schemas, examples and checks. Contract snapshots contain app documentation; review before sharing.
|
|
17
|
+
|
|
18
|
+
Visual references are optional in `mhproto/visuals.yaml`, as a `visuals` array. Each entry has id, title, kind (screenshot/design), target and one of file (local image/PDF) or url (HTTPS design link). Optional mime, caption and sha256 describe the file. Targets have capability and kind: feature; operation/request/response plus operation id; schema plus schema name; example/rule/check plus id. Response targets also specify status. Field targets have operation id, scope (request/response), JSON-pointer path and response status when applicable. Request paths start at /body, /path, /query, /header or /cookie; response paths start at the body. Use `*` for array items, for example /rounds/_/answers/_/text. Uploaded files live in mhproto/assets. Treat visuals as references, not new normative rules; conflicting designs require a stated contract decision.
|
|
19
|
+
|
|
20
|
+
`mhproto context` emits a compact feature index. `--capability ID --operation ID` retrieves an endpoint packet with exact directly linked rules, semantic preconditions, error codes, root request/response structures, scenario summaries, check status and visual metadata. Nested schema refs and named rule groups are deferred explicitly. `--schema NAME`, `--rule ID`, `--example ID`, `--check ID` or `--visual ID` retrieves detail. `--section request,response,behaviour,errors,examples,checks,visuals,sources` limits fields. A 12,000-character default budget fails with refinement guidance rather than truncating; increase --max-chars deliberately. Evidence freshness is retained, while full execution logs and image bytes are excluded. --stats reports text sizes on stderr, not model token counts.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mhproto-verify
|
|
3
|
+
description: Write and run MHProto checks linked to agreed behaviour and examples, and inspect evidence gaps. Use for verifying a capability or adding contract-based tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MHProto Verify
|
|
7
|
+
|
|
8
|
+
Start with `mhproto context` for the feature index, then `mhproto context --capability ID --operation ID` for the affected endpoint. Load only relevant `--rule`, `--schema`, `--example` or `--check` detail; `--section` narrows a packet. Read every deferred rule group the change touches before editing. Inspect the authoritative source when deciding intent or making a change. Do not load the exported HTML or whole `mhproto inspect` model into the prompt. Visual packets contain references; open images/design links only when needed.
|
|
9
|
+
|
|
10
|
+
Read the agreed rules and examples before implementation details. Derive assertions from observable outcomes, not private helper structure. Cover the requested failure/recovery paths and preserve human-provided examples as the test oracle.
|
|
11
|
+
|
|
12
|
+
Keep tests in the existing runner. Link each check to precise rules/examples and an argv command in checks.yaml. For Node tests, use the structured reporter and exact testNames; skipped, TODO or missing tests must fail verification. Generic command success proves only that command passed. Label prompt-text checks separately from live model evaluation.
|
|
13
|
+
|
|
14
|
+
Use ../mhproto-specify/references/format.md. Run `mhproto check` then `mhproto verify --capability ID`. Inspect failures and the report, including freshness and missing test names. Do not claim all linked behaviour is proven, or run paid/live-production checks unless those actions are in scope. Do not rewrite the spec to make a failing implementation pass.
|