chore(docs): reconcile vapor + capability-gating drift across M2-M5 - #68
Merged
brunota20 merged 2 commits intoJun 24, 2026
Merged
Conversation
Reconciles the M2-M5 design docs with what shipped at 0.2. The conformance audit at bruno-brain/wiki/projects/shepherd-audits/m2-m5-conformance-2026-06-23.md flagged five vapor items - features documented as part of 0.2 that do not exist in code (per ADR-0009). This commit removes the claims that they ship today and re-frames each as future direction with a clear "not in 0.2 scope" qualifier. No code is touched; runtime behaviour is unchanged. Vapor items addressed: - #[nexum::module] / #[shepherd::module] proc macros. Absent in code; the shipped surface is the host-trait seam from ADR-0009. doc 00 SDK table and repo-structure block updated; doc 01 author-experience sections framed as future direction; doc 05 (north-star) status box rewritten to point at ADR-0009; doc 07 RPC-design adds an SDK-shape note pointing at ADR-0009; doc 08 SDK-layering diagram caption marked as 0.3+ target. - cargo-nexum CLI. Absent in code. doc 00 SDK table / repo structure no longer lists it; doc 05 CLI subsection prefaced as future direction. - Separate nexum-sdk crate. Only shepherd-sdk + shepherd-sdk-test ship. doc 00 SDK section, doc 05 status box, doc 08 platform-generalisation summary table and SDK-layering subsection all updated to describe the one-crate shipped reality with the two-crate split as future direction. - :8080/health JSON endpoint. Engine binds no health port; only the metrics scrape exists. doc 00 observability table and doc 06 Health-Checks section rewritten to describe the 0.2 liveness signal (metrics scrape + tracing JSON + Docker TCP probe) with the JSON endpoint flagged as future direction. - Per-module [module.resources] manifest caps. Not parsed; the engine uses compile-time DEFAULT_FUEL_PER_EVENT (1B) and DEFAULT_MEMORY_LIMIT (64 MiB) from crates/nexum-engine/src/runtime/limits.rs. doc 00 module package block dropped the [module.resources] section + added a future- direction note; doc 02 manifest example updated and the misnamed nexum.toml replaced with module.toml (per ADR-0001); doc 06 Resource- Enforcement intro and Memory / Storage subsections updated to use the shipped global defaults; the runtime config TOML at end of doc 06 flagged [runtime.defaults.resources] / [runtime.defaults.restart] as future direction. Drift-while-in-there: - doc 02 renamed nexum.toml -> module.toml per ADR-0001 (decision shipped, doc was stale). - doc 06 Deployment-Docker block: replaced the speculative `nexum` binary + 8080/9090 ports with the actual shipped Dockerfile shape (nexum- engine binary, tini PID1, port 9100 for metrics; see docs/deployment/docker.md for the canonical operator config). - doc 00 observability table updated metrics port 9090 -> 9100 to match the shipped Dockerfile. - doc 01 guest-experience subsections marked as future-direction macro form, pointing at sdk.md + the example modules for the shipped pattern. - docs/migration/0.1-to-0.2.md crate-rename paragraph no longer lists nexum-sdk + cargo-nexum as shipped 0.2 siblings. The 0.2 capability model is link-time, not per-call. That spec drift is in docs/diagrams/diagrams.md and is addressed in the next commit. ## AI assistance disclosure AI Assistance: Claude Code (Opus 4.7) made these doc edits by cross- referencing the conformance audit findings against the shipped code at HEAD of deploy/cow-1076-observe-on-m5. A human (Bruno) is accountable for the result and will review before requesting mfw's review.
The 0.2 capability model is link-time, not per-call. Updates two
captions in docs/diagrams/diagrams.md that previously claimed the
HostState performs a per-call manifest.required check and that per-call
gating is the M2 target. Neither claim matches the shipped code.
What 0.2 actually enforces:
- At boot, manifest::enforce_capabilities (in
crates/nexum-engine/src/manifest/capabilities.rs) cross-checks every
capability-bearing WIT import of the component against
[capabilities].required + [capabilities].optional in module.toml, with
names validated against KNOWN_CAPABILITIES.
- A module that imports a capability it did not declare fails
instantiation - it never reaches dispatch.
- This is structurally equivalent to per-call gating for the 0.2
capability set: an undeclared capability cannot link the relevant WIT,
so unauthorised calls fail at component link rather than at per-call
dispatch.
Per-call gating in HostState (returning host-error { kind: denied } per
invocation, useful for finer-grained policies or capability revocation
at runtime) remains a future direction for 0.3+ if a richer threat
model demands it; the design space is preserved in the diagram-7
caption rather than deleted.
Files touched:
- docs/diagrams/diagrams.md: diagram-2 (class diagram) caption for
HostState reworded to say "Capability authorisation is enforced at
boot (link-time) by manifest::enforce_capabilities, not per call - see
diagram 7 for the dispatch path"; diagram-7 (Capability Dispatch)
HostState row rewritten with the full link-time-vs-per-call
explanation pointing at the actual code path.
No code changes. No ADR edits (ADR-0006 does not actually promise
per-call dispatch; it only references KNOWN_CAPABILITIES at boot, which
ships).
## AI assistance disclosure
AI Assistance: Claude Code (Opus 4.7) made these doc edits by cross-
referencing the conformance audit findings against
crates/nexum-engine/src/manifest/capabilities.rs at HEAD of
deploy/cow-1076-observe-on-m5.
This was referenced Jun 24, 2026
brunota20
added a commit
that referenced
this pull request
Jun 25, 2026
) Squash of PR #68 - 9 markdown files reconciled (5 vapor items rephrased as future direction + capability-gating diagrams aligned to link-time enforcement). Verified: cargo doc --workspace --no-deps clean.
brunota20
added a commit
that referenced
this pull request
Jun 25, 2026
) Squash of PR #68 - 9 markdown files reconciled (5 vapor items rephrased as future direction + capability-gating diagrams aligned to link-time enforcement). Verified: cargo doc --workspace --no-deps clean.
brunota20
added a commit
that referenced
this pull request
Jun 25, 2026
) Squash of PR #68 - 9 markdown files reconciled (5 vapor items rephrased as future direction + capability-gating diagrams aligned to link-time enforcement). Verified: cargo doc --workspace --no-deps clean.
brunota20
added a commit
that referenced
this pull request
Jun 25, 2026
) Squash of PR #68 - 9 markdown files reconciled (5 vapor items rephrased as future direction + capability-gating diagrams aligned to link-time enforcement). Verified: cargo doc --workspace --no-deps clean.
brunota20
added a commit
that referenced
this pull request
Jun 26, 2026
) Squash of PR #68 - 9 markdown files reconciled (5 vapor items rephrased as future direction + capability-gating diagrams aligned to link-time enforcement). Verified: cargo doc --workspace --no-deps clean.
jean-neiverth
pushed a commit
that referenced
this pull request
Jun 29, 2026
) Squash of PR #68 - 9 markdown files reconciled (5 vapor items rephrased as future direction + capability-gating diagrams aligned to link-time enforcement). Verified: cargo doc --workspace --no-deps clean.
jean-neiverth
pushed a commit
that referenced
this pull request
Jun 30, 2026
) Squash of PR #68 - 9 markdown files reconciled (5 vapor items rephrased as future direction + capability-gating diagrams aligned to link-time enforcement). Verified: cargo doc --workspace --no-deps clean.
jean-neiverth
pushed a commit
that referenced
this pull request
Jun 30, 2026
) Squash of PR #68 - 9 markdown files reconciled (5 vapor items rephrased as future direction + capability-gating diagrams aligned to link-time enforcement). Verified: cargo doc --workspace --no-deps clean.
jean-neiverth
pushed a commit
that referenced
this pull request
Jun 30, 2026
) Squash of PR #68 - 9 markdown files reconciled (5 vapor items rephrased as future direction + capability-gating diagrams aligned to link-time enforcement). Verified: cargo doc --workspace --no-deps clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Reconciles the M2-M5 design docs with shipped code. Removes vapor (features described in docs but absent from code per ADR-0009) and aligns the capability-gating section to reflect what 0.2 actually validates (boot-time link-time enforcement, not per-call dispatch). Documentation only - no Rust source files touched, runtime behaviour unchanged.
Two logical commits:
chore(docs): vapor sweep - mark unshipped features as future direction- all eight non-diagram docs.chore(docs): align capability gating to shipped link-time enforcement-docs/diagrams/diagrams.mdonly.Why
Pre-empts the doc-and-claims findings that would otherwise burn in mfw78's review. The conformance check at
bruno-brain/wiki/projects/shepherd-audits/m2-m5-conformance-2026-06-23.mdflagged five vapor items - the#[nexum::module]/#[shepherd::module]proc macros, thecargo-nexumcargo subcommand, a separatenexum-sdkcrate, the:8080/healthJSON endpoint, and per-module[module.resources]manifest caps - and one spec drift (per-call capability dispatch claimed indocs/diagrams/diagrams.md). Mfw78's recurring theme #3 is "docs must match shipped code, no drift", so this PR closes the gap without changing any runtime behaviour.ADR-0009 already captured the M3 architectural decision (host-trait seam supersedes the proc-macro design). This PR teaches the rest of the doc set to point at ADR-0009 rather than describe the superseded shape as if it ships.
Changes
docs/00-overview.md:[module.resources]section; added a "not in 0.2 scope" future-direction note covering both the resource caps and theoptionaltrap-stub fallback.shepherd-sdk+shepherd-sdk-test, host-trait seam per ADR-0009, helpers, prelude) replaces the previous two-crate proc-macro table; the layered split + macros +cargo-nexumare framed as future direction.:8080/healthrow; explained that 0.2 liveness is signalled by the:9100/metricsscrape and the structuredtracingJSON; flagged the JSON endpoint as future direction.docs/02-modules-events-packaging.md: renamednexum.toml->module.toml(per ADR-0001); dropped[module.resources]/[module.restart]from the example manifest; updated[capabilities]prose to describe actual boot-time link-time enforcement; added future-direction note.docs/05-sdk-design.md: top status box rewritten to flag the entire doc as 0.3+ north-star and point at ADR-0009;cargo-nexumCLI subsection prefaced "not in 0.2 scope".docs/06-production-hardening.md: resource-enforcement intro updated to use compile-time globals (DEFAULT_FUEL_PER_EVENT,DEFAULT_MEMORY_LIMITfromcrates/nexum-engine/src/runtime/limits.rs); memory + storage subsections rewritten to describe what the engine actually does; Health-Checks section reframed (JSON endpoint as future direction); deployment-Docker block replaced with the shipped shape (port 9100, tini,nexum-enginebinary).docs/01-runtime-environment.md: guest-side author experience sections prefaced as future-direction macro form pointing atsdk.md.docs/07-rpc-namespace-design.md: SDK-shape note at top: macro-driven authoring model is future direction; ADR-0009 is the shipped seam.docs/08-platform-generalisation.md: SDK-layering subsection updated to flag the two-crate split as 0.3+ target; summary table updated accordingly.docs/migration/0.1-to-0.2.md: engine-crate-rename paragraph no longer listsnexum-sdk+cargo-nexumas shipped.docs/diagrams/diagrams.md: diagram-2 class caption and diagram-7 (Capability Dispatch) caption rewritten to describe link-time enforcement (manifest::enforce_capabilitiesagainstKNOWN_CAPABILITIES); per-call dispatch preserved as 0.3+ direction.Breaking changes
None. Documentation-only.
Testing
cargo doc --workspace --no-depsclean (one pre-existing warning incrates/shepherd-sdk/src/cow/app_data.rs:19for an unresolvedEMPTY_APP_DATA_JSONlink; that source file is not touched by this PR and is out of scope).crates/nexum-engine/src/manifest/capabilities.rs::enforce_capabilitiesis link-time-only againstKNOWN_CAPABILITIES+ manifestrequiredunionoptional, with no per-call dispatch hook inHostState.Notes for reviewers
The 0.2 capability model uses link-time enforcement: an undeclared capability prevents the module from importing the relevant WIT, so unauthorised calls fail at component link rather than at per-call dispatch. Functionally equivalent for the current 0.2 capability set, but the design space for per-call dispatch (runtime capability revocation, finer-grained policies under a richer threat model) remains open for 0.3+. The diagram-7 caption explicitly preserves that direction rather than deleting it.
Base branch is
deploy/cow-1076-observe-on-m5because that is where the M2-M5 docs being reconciled actually live; opening this againstmainwould surface a multi-milestone diff that has nothing to do with this PR.Two items the audit flagged but were intentionally not touched:
KNOWN_CAPABILITIESdoes not gain"twap"/"ethflow"entries (delivered). The ADR does not actually promise per-call gating - that claim was only indocs/diagrams/diagrams.md.Deviations from the brief
docs/diagrams/diagrams.md, so the capability-gating fix landed there only. No ADR file was modified.docs/diagrams/diagrams.mdthe capability-dispatch diagram is numbered 7 (diagram 8 is the repo-dependency map). Edits applied to diagram 7 + the diagram-2 class caption that also carried the stale claim. Brain-sidearchitecture.mdwas not touched per the brief.AI assistance disclosure
AI Assistance: Claude Code (Opus 4.7) made these doc edits by cross-referencing the conformance audit findings against the shipped code at HEAD of
deploy/cow-1076-observe-on-m5. A human (Bruno) is accountable for the result and will review before requesting mfw's review.