mjdi docsv0.10.0latest
mjdi 0.9.0 release report — P0: trust, correctness, and release readiness
This report covers deliverables A–F of the P0 mission: the implementation
Source: mjdi/docs/release-report-0.9.0.md
This report covers deliverables A–F of the P0 mission: the implementation
report per enhancement, the architecture integration, the API delta, the
test report with exact counts, the compatibility report, and the release
readiness classification. Every test figure in this report was actually
executed in the 0.9.0 release environment against mojo 1.2.0 (2016d0cd);
nothing is reported as passing that did not run.
Baseline note. The mission named v0.7.0 as the baseline. The repository the work started from was v0.8.0 (the complete P1 set had already been delivered on top of 0.7.0, including the graph tooling, guards, observability, templates, and the diagnostic catalog). The P0 hardening was implemented on that state and released as 0.9.0.
A. Implementation report
P0-01 — Single source of truth for release metadata
- What was implemented.
release/manifest.json(mjdi.release/1) is the canonical manifest: version, previous version, title, release date, target compiler (name, version, exact build), the complete doc-version list (historical versions preserved), and the platform evidence tiers.scripts/validate_metadata.pyvalidates every synced location in one pass (CHANGELOG heading, websitepackage.json,docs-versions.ts,docs-server.tsnav mappings,docs/index.md,README.md,llms.txt/llms-full.txtversioned URL, catalog schema marker) plus--tagequality for release publishing; it treats missing/unreadable files as problems rather than crashes.scripts/release_update_docs.pypropagates a version bump into the mechanical locations. - Files.
release/manifest.json(new),scripts/validate_metadata.py(new),scripts/release_update_docs.py(new), website/package.json, website/src/lib/docs-versions.ts, website/src/lib/docs-server.ts, docs/index.md, README.md, CHANGELOG.md, docs/changelog.md, llms.txt, llms-full.txt. - Tests.
tests/python/test_metadata.py(10 cases): manifest structure, newest-first unique doc versions, historical versions present, compiler target recorded, matrix tiers valid, the validator passing on the repository, drift detection proven on a perturbed copy (a9.9.9manifest in a temp tree fails with the version in the output), tag-mismatch detection, matching-tag acceptance. - Result.
validate_metadata.pygreen on the repository; the CImetadatajob runs it on every push;release.ymlruns it with--tagbefore packaging. - Limitations. The validator checks text agreement, not semantic correctness of the changelog body; the release prose remains human-written by design.
P0-02 — Compiler compatibility matrix
- What was implemented. The evidence-tier policy:
verified(linux-x86_64 — the full suite ran on real toolchain in the release environment),ci-verified(linux-aarch64, macos-arm64 — SDK-published platforms with CI matrix jobs, no local hardware),experimental(emulation),unsupported(osx-x86_64, windows — no SDK published). Tiers are declared inrelease/manifest.jsonand documented with the recorded evidence indocs/compiler-compatibility.md. The CI matrix labels each job with its tier and the linux-x64 job is the required release gate. - Files.
docs/compiler-compatibility.md(new), release/manifest.json, .github/workflows/ci.yml. - Tests. The matrix-tier validation lives in
tests/python/test_metadata.py; the platform evidence is the CI jobs themselves (linux-x64: executed locally as reported below; the other two tiers are explicitly NOT RUN in the release environment — no ARM64 or macOS host exists here — which is exactly what the tier system records rather than hiding). A qemu-user emulation attempt was made and recorded: no emulator is available in the release environment, so the aarch64 tier stays ci-verified. - Limitations. mjdi cannot produce real-hardware evidence for platforms it has no access to; the matrix says so instead of claiming support.
P0-03 — Lifecycle safety diagnostics
- What was implemented. The
debug_tracking: Bool = Falsespecialization parameter (fifth, defaulted) onContainerandScope, propagated throughcreate_scopeand the guards/testing helpers. The tracked specializations record cache insertions and releases in a boundedDebugLog[64](new type inmjdi/observability.mojo, pull-model sibling ofTraceLog);debug_report()/debug_count()read the log;was_closed()reports the close state. Dropping a tracked owner without close while cached instances exist prints MJDI-D001 (container) / MJDI-D002 (scope) at drop time, listing the affected services and stating that theirpre_destructhooks did not run. - Compiler experiment.
experiments/exp10_deinit_diagnostics.mojoverifies on the target compiler:__deinit__can call mutable methods on fields of the dying value,printinside__deinit__works, thecomptime ifcompiles the diagnostic away in the untracked specialization, and (discovered) Mojo ends value lifetimes at last use — the diagnostic fires at the owner's death point, which the docs state. - Files. mjdi/container.mojo, mjdi/observability.mojo (DebugLog), mjdi/guards.mojo, mjdi/testing.mojo, experiments/exp10 (new), the guard and helper signature propagation.
- Tests.
tests/test_debug_tracking.mojo(default specialization silent, tracked insert/release/close entries, scope lifecycle, closed- and empty-cache silence contracts) andtests/golden_debug_diagnostics.mojo+ a runner golden check asserting both MJDI-D001 and MJDI-D002 in the output. - Limitations. Destructor diagnostics are print-only (no raise, no recording — the log dies with its owner); no push-model callbacks (the compiler cannot store capturing closures here); value slots, transients, linear services, and consumer copies are deliberately not tracked.
P0-04 — Deterministic close semantics
- What was implemented. The close contract is now explicit in the API
docs, the module docstrings, and
docs/close-semantics.md, and pinned by a dedicated test file. Runtime changes are minimal and additive: the informational_closedflag (withwas_closed()) and the debug-log release records. No close-path behavior changed. - Pinned contract. Reverse-registration-order release; idempotent
repeated close (zero re-releases — no double destruction); valid
re-constructing resolution after close; value slots survive close;
was_closed()transitions; empty-cache close; consumer copies held across close unaffected; container/scope close independence; scopes are one level (noScope.create_scope). - Tests.
tests/test_close_semantics.mojo(all eight contract groups, via traced-event sequencing and counters). - Result. Full suite green with the pinned semantics.
P0-05 — Lifecycle failure policy
- What was implemented. The policy is explicit
(
docs/lifecycle-failure-policy.md):pre_destructis non-raising by contract (the release paths returnNone); cleanup failures must be handled inside the hook; the release walk clears every slot in one pass (a hook cannot abort it); exactly one cleanup attempt per cached lifetime; a raisingpost_constructpropagates, the half-built instance is discarded (nothing cached — pinned via the insertion counter), andpre_destructnever runs for it. - Tests.
tests/test_lifecycle_policy.mojo(exactly-once counts via trace events, sibling release despite a "failing" self-handled hook, repeated-close non-retry, scope spelling, post-construct failure path including the nothing-cached counter and the missing pre_destruct). - Result. Verified; no API change (the non-raising hook signature was already the design — it is now documented as the policy with its rationale).
P0-06 — Validation output contract
- What was implemented. Pinned stable IDs across the whole library:
every diagnostic message now embeds
[diagnostic MJDI-XXX]. The generator (scripts/gen_diagnostics.py) was reworked: IDs are pinned per entry; it scans all library modules for message builders (previously errors.mojo only — five diagnostics were uncataloged); it validates that every cataloged builder embeds its ID and that shared conditions (the registration-/validation-time alias reports) share one ID;--checkis the CI drift gate. The catalog holds 30 entries (E001–E020, R001–R004, A001, D001–D002). The schema gainedmessage_module,emitted_inline,print_only, thedebugstage, theDprefix,id_policy, andretired_ids. - Discovered bug fixed.
override_missing_target_messageembeddedMJDI-E011(which belongs to the unregistered-resolve diagnostic); it now carries its correct pinned IDMJDI-E008. Also: deadmissing_provider_messageremoved with its unused import, and the factory-failure catalog entry documented a message no code emitted (fixed by P0-08's real wrapper). - Files. mjdi/errors.mojo, mjdi/container.mojo, mjdi/provider.mojo, mjdi/registry.mojo, mjdi/dependency_graph.mojo, mjdi/graph.mojo, scripts/gen_diagnostics.py, diagnostics/catalog.json, diagnostics/schema.json, docs/validation-output-contract.md (new), docs/diagnostics.md.
- Tests.
tests/python/test_diagnostics.py(rebuilt): schema field-checks, stage/prefix agreement, the shared-ID variant rule, whole-library builder coverage, every builder embeds its pinned ID (regex-extracted per builder block), the generator's pinned table matches the catalog, R004/D001/D002 are real code paths,--checkmode.
P0-07 — Test-count and coverage reconciliation
- What was implemented.
scripts/test_inventory.pyderives every count from the runners (glob oftests/test_*.mojo, the CF/CRASH/TEMPLATE/ EXAMPLE tables, the extra strengthening checks, the unittest discovery count, the coverage-gate outputs, the benchmark files) intotests/inventory.json+tests/INVENTORY.md, with--checkstaleness gating. It reconciles the PRD's 54/55 discrepancy: 54 = the 0.7.0 runner's 44 checks + 10 golden examples (both 0.7.0 documents quote 54/54); 55 = sources counting the runner's then-new python-tooling phase while the prose still quoted the pre-phase figure — two hand-maintained counts disagreeing mid-cycle. Both are replaced by derived counts; archived snapshots keep their historical figures. A documentation test fails when a current-version document quotes an unreconciledNN/NN checksfigure. - Coverage categories. Explicitly separated: library API-surface (509/509 = 100%), example API-surface (115/115 = 100%), test-case counts (the inventory), behavioral/branch coverage (not measurable — the compiler has no instrumentation; stated, never faked).
- Tests.
tests/python/test_inventory.py: filesystem-vs-inventory counts, suite-total sum rule, gates distinct and passing, benchmarks never counted, reconciliation present,--checkfreshness, the documentation-quote guard, README quoting the derived total.
P0-08 — Runtime error consistency
- What was implemented. The four runtime categories now carry stable
IDs, service context, the operation, and remediation. R001 (scoped
access) and R002 (unset values) gained remediation text and IDs in their
messages (failure modes unchanged — raisable errors). R004: factory
failures are now wrapped by
_run_factoryinmjdi/provider.mojowith the service type, the operation (transient / singleton-construction / scoped-construction), and the original error text preserved verbatim as the underlying cause; the failure mode is unchanged. A001 (unresolvedInject.value()abort) carries its ID. R003 (re-entrancy) already embedded its ID.docs/runtime-error-reference.mddocuments all four with exact message shapes and the consistency rules. - Files. mjdi/errors.mojo (
factory_failure_message— new builder), mjdi/provider.mojo (_run_factory— new wrapper, three call sites), docs/runtime-error-reference.md (new). - Tests.
tests/test_runtime_errors.mojo(R002 fragment set, R001 fragment set, R004 with the preserved cause "connection refused" + the operation fragment for each factory scope, catchability pinned) plus the runner's A001 ID check.
P0-09 — Alias semantics hardening
- What was implemented. The complete alias contract documented
(
docs/alias-semantics.md) and pinned: aliases bind lifetimes, not instances (the target is never constructed or cached by resolving the alias — pinned via construction counters and the debug log); per-context cache ownership with exactly-once cleanup; lifetime inheritance for transient/singleton/scoped targets (including the scoped-target-from- container rejection with R001); last-registration-wins precedence; alias chains impossible by construction (new compile-fail fixturetests/compile_fail/cf_alias_target_alias.mojo,MJDI-E017); cycles rejected (MJDI-E019). - Tests.
tests/test_alias_semantics.mojo+ the new fixture.
P0-10 — Scope semantics clarity
- What was implemented. The provider/lifetime/scope behavior matrix
(
docs/scope-behavior-matrix.md) with every row test-pinned: transient-through-both-owners (fresh, never cached), singleton-per- owning-context (container singletons are not shared into scopes; two scopes hold two instances — pinned via construction/insertion counters), scoped-per-scope with container rejection, value-slot mirroring (creation snapshot; later container set_value does not affect existing scopes; scope-level shadowing that never leaks back), and close ownership (a scope's cached singleton survives its container's close). - Tests.
tests/test_scope_matrix.mojo.
Cross-cutting integration
- The release gate (
scripts/release_gate.sh) chains toolchain identity → metadata → inventory → diagnostics → API reference → the full suite → both coverage gates → fixture-drift (with the export failure no longer swallowed — found and fixed during verification). CI mirrors the same steps (ci.ymljobs + the metadata job);release.ymlvalidates the tag against the manifest and runs the suite before packaging. - Shared semantic rules are centralized: the close/lifecycle state lives in
the container/scope internals (one
_closedflag each), the diagnostic builders are cataloged from one generator, and the inventory derives all counts from one runner.
B. Architecture integration
See docs/architecture.md ("How the P0 hardening layer
integrates") — the summary: the P0 layer is repository tooling
(P0-01/02/07), opt-in specialization (P0-03), documentation-plus-pinning of
existing behavior (P0-04/05/09/10), and message-content contracts (P0-06/08).
The compile-time-first architecture, the immutable registry chain, the
slot-based cache ownership, and the ownership guarantees are unchanged.
C. API documentation (new or changed public surface)
| API | Kind | Notes |
|---|---|---|
Container[..., debug_tracking: Bool = False] | additive parameter | fifth defaulted specialization parameter |
Scope[..., debug_tracking: Bool = False] | additive parameter | inherited via create_scope |
Container.debug_report() -> String | new method | empty in the default specialization |
Container.debug_count() -> Int | new method | 0 when untracked |
Container.was_closed() -> Bool | new method | informational, all specializations |
Scope.debug_report() / debug_count() / was_closed() | new methods | scope spellings |
DebugLog[64] (mjdi.observability) | new type | record/count/event/format/overflowed/reset |
factory_failure_message[T](cause, operation) (mjdi.errors) | new builder | MJDI-R004 |
| Diagnostic messages | behavior clarification | [diagnostic MJDI-XXX] suffix on every message; R001/R002 remediation text |
scripts/validate_metadata.py, release_update_docs.py, test_inventory.py, release_gate.sh | new tooling | release engineering |
Everything else is unchanged. The generated reference
(docs/api-reference.md, regenerated, DebugLog added) is the complete
surface: 509 library declarations, 100% coverage-gated.
D. Test report (exact counts)
Discovered/executed (verified platform, linux-x86_64, mojo 1.2.0 (2016d0cd)):
| Category | Discovered | Executed | Passed | Failed | Skipped | Unavailable |
|---|---|---|---|---|---|---|
Unit tests (mojo run) | 38 | 38 | 38 | 0 | 0 | 0 |
Compile-fail tests (mojo build must fail) | 23 | 23 | 23 | 0 | 0 | 0 |
| Crash-expected tests (must abort) | 3 | 3 | 3 | 0 | 0 | 0 |
| Strengthening checks (A001 ID; P0-03 golden output) | 2 | 2 | 2 | 0 | 0 | 0 |
| Composition-root templates (self-testing) | 4 | 4 | 4 | 0 | 0 | 0 |
| Python tooling (runner check) | 1 phase | 1 | 1 | 0 | 0 | 0 |
| — unittest cases inside the phase | 54 | 54 | 54 | 0 | 0 | 0 |
| End-to-end example | 1 | 1 | 1 | 0 | 0 | 0 |
| Golden example applications | 12 | 12 | 12 | 0 | 0 | 0 |
| Suite total (runner semantics) | 84 | 84 | 84 | 0 | 0 | 0 |
Official runner output: === summary: 84 passed, 0 failed === (exit 0).
During development, before the final run, two Python tests caught real
stale-documentation states (the historical 54/54 quote in
acceptance-criteria.md; a validator crash on a missing file in the temp
tree) — both were fixed in the deliverable, which is the tests working as
designed.
Coverage gates: library API-surface 509/509 = 100% (the 18 new declarations are all referenced by the new tests); example API-surface 115/115 = 100%. Behavioral/branch coverage: not measurable on this toolchain — reported as such, never faked.
Compile-fail results: all 23 fixtures rejected with the pinned message
fragments (including the new cf_alias_target_alias with MJDI-E017, and
the strengthened fixtures asserting stable IDs in the compiler output).
Crash-expected: all 3 aborted with the pinned diagnostics.
Integration results: the end-to-end example passed; all 12 golden
example applications matched their pinned outputs; all 4 templates passed
their self-test suites; the 10 compiler experiments (exp1–exp10)
executed to completion.
Documentation results: verify_docs.py — 63 markdown files, 537
relative links, zero broken links, zero placeholders. Website: bun install --frozen-lockfile, lint (ESLint), format:check (Prettier),
and build all green.
Release-gate results: 9 gate steps green on the verified platform (toolchain identity, metadata, inventory, diagnostics catalog, API reference, full suite, both coverage gates, fixture export + drift).
Compiler compatibility results: linux-x86_64 verified (everything above); linux-aarch64 and macos-arm64 NOT RUN in this environment by design (no hardware) — ci-verified tier with CI jobs; emulation attempted, no emulator available (recorded); osx-x86_64/windows unsupported (no SDK).
E. Compatibility report
- Supported compiler: Mojo 1.2.0, build
2016d0cd(verified tier). No other compiler version has evidence; none is claimed. - Verified platform: linux-x86_64 (full suite + gates + experiments).
- Experimental platforms: linux-aarch64 under emulation (not available in the release environment; recorded as attempted).
- Unsupported combinations: osx-x86_64 and windows-x86_64 (no SDK
published;
mojoproject.tomlexcludes them so pixi solves fail fast). - Compiler limitations relied upon: unstructured text diagnostics (the ID contract lives in message text); no coverage instrumentation (API- surface coverage only); destructors cannot raise (print-only P0-03 diagnostics); no capturing closures in comptime containers (no push- model observers); single-threaded runtime (documented contract).
- Compatibility classification of 0.9.0 changes: additive (the
debug_trackingparameter,DebugLog, the accessor methods, the release tooling); behavior clarification (message texts: ID suffixes, remediation text, the wrapped factory failure with preserved cause); bug fixes (wrong embedded ID, phantom catalog entry, dead builder, unclosed fence in the generated API reference); no deprecations, no breaking changes. Full classification:docs/migration-notes.md.
F. Release readiness report
Classification: Production-ready on the verified tier; feature-complete with the ci-verified tier awaiting runner execution for the remaining platforms.
- Every P0 requirement is implemented and verified, with tests executed in the release environment (84/84 suite checks, 100% coverage gates, 54 Python tests, the release gate green, the website build green).
- Nothing was blocked by the compiler or the architecture: the one potential blocker (destructor-time reporting) was resolved with a compiler experiment proving the print-only pattern, and the limitation is documented rather than worked around silently.
- The two ci-verified platform tiers run the same authoritative inventory in CI; their evidence does not exist in this environment, and the matrix records that honestly instead of claiming support. This is the only gap between "verified" and "production-ready everywhere", and it is a hardware-access gap, not an implementation gap.
- Release metadata, the test inventory, the diagnostic catalog, the API reference, and the graph fixtures are all generated-or-validated artifacts with CI drift gates, so the release state is reproducible.