diff --git a/AGENTS.md b/AGENTS.md index b355f8ed81..62efa5c4e8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,7 +16,7 @@ The first four ship per-language today across the five ports (TS / C# / Java / P 2. **Runtime metadata** — load metadata at runtime, drive behavior dynamically (CRUD, validation, relationships, dynamic admin UIs, LLM tool registration). On Kysely (TS), a DB-API 2 driver via ObjectManager (Python), modernized JDBC + Spring-tx via OMDB (Java), Exposed (Kotlin). **C# runtime metadata is on the roadmap** — its EF Core output is generated code, not a metadata-driven runtime; the runtime `MetaObjects` package depends only on YamlDotNet and ships no data access. 3. **Drift detection** — `meta verify` catches divergence between code and metadata (covers entity codegen, prompt templates, output parsers, schema). Quality-of-life on top of codegen + runtime. 4. **Prompt construction** — a prompt is code, not a string scattered across services. Declare a prompt's payload as a typed projection (payload bloat becomes a diff), keep its text external and provider-resolved, and render it deterministically: snapshot-testable, cache-stable (no whitespace change silently breaking exact-prefix prompt-cache hits), and drift-checked at build time so a renamed field can't degrade a prompt. Conformance-gated, so the guarantee holds in every language port. **Render + payload-VO codegen + `verify` + parser-on-receipt for a *responding* `template.prompt` — one carrying `@responseRef` (FR-006) — + the output-format prompt fragment & tolerant `extract` parser (FR-010) ship in all five ports today** (since 0.24.0 the whole inbound tier keys off `@responseRef`; a `template.output` is outbound-only and emits no parser — ADR-0052) — the library-side building blocks of the pillar are complete. The one remaining library-side piece is MCP exposure of declared prompts/tools (see `spec/roadmap.md`); the application-level consolidation (eval harness, end-to-end declared-prompt orchestration) and consumer adoption are exercised in adopter projects, not in this library repo. Designed in `docs/superpowers/specs/2026-05-22-fr-004-cross-language-prompt-construction-design.md`. -5. **Requirements and testing** — declare what the software is supposed to *do* in the same model as the entities, so a capability claim is checkable instead of prose. The other four pillars keep the code honest about the *model*; this one asks whether the thing you said the software does is actually built — an absence no test can fail on, because a test exercises code that exists. `requirement.functional` (existence: `meta verify` WARNS when nothing implements it) and `requirement.architectural` (universality: `meta verify` FAILS a live policy applied to nothing, and does not check that each claimed node complies) are registered vocabulary in all five ports, with the loader enforcing the closed `@status` enum. `@implementedBy` is **resolved, not trusted** — it names a real member of the real model, so a claim whose implementation was renamed or deleted fails the build instead of going quietly stale. `meta verify` reports the ledger on every run (unresolved links, entities no claim covers, gaps recorded versus gaps nobody has ruled on) plus an authoring lint whose findings can never fail a build; the documentation generators render it for humans and for agents (`requirementsFile()`, `agentDocsFile()` and their counterparts in the other ports). **The port split, stated exactly: the vocabulary loads and validates in all five ports; the requirement gate runs in every port's `verify` (ADR-0057 — `docs/CONFORMANCE.md` "Split coverage"); every port ships an ejectable `requirement-tests` generator — which scaffolds a test per claim; the seven authoring-lint advisories are TypeScript-only.** A green run proves referential integrity, never that a status is true or an implementation correct (`docs/features/requirements.md`, "What a green run does not prove"). A project that declares no `requirement.*` nodes sees no change at all. Note the standing carve-out: `agent-context/skills/metaobjects-fit-assessment/SKILL.md` deliberately does NOT treat `requirement.*` as an assessment axis — the ruling is in `docs/superpowers/specs/2026-07-12-metaobjects-fit-assessment-maintainer-notes.md`; read it before "finishing the job" there. +5. **Requirements and testing** — declare what the software is supposed to *do* in the same model as the entities, so a capability claim is checkable instead of prose. The other four pillars keep the code honest about the *model*; this one asks whether the thing you said the software does is actually built — an absence no test can fail on, because a test exercises code that exists. `requirement.functional` (existence: `meta verify` WARNS when nothing implements it) and `requirement.architectural` (universality: `meta verify` FAILS a live policy applied to nothing, and does not check that each claimed node complies) are registered vocabulary in all five ports, with the loader enforcing the closed `@status` enum. `@implementedBy` is **resolved, not trusted** — it names a real member of the real model, so a claim whose implementation was renamed or deleted fails the build instead of going quietly stale. `meta verify` reports the ledger on every run (unresolved links, entities no claim covers, gaps recorded versus gaps nobody has ruled on) plus an authoring lint whose findings can never fail a build; the documentation generators render it for humans and for agents (`requirementsFile()`, `agentDocsFile()` and their counterparts in the other ports). **The port split, stated exactly: the vocabulary loads and validates in all five ports; the requirement gate runs in every port's `verify` (ADR-0057 — `docs/CONFORMANCE.md` "Split coverage"); every port ships an ejectable `requirement-tests` generator — which scaffolds a test per claim; the seven authoring-lint advisories are TypeScript-only.** A green run proves referential integrity, never that a status is true or an implementation correct (`docs/features/requirements.md`, "What a green run does not prove"). A project that declares no `requirement.*` nodes generates nothing new; when it has writable entities, `meta verify` gives it one never-failing advisory, `WARN_REQUIREMENT_LEDGER_EMPTY`, in every port, off with `verify.requirements.missing: off` (ADR-0057 Amendment 1, 2026-12-05). Note the standing carve-out: `agent-context/skills/metaobjects-fit-assessment/SKILL.md` names a requirement and a test for each surface its plan leaves hand-written (P5-c, since 2026-12-05) but deliberately does NOT let `requirement.*` move any verdict — the ruling is in `docs/superpowers/specs/2026-07-12-metaobjects-fit-assessment-maintainer-notes.md`; read it before "finishing the job" there. 6. **Libraries** — reusable declared design, shipped as metadata and opted into by name (`"libraries": ["iam"]` in `.metaobjects/config.json`). Not a sixth verb: a library is the **reuse unit that composes the other five** — entities, requirements, the generators its design implies, its runtime packages — as one named, opt-in, drift-gated artifact. What makes it a pillar rather than a folder of YAML is the fifth: without requirements a library is a schema snippet; with them it is design an adopter's build is held to, which is the same test the requirements pillar passes (*does it change what an agent can be checked against?*). **A library is LAYERED and its core layer is INERT** — the core declares no `source.rdb`, and a sourceless object generates nothing and migrates to nothing (#248), so `["iam"]` adds zero tables and zero generated code while making the design present and resolvable; `["iam", "iam/db"]` is the separate opt-in that proposes the schema. **Copy is the expected mode** (`meta eject ` — ADR-0034's ruling applied to metadata), and an ejected copy still named in `libraries` is refused at load (`ERR_LIBRARY_PACKAGE_COLLISION`) rather than merging asymmetrically. Object coverage activates on ADOPTER-authored requirements only, so a library cannot volunteer a project for a gate it did not ask for. `iam` (preview) and `ai` (stable) ship today; rows appear in `meta gen --list` beside the generators. See [docs/features/libraries.md](docs/features/libraries.md) and `docs/superpowers/specs/2026-09-13-fr-043-feature-and-nfr-packages-design.md`. diff --git a/server/rust/metaobjects-cli/agent-context-shipped/files/651a126eaa501924.md b/agent-context-shipped/files/507ff854b296858c.md similarity index 97% rename from server/rust/metaobjects-cli/agent-context-shipped/files/651a126eaa501924.md rename to agent-context-shipped/files/507ff854b296858c.md index 2bcebe9ec1..f3d8db9d24 100644 --- a/server/rust/metaobjects-cli/agent-context-shipped/files/651a126eaa501924.md +++ b/agent-context-shipped/files/507ff854b296858c.md @@ -145,7 +145,9 @@ deleted, and nothing reports them. something, never so every member must carry one. - **Dangling links on `planned`.** Correct — the plan precedes the nodes. - **A project with no requirements at all.** The feature is opt-in by declaration; absence is - not a finding. + not a finding of this audit. `verify` already says it once, as `WARN_REQUIREMENT_LEDGER_EMPTY` + when the project has writable entities, and `"verify": { "requirements": { "missing": "off" } }` + is how a project records that it chose not to keep a ledger. ## Reporting diff --git a/agent-context-shipped/files/0ee567e8d039312d.md b/agent-context-shipped/files/805c0b6a53fc3464.md similarity index 98% rename from agent-context-shipped/files/0ee567e8d039312d.md rename to agent-context-shipped/files/805c0b6a53fc3464.md index e859076180..0c61a778ff 100644 --- a/agent-context-shipped/files/0ee567e8d039312d.md +++ b/agent-context-shipped/files/805c0b6a53fc3464.md @@ -89,6 +89,7 @@ So on a `planned` entry a dangling reference is the entry doing its job, not dri | situation | exit | |---|---| | clean tree, or no `requirement.*` nodes at all | 0 | +| writable entities and no requirement of the project's own (an empty ledger file counts as none) | 0 (warning `WARN_REQUIREMENT_LEDGER_EMPTY`; `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns it off) | | dangling `@implementedBy` on `live`/`partial` | 1 | | the same reference on `planned` | 0 | | `@implementedBy` above the L4 link floor | 1 | diff --git a/agent-context-shipped/manifest.json b/agent-context-shipped/manifest.json index b1e912da4f..0ee3bcedbe 100644 --- a/agent-context-shipped/manifest.json +++ b/agent-context-shipped/manifest.json @@ -35,7 +35,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -215,7 +215,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -257,7 +257,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -437,7 +437,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -481,7 +481,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -665,7 +665,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -709,7 +709,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -893,7 +893,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -938,7 +938,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1126,7 +1126,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1171,7 +1171,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1359,7 +1359,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1403,7 +1403,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1583,7 +1583,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1627,7 +1627,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1807,7 +1807,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1853,7 +1853,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2005,7 +2005,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2051,7 +2051,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2203,7 +2203,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2251,7 +2251,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2407,7 +2407,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2455,7 +2455,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2611,7 +2611,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2660,7 +2660,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2820,7 +2820,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2869,7 +2869,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3029,7 +3029,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3077,7 +3077,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3229,7 +3229,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3277,7 +3277,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3429,7 +3429,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3475,7 +3475,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3627,7 +3627,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3673,7 +3673,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3825,7 +3825,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3873,7 +3873,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4029,7 +4029,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4077,7 +4077,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4233,7 +4233,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4282,7 +4282,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4442,7 +4442,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4491,7 +4491,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4651,7 +4651,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4699,7 +4699,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4851,7 +4851,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4899,7 +4899,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5051,7 +5051,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5097,7 +5097,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5249,7 +5249,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5295,7 +5295,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5447,7 +5447,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5495,7 +5495,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5651,7 +5651,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5699,7 +5699,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5855,7 +5855,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5904,7 +5904,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6064,7 +6064,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6113,7 +6113,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6273,7 +6273,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6321,7 +6321,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6473,7 +6473,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6521,7 +6521,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6673,7 +6673,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6719,7 +6719,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6871,7 +6871,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6917,7 +6917,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7069,7 +7069,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7117,7 +7117,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7273,7 +7273,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7321,7 +7321,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7477,7 +7477,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7526,7 +7526,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7686,7 +7686,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7735,7 +7735,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7895,7 +7895,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7943,7 +7943,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8095,7 +8095,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8143,7 +8143,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8295,7 +8295,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8337,7 +8337,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8473,7 +8473,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8515,7 +8515,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8651,7 +8651,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8695,7 +8695,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8835,7 +8835,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8879,7 +8879,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9019,7 +9019,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9064,7 +9064,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9208,7 +9208,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9253,7 +9253,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9397,7 +9397,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9441,7 +9441,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9577,7 +9577,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9621,7 +9621,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9757,7 +9757,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9808,7 +9808,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9976,7 +9976,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10027,7 +10027,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10195,7 +10195,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10248,7 +10248,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10420,7 +10420,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10473,7 +10473,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10645,7 +10645,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10699,7 +10699,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10875,7 +10875,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10929,7 +10929,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -11105,7 +11105,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -11158,7 +11158,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -11326,7 +11326,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -11379,7 +11379,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -11547,7 +11547,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", diff --git a/agent-context/skills/metaobjects-audit/references/requirements.md b/agent-context/skills/metaobjects-audit/references/requirements.md index 2bcebe9ec1..f3d8db9d24 100644 --- a/agent-context/skills/metaobjects-audit/references/requirements.md +++ b/agent-context/skills/metaobjects-audit/references/requirements.md @@ -145,7 +145,9 @@ deleted, and nothing reports them. something, never so every member must carry one. - **Dangling links on `planned`.** Correct — the plan precedes the nodes. - **A project with no requirements at all.** The feature is opt-in by declaration; absence is - not a finding. + not a finding of this audit. `verify` already says it once, as `WARN_REQUIREMENT_LEDGER_EMPTY` + when the project has writable entities, and `"verify": { "requirements": { "missing": "off" } }` + is how a project records that it chose not to keep a ledger. ## Reporting diff --git a/agent-context/skills/metaobjects-fit-assessment/SKILL.md b/agent-context/skills/metaobjects-fit-assessment/SKILL.md index cbcf3abc4f..2851f2c382 100644 --- a/agent-context/skills/metaobjects-fit-assessment/SKILL.md +++ b/agent-context/skills/metaobjects-fit-assessment/SKILL.md @@ -381,6 +381,11 @@ generated EF Core entities + `AppDbContext` + minimal-API routes; Python — Pyd stock generator emits can still become generated: say "an owned generator can retire this", with an honest effort tag. +**P5-c — Per stays-hand-written surface (P6), a plan line, never the verdict:** the +`requirement.functional` (L4 `@statement`/`@counterexample`, `@implementedBy` the entity or +operation it acts on, else `planned`) and the test that holds it (the `requirement-tests` stub +plus a witness calling the code). It names work, not fit: it moves no verdict. + ### P6 — End-state projection - **Spine size from DDL richness**, not a flat guess: ~25–40 lines per bare table; ~80–120 for @@ -389,7 +394,7 @@ an honest effort tag. - **Generated surface**: files + LOC per the port's generators at the recommended scope. - **Leverage ratio** = `generated_lines / (metadata_lines + owned_generator_lines)`, as a band; it excludes the drift-gate value, which is the real prize. -- **Stays-hand-written table**: every surface that stays bespoke, each with a named reason. +- **Stays-hand-written table**: every surface that stays bespoke, each with a named reason (+ P5-c). ### P7 — Beyond-the-ask vocabulary hunt (ADR-0037's ordered test for each) @@ -446,8 +451,8 @@ N divergent right now). **§R2 — Census**: the P2-a reconciliation block (with seam shapes), P2-b counts, UI-surface counts, and a coverage column (what MetaObjects can model/generate vs what it will never touch). -**§R3 — Migration plan** at the recommended scope (P5-a), plus the labeled ceiling paragraph -(P5-b). +**§R3 — Migration plan** at the recommended scope (P5-a) and P5-c, plus the labeled ceiling +paragraph (P5-b). **§R4 — End-state projection** (P6). @@ -491,5 +496,5 @@ Read `references/capability-sheet.md` before you state what any port can do; eve 5. Every drift row: real `file:line`, real commits, a named gate? (>15% false positives is fatal.) 6. *(Full only)* Disqualifier table worked row by row; reconciliation block present; P2-b run; ceiling paragraph labeled `horizon: "later"`; "What you will NOT get" complete; every prose - prediction has a JSON twin. + prediction has a JSON twin; a P5-c line per stays-hand-written row, cited by no verdict. diff --git a/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md b/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md index 645e397587..c77880c220 100644 --- a/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md +++ b/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md @@ -103,6 +103,9 @@ emit per-transport code from the shapes. load in all five ports and the `verify` gate runs in each. The strict form is `--require-implementers` (TS, Python, C#), `-Dmeta.verify.requireImplementers=true` (Java/Kotlin), or `META_REQUIRE_IMPLEMENTERS=1`. A green run proves links resolve, not that a claim is true. + Every port's `requirement-tests` generator scaffolds one test per claim, which a hand-written + witness fills. A project with writable entities and no requirement gets one `verify` warning + (`WARN_REQUIREMENT_LEDGER_EMPTY`; off with `"verify": { "requirements": { "missing": "off" } }`). - **Wire setting**: `"wire": {"decimals", "nullMembers"}` in `.metaobjects/config.json`, read by every port's codegen. Default `native`: each language's standard JSON (C#/Java/Kotlin decimals as numbers, Python/TypeScript as strings). `decimals: "string"` + `nullMembers: "omit"` gives the identical diff --git a/agent-context/skills/metaobjects-fit-assessment/references/json-contract.md b/agent-context/skills/metaobjects-fit-assessment/references/json-contract.md index c30440b867..832e4f1fcd 100644 --- a/agent-context/skills/metaobjects-fit-assessment/references/json-contract.md +++ b/agent-context/skills/metaobjects-fit-assessment/references/json-contract.md @@ -38,7 +38,7 @@ "claims": [ { "id": "kebab-stable-id", - "claim_type": "fit | scope | census | drift | migrates | stays-bespoke | leverage | benefit | vocab | limit | wedge", + "claim_type": "fit | scope | census | drift | migrates | stays-bespoke | requirement-plan | leverage | benefit | vocab | limit | wedge", "claim": "one-sentence prediction", "pillar": "codegen | runtime | drift | prompt | n/a", "surface": "entity | dto | validator | repository | route | view | ui | prompt | migration | schema | payload | contract", @@ -57,5 +57,7 @@ } ``` -Every prose prediction gets a claim. Ceiling statements carry `horizon: "later"`. Drift rows +Every prose prediction gets a claim. Each P5-c line is a `requirement-plan` claim: `locations` +cite the hand-written surface, `metadata_sketch` holds the requirement, `parity_gate` names the +test, and no `verdicts` entry may rest on one. Ceiling statements carry `horizon: "later"`. Drift rows carry `checkable: true` with real locations. The quick pass emits no JSON unless asked. diff --git a/agent-context/skills/metaobjects-verify/references/requirements.md b/agent-context/skills/metaobjects-verify/references/requirements.md index e859076180..0c61a778ff 100644 --- a/agent-context/skills/metaobjects-verify/references/requirements.md +++ b/agent-context/skills/metaobjects-verify/references/requirements.md @@ -89,6 +89,7 @@ So on a `planned` entry a dangling reference is the entry doing its job, not dri | situation | exit | |---|---| | clean tree, or no `requirement.*` nodes at all | 0 | +| writable entities and no requirement of the project's own (an empty ledger file counts as none) | 0 (warning `WARN_REQUIREMENT_LEDGER_EMPTY`; `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns it off) | | dangling `@implementedBy` on `live`/`partial` | 1 | | the same reference on `planned` | 0 | | `@implementedBy` above the L4 link floor | 1 | diff --git a/changelog.d/fit-assessment-requirement-plan-line.md b/changelog.d/fit-assessment-requirement-plan-line.md new file mode 100644 index 0000000000..e06652860c --- /dev/null +++ b/changelog.d/fit-assessment-requirement-plan-line.md @@ -0,0 +1,8 @@ +- **The fit assessment plans a requirement and a test for each surface it leaves hand-written.** + `metaobjects-fit-assessment` (the prompt behind `https://metaobjects.dev/assess.md`) gains P5-c: + for every row of the stays-hand-written table, a plan line naming the `requirement.functional` + that records what the surface must do and the test that holds it (the `requirement-tests` stub + plus a witness), with a `requirement-plan` claim as its JSON twin. It is a plan line only: no + verdict, pillar verdict, disqualifier or scope rubric row may turn on it. The capability sheet now + names the `requirement-tests` generator and the new `verify` advisory. This lifts the 2026-07-12 + deferral recorded in the assessment's maintainer notes. diff --git a/changelog.d/verify-requirements-missing-advisory.md b/changelog.d/verify-requirements-missing-advisory.md new file mode 100644 index 0000000000..13b421460f --- /dev/null +++ b/changelog.d/verify-requirements-missing-advisory.md @@ -0,0 +1,12 @@ +- **`verify` advises a project that stores data and declares no requirement, in every port.** + A project with at least one writable entity (a concrete entity with a writable source, declared + or inherited) and no requirement of its own now gets one warning on every `verify` run: + `WARN_REQUIREMENT_LEDGER_EMPTY`, from the requirement gate in TypeScript, Python, Java, Kotlin + and C#, and from `cargo meta verify` in Rust. An empty ledger file (what `meta init` scaffolds), + a library's ledger and a dependency's count as none; a library's or a dependency's entities do + not count as the project's. It never changes the exit code, and `--require-implementers` does + not raise it. Turn it off with `"verify": { "requirements": { "missing": "off" } }` in + `.metaobjects/config.json` (`warn` is the default; any other value is refused when the config is + read). This reverses the promise that a project with no requirements sees no change at all; the + ruling is ADR-0057 Amendment 1. The requirement-check corpus adds four `ledger-empty-*` cases, and + its `options.json` now takes the `verify` block. diff --git a/docs/CONFORMANCE.md b/docs/CONFORMANCE.md index e29f4df7b9..8771c0ef56 100644 --- a/docs/CONFORMANCE.md +++ b/docs/CONFORMANCE.md @@ -61,7 +61,7 @@ regenerate with `ls -d fixtures//*/ | wc -l` for directory-shaped corpor | [`fixtures/fmt-conformance/`](../fixtures/fmt-conformance/) (#304 — `meta fmt`) | 13 | ✓ (reference) | ✓ | inherits via Java | ✓ | ✓ | — (no `fmt`) | | [`fixtures/field-lint-conformance/`](../fixtures/field-lint-conformance/) (the `verify` field authoring lint) | 15 | ✓ (reference) | ✓ | inherits via Java | ✓ | ✓ | — | | [`fixtures/model-lint-conformance/`](../fixtures/model-lint-conformance/) (the `verify` overlay, node-name and deprecated-reference authoring lints) | 17 | ✓ (reference) | planned | planned (through Java) | ✓ | planned | — | -| [`fixtures/requirement-check-conformance/`](../fixtures/requirement-check-conformance/) (the `verify` requirement gate, ADR-0057) | 49 cases | ✓ (reference) | ✓ | inherits via Java (one Maven `metaobjects:verify` goal) | ✓ | ✓ | planned (RS-V2) | +| [`fixtures/requirement-check-conformance/`](../fixtures/requirement-check-conformance/) (the `verify` requirement gate, ADR-0057) | 53 cases | ✓ (reference) | ✓ | inherits via Java (one Maven `metaobjects:verify` goal) | ✓ | ✓ | planned (RS-V2); the `WARN_REQUIREMENT_LEDGER_EMPTY` rows of five cases | | [`fixtures/requirement-test-identity-conformance/`](../fixtures/requirement-test-identity-conformance/) (the identity, skip state and digest of each generated requirement test, and the filter seam, ADR-0057) | 27 cases | ✓ (reference) | ✓ | identity function inherits via Java; emitted names asserted by its own generator test | ✓ | ✓ | — | | [`fixtures/rules-check-conformance/`](../fixtures/rules-check-conformance/) (the `verify` business-rules gate, ADR-0066) | 17 cases | ✓ (reference) | ✓ | inherits via Java (one Maven `metaobjects:verify` goal) | ✓ | ✓ | ✓ | | [`fixtures/naming-conformance/`](../fixtures/naming-conformance/) | 8 cases + 23 collection segments (`@collectionName`, `naming.collections`) | ✓ | ✓ | inherits via Java (`RouteNaming.pluralize`, `RouteNaming.collectionSegment`) | ✓ | ✓ | ✓ | @@ -805,11 +805,11 @@ own those two functions), `server/python/tests/unit/test_fr016_source_name_and_kind_aliases.py` (same split), and `server/rust/metaobjects/tests/naming_conformance.rs`. -### `fixtures/requirement-check-conformance/` (49 cases) +### `fixtures/requirement-check-conformance/` (53 cases) -All 49 cases → [features/requirements.md](features/requirements.md) ("The gate in every +All 53 cases → [features/requirements.md](features/requirements.md) ("The gate in every port"). Each case is a directory: `input/` metadata, an optional `options.json` -(`libraries`, `requireImplementers`) and an `expected.json` holding the gate's diagnostics +(`libraries`, `requireImplementers`, `verify`) and an `expected.json` holding the gate's diagnostics (severity, code, requirement path, message text) and the ledger summary, or `null` for a model with no requirement. The expectations are written from the TypeScript reference and a port that disagrees with one is wrong. The case list, and what each pins, is in the @@ -820,7 +820,11 @@ a port that disagrees with one is wrong. The case list, and what each pins, is i `server/python/tests/conformance/test_requirement_check_conformance.py`, `server/java/metadata/src/test/java/com/metaobjects/conformance/RequirementCheckConformanceTest.java` (Kotlin inherits it, through the shared Maven goal) and -`server/csharp/MetaObjects.Conformance.Tests/RequirementCheckConformanceTests.cs`. +`server/csharp/MetaObjects.Conformance.Tests/RequirementCheckConformanceTests.cs`. Rust, +which has no gate, computes the one advisory about an absent ledger +(`WARN_REQUIREMENT_LEDGER_EMPTY`) on its own, and +`server/rust/metaobjects/tests/requirement_ledger_conformance.rs` compares that code's rows of +the four `ledger-empty-*` cases and `no-requirements`. ### `fixtures/list-query-conformance/` (95 cases) diff --git a/docs/features/cli.md b/docs/features/cli.md index 8cecb6c0cc..88922132ff 100644 --- a/docs/features/cli.md +++ b/docs/features/cli.md @@ -25,7 +25,7 @@ command surface splits in two: | Capability | Tool | Invocation | Notes | |---|---|---|---| -| Project scaffold (`init`) | Node `meta` | `meta init` | TS projects; `--dialect sqlite\|postgres\|mysql\|d1` writes the codegen `dialect` in `metaobjects.config.ts` and, for sqlite, postgres and d1, `migrate.dialect` in `.metaobjects/config.json` (d1 is `--d1`; MySQL schema is not `meta migrate`'s). A new `.metaobjects/config.json` also carries `"api": { "pagination": { "defaultLimit": 50, "maxLimit": 1000 }, "unknownFields": "reject" }`, the generated list routes' page size and the refusal of undeclared write keys ([api-contract.md](api-contract.md)); for `--dialect sqlite` it also adds `@libsql/kysely-libsql` to the project's `dependencies`, the SQLite driver the CLI's optional peer names (run your package manager's install afterwards); `--force` over an existing config does not add it. A new metadata directory also gets `meta.requirements.json`, an empty requirement ledger: nothing turns on until the project adds its first level-1 `requirement.functional` to it, and the config names `requirementTests()` without wiring it ([requirements.md](requirements.md)). `--with-services` wires the recommended service list ([business-rules.md](business-rules.md#the-service-layer-typescript)) instead of the empty one, and `--with-docs` the two docs generators (`docsSiteFile(), apiDocsFile()`) | +| Project scaffold (`init`) | Node `meta` | `meta init` | TS projects; `--dialect sqlite\|postgres\|mysql\|d1` writes the codegen `dialect` in `metaobjects.config.ts` and, for sqlite, postgres and d1, `migrate.dialect` in `.metaobjects/config.json` (d1 is `--d1`; MySQL schema is not `meta migrate`'s). A new `.metaobjects/config.json` also carries `"api": { "pagination": { "defaultLimit": 50, "maxLimit": 1000 }, "unknownFields": "reject" }`, the generated list routes' page size and the refusal of undeclared write keys ([api-contract.md](api-contract.md)); for `--dialect sqlite` it also adds `@libsql/kysely-libsql` to the project's `dependencies`, the SQLite driver the CLI's optional peer names (run your package manager's install afterwards); `--force` over an existing config does not add it. A new metadata directory also gets `meta.requirements.json`, an empty requirement ledger: an empty ledger is no requirement, so once the project declares a writable entity `meta verify` advises it (`WARN_REQUIREMENT_LEDGER_EMPTY`, off with `verify.requirements.missing: off`) until the project adds its first level-1 `requirement.functional`, and the config names `requirementTests()` without wiring it ([requirements.md](requirements.md)). `--with-services` wires the recommended service list ([business-rules.md](business-rules.md#the-service-layer-typescript)) instead of the empty one, and `--with-docs` the two docs generators (`docsSiteFile(), apiDocsFile()`) | | **Agent-context scaffold** (`agent-docs`) | **Node `meta`** | `npx meta agent-docs --server ` | **any backend** — single assembler (ADR-0033); every port writes the same files itself with no Node: `metaobjects agent-docs` (Python), `dotnet meta agent-docs` (C#), `mvn metaobjects:agent-docs` (Java/Kotlin), `cargo meta agent-docs` (Rust) | | **Expected schema** (`schema`) | **Node `meta`** | `meta schema [--dialect ] [--as ddl\|json]` | **any backend** — read-only: prints the schema the metadata expects as DDL or as the neutral document ([schema-snapshot-format.md](schema-snapshot-format.md)); reads no database; writes nothing unless `--out` names a file | | **Schema migrate** | **Node `meta`** | `meta migrate` | **any backend** — the reference migration helper, one option beside each language's own tool (ADR-0015) | @@ -156,7 +156,12 @@ Rules of the contract: - **The requirement gate runs on every `verify`, in every port** ([ADR-0057](../../spec/decisions/ADR-0057-requirement-checks-and-tests-in-every-port.md)). It is not a subverb and nothing mutes it. A model with no `requirement.*` node gets no - line and no change to the exit code. A model with one gets the ledger summary on every + summary line and no change to the exit code; when it declares a writable entity it gets one + warning, `WARN_REQUIREMENT_LEDGER_EMPTY`, which never fails a build and which + `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns off, + in every port (an empty ledger file counts as none; [requirements.md](requirements.md#a-project-with-no-requirements), + [ADR-0057 Amendment 1](../../spec/decisions/ADR-0057-requirement-checks-and-tests-in-every-port.md#amendment-1-2026-12-05-a-project-that-stores-data-and-declares-no-requirement-is-advised)). + A model with one gets the ledger summary on every run, and an error (a link above the floor, a dangling reference on a `live` or `partial` requirement, a live policy applied to nothing) exits non-zero. Unlike the lints above, this one can fail the build. One of its warnings can be raised to an error, per port: @@ -255,7 +260,8 @@ checks every `template.*` body under `prompts/` (or `--prompts `) against i object plus each prompt's `@responseRef` reply, and runs the business-rules gate; `--codegen` and `--templates` run one gate alone, `--deps` runs the opt-in dependency drift check (`path` transport only), and the port has no requirement gate ([the Rust port -page](../ports/rust.md)). +page](../ports/rust.md)). It does report the one advisory about an absent ledger, +`WARN_REQUIREMENT_LEDGER_EMPTY`, with the same rule, text and off switch as the other ports. ## Owned generators: the unchanged-copy notice, `eject --undo`, and `gen --strict` diff --git a/docs/features/requirements.md b/docs/features/requirements.md index 4e7361ff7f..e6b2bbd2e8 100644 --- a/docs/features/requirements.md +++ b/docs/features/requirements.md @@ -10,9 +10,11 @@ and every port but Rust ships a provider pack, composed by default; what leaving it out does is in [Where vocabulary lives](extending-with-providers.md#where-vocabulary-lives). -**Entirely opt-in.** A model with no `requirement.*` nodes gets no diagnostics, generates -nothing, and reads nothing — no codegen, migrate or runtime path touches the type. You opt in -by declaring, not by configuring. +**Opt-in, and `verify` says so once.** A model with no `requirement.*` nodes generates nothing +and reads nothing — no codegen, migrate or runtime path touches the type. You opt in by +declaring, not by configuring. What it does get, when it declares an entity that stores data, +is one advisory from `meta verify`: [`WARN_REQUIREMENT_LEDGER_EMPTY`](#a-project-with-no-requirements), +which never fails a build and has an off switch. ## The problem it solves @@ -378,6 +380,7 @@ the summary at `info`, warnings as warnings and errors as errors. | `WARN_REQUIREMENT_NOTHING_IMPLEMENTS` | warn | A `live` or `partial` functional requirement where neither it nor anything nested under it names a node. An error under [the strict switch](#requiring-implementers). | | `WARN_REQUIREMENT_DEFERRED_UNTRACKED` | warn | `@disposition: deferred` with no `@trackedBy`. | | `WARN_REQUIREMENT_OBJECT_UNCLAIMED` | warn | Coverage is measured and no requirement claims a concrete entity. The line has no requirement path, because its subject is the entity. Its `--format json` row names the entity in `node`. | +| `WARN_REQUIREMENT_LEDGER_EMPTY` | warn, always | Coverage is not measured and the project has a writable entity. Reported once, with no path; see [A project with no requirements](#a-project-with-no-requirements). Rust's `cargo meta verify` reports this one code, although it has no gate yet. | A diagnostic prints as ` []: `. @@ -392,6 +395,33 @@ its own. A project whose only requirements came from a shipped library or a meta dependency, with or without an overlay on one of them, is not measured, and the summary says so instead of printing a ratio. +### A project with no requirements + +A project that stores data and has authored no requirement gets one warning on every `verify` +run, in every port: + +``` +WARN_REQUIREMENT_LEDGER_EMPTY: 2 writable entities and no requirement of the project's own, so +nothing records what the software is for. Declare a requirement.functional for each feature, or +set "verify": { "requirements": { "missing": "off" } } in .metaobjects/config.json. +``` + +It counts the concrete entities with a writable source (declared or inherited through +`extends`), leaving out a shipped library's entities and a dependency's. "Of its own" is the +rule above for when coverage is measured: an empty ledger file (what `meta init` scaffolds), a +library's ledger and a dependency's all count as none. A model whose entities have no source, +or only read-only ones, gets nothing. It is always a warning: the exit code does not change, +and `--require-implementers` does not raise it. To turn it off, in `.metaobjects/config.json`: + +```json +{ "verify": { "requirements": { "missing": "off" } } } +``` + +`missing` takes `warn` (the default) or `off`; anything else is refused when the config is +read. The ruling behind it, which reversed the older promise that a project with no +requirements sees no change at all, is +[ADR-0057 Amendment 1](../../spec/decisions/ADR-0057-requirement-checks-and-tests-in-every-port.md#amendment-1-2026-12-05-a-project-that-stores-data-and-declares-no-requirement-is-advised). + **A dependency's requirements are not yours by default.** A shared model published with `requirements: true` carries its requirements; they load, but the gate, the summary and the `requirement-tests` generator leave them out unless `requirements.inherit` in diff --git a/docs/ports/python.md b/docs/ports/python.md index d42f3f9c93..3ecc24c5ce 100644 --- a/docs/ports/python.md +++ b/docs/ports/python.md @@ -625,8 +625,9 @@ live requirement, a link above the floor, a live policy applied to nothing) exit `--require-implementers` (or `META_REQUIRE_IMPLEMENTERS=1`) also fails the run on a live functional requirement that nothing implements; once the ledger is clean, put it in the project's verify script or pre-push hook. Those checks are core and are not -ejectable. A model with no requirement sees no change. Metadata that does not load is not -that: `verify` prints the load errors and exits non-zero, also when no drift gate ran and so +ejectable. A model with no requirement gets at most the absent-ledger advisory +(`WARN_REQUIREMENT_LEDGER_EMPTY`), which never fails the run. Metadata that does not load is +different: `verify` prints the load errors and exits non-zero, also when no drift gate ran and so none loaded it. The `requirement-tests` generator is the other half. It is a reference helper and a diff --git a/docs/superpowers/specs/2026-07-12-metaobjects-fit-assessment-maintainer-notes.md b/docs/superpowers/specs/2026-07-12-metaobjects-fit-assessment-maintainer-notes.md index 56108eaa5a..ed35f235b6 100644 --- a/docs/superpowers/specs/2026-07-12-metaobjects-fit-assessment-maintainer-notes.md +++ b/docs/superpowers/specs/2026-07-12-metaobjects-fit-assessment-maintainer-notes.md @@ -28,9 +28,24 @@ retro-test validation: `docs/superpowers/specs/2026-07-12-metaobjects-fit-assess How to run it: point a high-end LLM at a target repo + this file (e.g. paste it, or fetch it from GitHub / metaobjects.dev) and let it produce the report below. -DEFERRED, ON PURPOSE — capability requirements (`requirement.functional` / -`requirement.architectural`). This skill deliberately says NOTHING about them, and that is a -decision, not an omission. +LIFTED 2026-12-05 — read this before the deferral below, which is kept as the record of what +was decided and why. The captain answered "Yes" to "should the fit assessment start covering +requirements?", choosing the option "as a plan line only (never part of the verdict)". ARM B +fired: an adopter estate that adopted through this assessment kept an empty ledger through two +releases while its hand-written code grew, and nothing the assessment produced had mentioned +requirements. What the skill now carries is P5-c: for every surface the plan leaves hand-written +(the P6 stays-hand-written table), one plan line naming the `requirement.functional` that records +what it must do and the test that holds it (the `requirement-tests` stub plus a witness), with a +`requirement-plan` claim as its JSON twin. Reason (3) below is answered by that shape: the plan +line names the EXECUTABLE form (a generated test per claim), not a ledger to hand-maintain. What +did NOT change, and must not: no verdict may turn on requirements. P5-c is not a P4 rubric row, +not a pillar verdict, not an R0 line and not a disqualifier, and the self-check says so. This is +a different shape from the P7 hunt line pre-committed below, chosen by the captain; the P7 line +was not added. + +DEFERRED, ON PURPOSE (superseded by the lift above) — capability requirements +(`requirement.functional` / `requirement.architectural`). This skill deliberately said NOTHING +about them, and that was a decision, not an omission. Why not now: (1) SPENT -- this read "not in a release yet", and it is now. `requirement.*` shipped in 0.22.0 and has evolved twice since (0.23.0 added `planned` / `@disposition` / diff --git a/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-audit/references/requirements.md b/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-audit/references/requirements.md index 2bcebe9ec1..f3d8db9d24 100644 --- a/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-audit/references/requirements.md +++ b/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-audit/references/requirements.md @@ -145,7 +145,9 @@ deleted, and nothing reports them. something, never so every member must carry one. - **Dangling links on `planned`.** Correct — the plan precedes the nodes. - **A project with no requirements at all.** The feature is opt-in by declaration; absence is - not a finding. + not a finding of this audit. `verify` already says it once, as `WARN_REQUIREMENT_LEDGER_EMPTY` + when the project has writable entities, and `"verify": { "requirements": { "missing": "off" } }` + is how a project records that it chose not to keep a ledger. ## Reporting diff --git a/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-verify/references/requirements.md b/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-verify/references/requirements.md index e859076180..0c61a778ff 100644 --- a/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-verify/references/requirements.md +++ b/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-verify/references/requirements.md @@ -89,6 +89,7 @@ So on a `planned` entry a dangling reference is the entry doing its job, not dri | situation | exit | |---|---| | clean tree, or no `requirement.*` nodes at all | 0 | +| writable entities and no requirement of the project's own (an empty ledger file counts as none) | 0 (warning `WARN_REQUIREMENT_LEDGER_EMPTY`; `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns it off) | | dangling `@implementedBy` on `live`/`partial` | 1 | | the same reference on `planned` | 0 | | `@implementedBy` above the L4 link floor | 1 | diff --git a/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-audit/references/requirements.md b/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-audit/references/requirements.md index 2bcebe9ec1..f3d8db9d24 100644 --- a/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-audit/references/requirements.md +++ b/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-audit/references/requirements.md @@ -145,7 +145,9 @@ deleted, and nothing reports them. something, never so every member must carry one. - **Dangling links on `planned`.** Correct — the plan precedes the nodes. - **A project with no requirements at all.** The feature is opt-in by declaration; absence is - not a finding. + not a finding of this audit. `verify` already says it once, as `WARN_REQUIREMENT_LEDGER_EMPTY` + when the project has writable entities, and `"verify": { "requirements": { "missing": "off" } }` + is how a project records that it chose not to keep a ledger. ## Reporting diff --git a/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-verify/references/requirements.md b/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-verify/references/requirements.md index e859076180..0c61a778ff 100644 --- a/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-verify/references/requirements.md +++ b/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-verify/references/requirements.md @@ -89,6 +89,7 @@ So on a `planned` entry a dangling reference is the entry doing its job, not dri | situation | exit | |---|---| | clean tree, or no `requirement.*` nodes at all | 0 | +| writable entities and no requirement of the project's own (an empty ledger file counts as none) | 0 (warning `WARN_REQUIREMENT_LEDGER_EMPTY`; `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns it off) | | dangling `@implementedBy` on `live`/`partial` | 1 | | the same reference on `planned` | 0 | | `@implementedBy` above the L4 link floor | 1 | diff --git a/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-audit/references/requirements.md b/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-audit/references/requirements.md index 2bcebe9ec1..f3d8db9d24 100644 --- a/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-audit/references/requirements.md +++ b/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-audit/references/requirements.md @@ -145,7 +145,9 @@ deleted, and nothing reports them. something, never so every member must carry one. - **Dangling links on `planned`.** Correct — the plan precedes the nodes. - **A project with no requirements at all.** The feature is opt-in by declaration; absence is - not a finding. + not a finding of this audit. `verify` already says it once, as `WARN_REQUIREMENT_LEDGER_EMPTY` + when the project has writable entities, and `"verify": { "requirements": { "missing": "off" } }` + is how a project records that it chose not to keep a ledger. ## Reporting diff --git a/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-verify/references/requirements.md b/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-verify/references/requirements.md index e859076180..0c61a778ff 100644 --- a/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-verify/references/requirements.md +++ b/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-verify/references/requirements.md @@ -89,6 +89,7 @@ So on a `planned` entry a dangling reference is the entry doing its job, not dri | situation | exit | |---|---| | clean tree, or no `requirement.*` nodes at all | 0 | +| writable entities and no requirement of the project's own (an empty ledger file counts as none) | 0 (warning `WARN_REQUIREMENT_LEDGER_EMPTY`; `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns it off) | | dangling `@implementedBy` on `live`/`partial` | 1 | | the same reference on `planned` | 0 | | `@implementedBy` above the L4 link floor | 1 | diff --git a/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-audit/references/requirements.md b/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-audit/references/requirements.md index 2bcebe9ec1..f3d8db9d24 100644 --- a/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-audit/references/requirements.md +++ b/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-audit/references/requirements.md @@ -145,7 +145,9 @@ deleted, and nothing reports them. something, never so every member must carry one. - **Dangling links on `planned`.** Correct — the plan precedes the nodes. - **A project with no requirements at all.** The feature is opt-in by declaration; absence is - not a finding. + not a finding of this audit. `verify` already says it once, as `WARN_REQUIREMENT_LEDGER_EMPTY` + when the project has writable entities, and `"verify": { "requirements": { "missing": "off" } }` + is how a project records that it chose not to keep a ledger. ## Reporting diff --git a/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-verify/references/requirements.md b/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-verify/references/requirements.md index e859076180..0c61a778ff 100644 --- a/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-verify/references/requirements.md +++ b/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-verify/references/requirements.md @@ -89,6 +89,7 @@ So on a `planned` entry a dangling reference is the entry doing its job, not dri | situation | exit | |---|---| | clean tree, or no `requirement.*` nodes at all | 0 | +| writable entities and no requirement of the project's own (an empty ledger file counts as none) | 0 (warning `WARN_REQUIREMENT_LEDGER_EMPTY`; `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns it off) | | dangling `@implementedBy` on `live`/`partial` | 1 | | the same reference on `planned` | 0 | | `@implementedBy` above the L4 link floor | 1 | diff --git a/fixtures/agent-context-conformance/rust/expected/.claude/skills/metaobjects-audit/references/requirements.md b/fixtures/agent-context-conformance/rust/expected/.claude/skills/metaobjects-audit/references/requirements.md index 2bcebe9ec1..f3d8db9d24 100644 --- a/fixtures/agent-context-conformance/rust/expected/.claude/skills/metaobjects-audit/references/requirements.md +++ b/fixtures/agent-context-conformance/rust/expected/.claude/skills/metaobjects-audit/references/requirements.md @@ -145,7 +145,9 @@ deleted, and nothing reports them. something, never so every member must carry one. - **Dangling links on `planned`.** Correct — the plan precedes the nodes. - **A project with no requirements at all.** The feature is opt-in by declaration; absence is - not a finding. + not a finding of this audit. `verify` already says it once, as `WARN_REQUIREMENT_LEDGER_EMPTY` + when the project has writable entities, and `"verify": { "requirements": { "missing": "off" } }` + is how a project records that it chose not to keep a ledger. ## Reporting diff --git a/fixtures/agent-context-conformance/rust/expected/.claude/skills/metaobjects-verify/references/requirements.md b/fixtures/agent-context-conformance/rust/expected/.claude/skills/metaobjects-verify/references/requirements.md index e859076180..0c61a778ff 100644 --- a/fixtures/agent-context-conformance/rust/expected/.claude/skills/metaobjects-verify/references/requirements.md +++ b/fixtures/agent-context-conformance/rust/expected/.claude/skills/metaobjects-verify/references/requirements.md @@ -89,6 +89,7 @@ So on a `planned` entry a dangling reference is the entry doing its job, not dri | situation | exit | |---|---| | clean tree, or no `requirement.*` nodes at all | 0 | +| writable entities and no requirement of the project's own (an empty ledger file counts as none) | 0 (warning `WARN_REQUIREMENT_LEDGER_EMPTY`; `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns it off) | | dangling `@implementedBy` on `live`/`partial` | 1 | | the same reference on `planned` | 0 | | `@implementedBy` above the L4 link floor | 1 | diff --git a/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-audit/references/requirements.md b/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-audit/references/requirements.md index 2bcebe9ec1..f3d8db9d24 100644 --- a/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-audit/references/requirements.md +++ b/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-audit/references/requirements.md @@ -145,7 +145,9 @@ deleted, and nothing reports them. something, never so every member must carry one. - **Dangling links on `planned`.** Correct — the plan precedes the nodes. - **A project with no requirements at all.** The feature is opt-in by declaration; absence is - not a finding. + not a finding of this audit. `verify` already says it once, as `WARN_REQUIREMENT_LEDGER_EMPTY` + when the project has writable entities, and `"verify": { "requirements": { "missing": "off" } }` + is how a project records that it chose not to keep a ledger. ## Reporting diff --git a/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-verify/references/requirements.md b/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-verify/references/requirements.md index e859076180..0c61a778ff 100644 --- a/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-verify/references/requirements.md +++ b/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-verify/references/requirements.md @@ -89,6 +89,7 @@ So on a `planned` entry a dangling reference is the entry doing its job, not dri | situation | exit | |---|---| | clean tree, or no `requirement.*` nodes at all | 0 | +| writable entities and no requirement of the project's own (an empty ledger file counts as none) | 0 (warning `WARN_REQUIREMENT_LEDGER_EMPTY`; `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns it off) | | dangling `@implementedBy` on `live`/`partial` | 1 | | the same reference on `planned` | 0 | | `@implementedBy` above the L4 link floor | 1 | diff --git a/fixtures/requirement-check-conformance/README.md b/fixtures/requirement-check-conformance/README.md index 07061e3703..312a744746 100644 --- a/fixtures/requirement-check-conformance/README.md +++ b/fixtures/requirement-check-conformance/README.md @@ -14,8 +14,11 @@ Each case is a directory: - `input/` holds one or more metadata documents (`.yaml` or `.json`). - `options.json` is optional. Its keys are `libraries` (a string array: the shipped - libraries to load beside `input/`) and `requireImplementers` (a boolean: the strict - switch, `verify --require-implementers`). No other key is legal. + libraries to load beside `input/`), `requireImplementers` (a boolean: the strict + switch, `verify --require-implementers`) and `verify` (the `verify` block of + `.metaobjects/config.json` exactly as a project writes it, run through the port's own config + reader, so a key that reader does not know fails the case; the gate reads + `verify.requirements.missing`). No other key is legal. - `expected.json` holds `{ "diagnostics": [...], "summary": {...} | null }`. A runner does three things, in this order: @@ -23,7 +26,7 @@ A runner does three things, in this order: 1. Load `input/` with the port's loader, **strict**, with the libraries `options.json` names, and assert **no load errors**. Load the files in ascending file-name order. 2. Run the gate over the loaded model, with the strict switch `options.json` sets - (default off), and compute the summary from the same run. Pass **no scope predicate**: + (default off) and `verify.requirements.missing` (default `warn`), and compute the summary from the same run. Pass **no scope predicate**: every non-abstract entity in the loaded model is coverable. Do **not force the coverage answer**: whether coverage is measured is derived from the requirements' packages, which is what the `coverage-library-*` cases test. (In the reference these are the @@ -58,6 +61,15 @@ it is wrong, unless the reference is shown to be wrong first. ## Things the cases pin that are easy to miss +- **An absent ledger is reported once, and only for a project that stores data.** + `WARN_REQUIREMENT_LEDGER_EMPTY` (always `warn`; `verify.requirements.missing: off` skips it) + is reported when coverage is not measured (no requirement of the project's own, the same + rule as object coverage) and at least one coverable entity is concrete, has a writable + source (declared or inherited through `extends`) and is not in a shipped library's package. + It has no `path`. The count in its message is that number of entities. An empty ledger file + and a library's ledger both count as no requirement (`ledger-empty-file`, + `ledger-empty-library-only`). Entities with no source report nothing (`no-requirements`). + - **A rejected claim still counts toward coverage.** The claim set is built from every requirement that is not `planned`, whatever its level and whatever the gate says about the reference's grain. `link-above-floor`, `l4-names-member`, `l5-names-object` and @@ -92,7 +104,11 @@ it is wrong, unless the reference is shown to be wrong first. | Case | What it pins | |---|---| -| `no-requirements` | Entities and no requirement: no diagnostics, and `summary` is `null`. | +| `no-requirements` | Entities with no source and no requirement: no diagnostics, and `summary` is `null`. | +| `ledger-empty-writable-entities` | Writable entities and no requirement: one `WARN_REQUIREMENT_LEDGER_EMPTY` counting the two concrete entities with a writable source (one inherits it through `extends`), not the abstract base or the sourceless entity; `summary` is `null`. | +| `ledger-empty-off` | The same input with `verify.requirements.missing: off`: nothing. | +| `ledger-empty-file` | An empty ledger file (what `meta init` scaffolds) beside a writable entity: the advisory, as if the file were absent. | +| `ledger-empty-library-only` | The `iam` library's ledger and a writable project entity: the advisory, and the library's summary. A library's ledger is not the project's. | | `clean-fully-claimed` | An L1 to L5 tree that claims every entity: no diagnostics, and the full summary with both coverage counts. | | `dangling-object-live` | `ERR_REQUIREMENT_DANGLING_REF` on a `live` requirement naming an object that does not exist. No object has that short name, so there is no hint. | | `dangling-object-partial` | The same on `partial`. The message carries the status. | diff --git a/fixtures/requirement-check-conformance/ledger-empty-file/expected.json b/fixtures/requirement-check-conformance/ledger-empty-file/expected.json new file mode 100644 index 0000000000..aed980050c --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-file/expected.json @@ -0,0 +1,10 @@ +{ + "diagnostics": [ + { + "severity": "warn", + "code": "WARN_REQUIREMENT_LEDGER_EMPTY", + "message": "1 writable entity and no requirement of the project's own, so nothing records what the software is for. Declare a requirement.functional for each feature, or set \"verify\": { \"requirements\": { \"missing\": \"off\" } } in .metaobjects/config.json." + } + ], + "summary": null +} diff --git a/fixtures/requirement-check-conformance/ledger-empty-file/input/meta.requirements.json b/fixtures/requirement-check-conformance/ledger-empty-file/input/meta.requirements.json new file mode 100644 index 0000000000..f693716822 --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-file/input/meta.requirements.json @@ -0,0 +1,3 @@ +{ + "metadata.root": {} +} diff --git a/fixtures/requirement-check-conformance/ledger-empty-file/input/meta.shop.yaml b/fixtures/requirement-check-conformance/ledger-empty-file/input/meta.shop.yaml new file mode 100644 index 0000000000..512dc69c50 --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-file/input/meta.shop.yaml @@ -0,0 +1,9 @@ +metadata: + package: acme::shop + children: + - object.entity: + name: Order + children: + - source.rdb: { table: orders } + - field.uuid: { name: id } + - identity.primary: { name: pk, fields: [id] } diff --git a/fixtures/requirement-check-conformance/ledger-empty-library-only/expected.json b/fixtures/requirement-check-conformance/ledger-empty-library-only/expected.json new file mode 100644 index 0000000000..8a57bef66a --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-library-only/expected.json @@ -0,0 +1,20 @@ +{ + "diagnostics": [ + { + "severity": "warn", + "code": "WARN_REQUIREMENT_LEDGER_EMPTY", + "message": "1 writable entity and no requirement of the project's own, so nothing records what the software is for. Declare a requirement.functional for each feature, or set \"verify\": { \"requirements\": { \"missing\": \"off\" } } in .metaobjects/config.json." + } + ], + "summary": { + "total": 12, + "functional": 8, + "architectural": 4, + "byStatus": { + "live": 10, + "partial": 2 + }, + "undecided": 0, + "deferredUntracked": 0 + } +} diff --git a/fixtures/requirement-check-conformance/ledger-empty-library-only/input/meta.shop.yaml b/fixtures/requirement-check-conformance/ledger-empty-library-only/input/meta.shop.yaml new file mode 100644 index 0000000000..512dc69c50 --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-library-only/input/meta.shop.yaml @@ -0,0 +1,9 @@ +metadata: + package: acme::shop + children: + - object.entity: + name: Order + children: + - source.rdb: { table: orders } + - field.uuid: { name: id } + - identity.primary: { name: pk, fields: [id] } diff --git a/fixtures/requirement-check-conformance/ledger-empty-library-only/options.json b/fixtures/requirement-check-conformance/ledger-empty-library-only/options.json new file mode 100644 index 0000000000..ed0e749e7f --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-library-only/options.json @@ -0,0 +1 @@ +{ "libraries": ["iam"] } diff --git a/fixtures/requirement-check-conformance/ledger-empty-off/expected.json b/fixtures/requirement-check-conformance/ledger-empty-off/expected.json new file mode 100644 index 0000000000..7aba952d13 --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-off/expected.json @@ -0,0 +1,4 @@ +{ + "diagnostics": [], + "summary": null +} diff --git a/fixtures/requirement-check-conformance/ledger-empty-off/input/meta.shop.yaml b/fixtures/requirement-check-conformance/ledger-empty-off/input/meta.shop.yaml new file mode 100644 index 0000000000..b1c020dff5 --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-off/input/meta.shop.yaml @@ -0,0 +1,31 @@ +metadata: + package: acme::shop + children: + # Abstract: shape, not data. Its source is inherited by Order, which is counted. + - object.entity: + name: BaseEntity + abstract: true + children: + - source.rdb: { table: base } + - field.uuid: { name: id } + - identity.primary: { name: pk, fields: [id] } + + - object.entity: + name: Order + extends: BaseEntity + children: + - field.string: { name: reference } + + - object.entity: + name: Customer + children: + - source.rdb: { table: customers } + - field.uuid: { name: id } + - identity.primary: { name: pk, fields: [id] } + + # No source: stores nothing, so not counted. + - object.entity: + name: Draft + children: + - field.uuid: { name: id } + - identity.primary: { name: pk, fields: [id] } diff --git a/fixtures/requirement-check-conformance/ledger-empty-off/options.json b/fixtures/requirement-check-conformance/ledger-empty-off/options.json new file mode 100644 index 0000000000..c32cbe0fad --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-off/options.json @@ -0,0 +1 @@ +{ "verify": { "requirements": { "missing": "off" } } } diff --git a/fixtures/requirement-check-conformance/ledger-empty-writable-entities/expected.json b/fixtures/requirement-check-conformance/ledger-empty-writable-entities/expected.json new file mode 100644 index 0000000000..a9709b48ad --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-writable-entities/expected.json @@ -0,0 +1,10 @@ +{ + "diagnostics": [ + { + "severity": "warn", + "code": "WARN_REQUIREMENT_LEDGER_EMPTY", + "message": "2 writable entities and no requirement of the project's own, so nothing records what the software is for. Declare a requirement.functional for each feature, or set \"verify\": { \"requirements\": { \"missing\": \"off\" } } in .metaobjects/config.json." + } + ], + "summary": null +} diff --git a/fixtures/requirement-check-conformance/ledger-empty-writable-entities/input/meta.shop.yaml b/fixtures/requirement-check-conformance/ledger-empty-writable-entities/input/meta.shop.yaml new file mode 100644 index 0000000000..b1c020dff5 --- /dev/null +++ b/fixtures/requirement-check-conformance/ledger-empty-writable-entities/input/meta.shop.yaml @@ -0,0 +1,31 @@ +metadata: + package: acme::shop + children: + # Abstract: shape, not data. Its source is inherited by Order, which is counted. + - object.entity: + name: BaseEntity + abstract: true + children: + - source.rdb: { table: base } + - field.uuid: { name: id } + - identity.primary: { name: pk, fields: [id] } + + - object.entity: + name: Order + extends: BaseEntity + children: + - field.string: { name: reference } + + - object.entity: + name: Customer + children: + - source.rdb: { table: customers } + - field.uuid: { name: id } + - identity.primary: { name: pk, fields: [id] } + + # No source: stores nothing, so not counted. + - object.entity: + name: Draft + children: + - field.uuid: { name: id } + - identity.primary: { name: pk, fields: [id] } diff --git a/scripts/rust-publish-dry-run.sh b/scripts/rust-publish-dry-run.sh index 6abfdb6eba..57b75ab43a 100755 --- a/scripts/rust-publish-dry-run.sh +++ b/scripts/rust-publish-dry-run.sh @@ -4,7 +4,7 @@ # CARGO_HOME. Nothing is uploaded. The `rust` lane (scripts/ci-local.sh) and the release # pack-verify (scripts/release.mjs) both run it. # -# Two kinds of stale state can make a dependency compile from old source. Both happen when +# Three kinds of stale state can make a dependency compile from old source. All happen when # the version stays the same while the source changes, which is every merge between releases: # # 1. Unpacked source. The dry run publishes each crate to a temporary overlay registry @@ -20,9 +20,17 @@ # `metaobjects-codegen`'s verify with E0432 on some runners and not others. The dry run # therefore uses its own target directory and removes this workspace's crates from it # first; third-party crates stay built. +# 3. The overlay registry itself. cargo rewrites /package/tmp-registry/.crate +# without truncating it, so a tarball shorter than the one an earlier run left there +# keeps that run's trailing bytes. Its checksum then no longer matches the overlay index, +# the overlay download fails, and cargo falls back to crates.io's PUBLISHED copy of the +# same version without saying so. `metaobjects-cli`'s verify then compiled against the +# released `metaobjects-codegen` and failed with E0609 on a field added since. The dry +# run therefore removes /package before it starts. # -# crates.io's copy of the same version is not involved: the overlay registry takes -# precedence for a version it holds ("Unpacking ... (registry .../tmp-registry)"). +# With that directory fresh, crates.io's copy of the same version is not involved: the +# overlay registry takes precedence for a version it holds ("Unpacking ... (registry +# .../tmp-registry)"). # # Usage: scripts/rust-publish-dry-run.sh [workspace-dir] (default server/rust) set -euo pipefail @@ -40,5 +48,6 @@ print(" ".join("-p " + p["name"] for p in json.load(sys.stdin)["packages"])) ') # shellcheck disable=SC2086 # one word per `-p ` cargo clean -q --locked --target-dir "$target" $members +rm -rf "$target/package" cargo publish --dry-run --workspace --locked --allow-dirty --target-dir "$target" diff --git a/scripts/write-requirement-corpus-expected.ts b/scripts/write-requirement-corpus-expected.ts index 0aa3893919..b34d6ed647 100644 --- a/scripts/write-requirement-corpus-expected.ts +++ b/scripts/write-requirement-corpus-expected.ts @@ -108,7 +108,12 @@ function summaryRecord(s: RequirementSummary): Record { } function checkExpected(root: MetaData, options: Readonly>): unknown { - const scan = scanRequirements(root, { requireImplementers: options["requireImplementers"] === true }); + // `verify` is the config block as a project writes it, through the real config schema. + const settings = rulesSettingsOf(ConfigSchema.pick({ verify: true }).parse({ verify: options["verify"] })); + const scan = scanRequirements(root, { + requireImplementers: options["requireImplementers"] === true, + requirementsMissing: settings.requirementsMissing, + }); const summary = summariseRequirements(root, scan); return { // Emission order — the order the reference evaluates its checks in — so the file @@ -217,7 +222,7 @@ function rulesExpected(root: MetaData, options: Readonly const CORPORA: Readonly> = { check: { dir: "fixtures/requirement-check-conformance", - optionKeys: ["libraries", "requireImplementers"], + optionKeys: ["libraries", "requireImplementers", "verify"], expected: checkExpected, }, identity: { diff --git a/server/csharp/MetaObjects.Cli.Tests/VerifyRequirementsTests.cs b/server/csharp/MetaObjects.Cli.Tests/VerifyRequirementsTests.cs index 97587a3f9a..984b47d011 100644 --- a/server/csharp/MetaObjects.Cli.Tests/VerifyRequirementsTests.cs +++ b/server/csharp/MetaObjects.Cli.Tests/VerifyRequirementsTests.cs @@ -63,6 +63,49 @@ public void A_model_with_no_requirement_prints_nothing_and_changes_no_exit_code( Assert.Equal("", stderr); } + private const string WritableOrder = """ + metadata: + package: acme::shop + children: + - object.entity: + name: Order + children: + - source.rdb: { table: orders } + - field.uuid: { name: id } + - identity.primary: { name: pk, fields: [id] } + """; + + private string[] WritableProject(string? config) + { + var args = Project(requirement: null); + File.WriteAllText(Path.Combine(_tmp, "model", "meta.shop.yaml"), WritableOrder); + if (config is not null) + { + Directory.CreateDirectory(Path.Combine(_tmp, ".metaobjects")); + File.WriteAllText(Path.Combine(_tmp, ".metaobjects", "config.json"), $$"""{ "schema_version": 1, {{config}} }"""); + } + return args; + } + + [Fact] + public void A_writable_entity_with_no_requirement_prints_the_absent_ledger_advisory_and_exits_0() + { + var (exitCode, stdout, stderr) = CliProcess.Run(_tmp, WritableProject(config: null)); + + Assert.True(exitCode == 0, $"exit={exitCode}\nstdout={stdout}\nstderr={stderr}"); + Assert.Contains(" WARN_REQUIREMENT_LEDGER_EMPTY: 1 writable entity and no requirement of the project's own, ", stderr); + } + + [Fact] + public void The_absent_ledger_advisory_is_silenced_by_verify_requirements_missing_off() + { + var (exitCode, stdout, stderr) = CliProcess.Run(_tmp, + WritableProject("\"verify\": { \"requirements\": { \"missing\": \"off\" } }")); + + Assert.True(exitCode == 0, $"exit={exitCode}\nstdout={stdout}\nstderr={stderr}"); + Assert.DoesNotContain("WARN_REQUIREMENT_LEDGER_EMPTY", stdout + stderr); + } + [Fact] public void A_model_with_no_requirement_stays_silent_when_a_gate_fails_too() { diff --git a/server/csharp/MetaObjects.Cli/Program.cs b/server/csharp/MetaObjects.Cli/Program.cs index 6b9d2dc8b3..d4e3c0a77a 100644 --- a/server/csharp/MetaObjects.Cli/Program.cs +++ b/server/csharp/MetaObjects.Cli/Program.cs @@ -651,8 +651,8 @@ static int RunVerify(string[] rest) Console.Error.WriteLine($" {result.DbRejectionMessage}"); // The requirement gate (ADR-0057) — on EVERY verify, whichever gates were selected, and not - // muted by --no-field-lint. A model with no requirement.* node sees no line and no exit-code - // change. Its errors fold into the exit code like any other gate's. It runs before the + // muted by --no-field-lint. A model with no requirement.* node gets at most the absent-ledger + // advisory from it and no exit-code change. Its errors fold into the exit code like any other gate's. It runs before the // advisory lint so the lint stays the last thing printed, as it was. // // A model that does not LOAD fails here, and is reported here unless a gate above already diff --git a/server/csharp/MetaObjects.Cli/VerifyCommand.cs b/server/csharp/MetaObjects.Cli/VerifyCommand.cs index 828f7d3908..8dbbd4411b 100644 --- a/server/csharp/MetaObjects.Cli/VerifyCommand.cs +++ b/server/csharp/MetaObjects.Cli/VerifyCommand.cs @@ -297,7 +297,7 @@ private static LoadResult LoadMetadata(Options opts) /// /// The requirement (capability) gate: reads the requirement.* nodes of the loaded model and /// reports what the loader cannot. requirement.* is metadata, so a model declaring none is - /// silent, not in drift: no line is printed and the exit code is unchanged. + /// not in drift: the exit code is unchanged and no line is printed but the absent-ledger advisory. /// /// Prints the summary line on every run that has a requirement, clean or not (a gate that /// says nothing when it passes cannot be told apart from one that checked nothing), then every @@ -328,9 +328,15 @@ public static int RunRequirementGate(Options opts, bool requireImplementers, Tex } var scan = RequirementCheck.Scan( - load.Root, requireImplementers: requireImplementers || Environment.GetEnvironmentVariable(REQUIRE_IMPLEMENTERS_ENV) == "1"); + load.Root, requireImplementers: requireImplementers || Environment.GetEnvironmentVariable(REQUIRE_IMPLEMENTERS_ENV) == "1", + requirementsMissing: opts.Rules.RequirementsMissing); var summary = RequirementCheck.Summarise(load.Root, scan); - if (summary is null) return 0; + if (summary is null) + { + // No requirement: no summary line, but the absent-ledger advisory may still apply. + foreach (var d in RequirementCheck.Check(load.Root, scan)) output.WriteLine(FormatRequirementDiagnostic(d)); + return 0; + } var files = opts.MetadataFiles?.Count ?? new DirectorySource(opts.MetadataDir).Expand().Count(); output.WriteLine(RequirementPrefix + SummaryText(summary, files)); diff --git a/server/csharp/MetaObjects.Conformance.Tests/NeutralConfigRulesTests.cs b/server/csharp/MetaObjects.Conformance.Tests/NeutralConfigRulesTests.cs index 16ad99fb54..c8ccf7fd27 100644 --- a/server/csharp/MetaObjects.Conformance.Tests/NeutralConfigRulesTests.cs +++ b/server/csharp/MetaObjects.Conformance.Tests/NeutralConfigRulesTests.cs @@ -31,7 +31,7 @@ private static RulesSettings Read(string extraJson) [Fact] public void AbsentKeys_TakeTheDefaults() { - Assert.Equal(new RulesSettings("derive", "initial", "unclaimed", "warn"), Read("")); + Assert.Equal(new RulesSettings("derive", "initial", "unclaimed", "warn", "warn"), Read("")); } [Fact] @@ -39,9 +39,9 @@ public void EveryKey_IsRead() { var settings = Read(""" "rules": { "permissions": { "names": "require" }, "lifecycle": { "create": "any", "commands": "none" } }, - "verify": { "handEdits": "fail", "lifecycle": { "unreachable": "error" } } + "verify": { "handEdits": "fail", "lifecycle": { "unreachable": "error" }, "requirements": { "missing": "off" } } """); - Assert.Equal(new RulesSettings("require", "any", "none", "error"), settings); + Assert.Equal(new RulesSettings("require", "any", "none", "error", "off"), settings); } [Theory] @@ -69,6 +69,15 @@ public void EveryKey_IsRead() [InlineData(""" "verify": { "handEdits": "warn" } """)] + [InlineData(""" + "verify": { "requirements": { "missing": "error" } } + """)] + [InlineData(""" + "verify": { "requirements": { "unknown": "warn" } } + """)] + [InlineData(""" + "verify": { "requirements": "off" } + """)] public void AMistake_IsRefusedNotDefaulted(string extraJson) { var ex = Assert.Throws(() => Read(extraJson)); diff --git a/server/csharp/MetaObjects.Conformance.Tests/RequirementCheckConformanceTests.cs b/server/csharp/MetaObjects.Conformance.Tests/RequirementCheckConformanceTests.cs index 7e6bedd013..62d1b1799a 100644 --- a/server/csharp/MetaObjects.Conformance.Tests/RequirementCheckConformanceTests.cs +++ b/server/csharp/MetaObjects.Conformance.Tests/RequirementCheckConformanceTests.cs @@ -1,5 +1,6 @@ using System.Text.Json; using System.Text.RegularExpressions; +using MetaObjects.Config; using MetaObjects.Core.Requirement; using MetaObjects.Loader; using Xunit; @@ -24,7 +25,7 @@ public class RequirementCheckConformanceTests /// string "true", would otherwise run the case without the strict switch and pin the wrong /// severity. /// - private static readonly string[] OptionKeys = ["libraries", "requireImplementers"]; + private static readonly string[] OptionKeys = ["libraries", "requireImplementers", "verify"]; /// A case whose input/ must be, file for file and byte for byte, another case's. private static readonly Dictionary SameInputAs = new() @@ -50,7 +51,9 @@ private static List Cases() => public static IEnumerable Fixtures() => Cases().Select(n => new object[] { n }); - private sealed record Options(string[] Libraries, bool RequireImplementers); + private const string Options_Default_Missing = "warn"; + + private sealed record Options(string[] Libraries, bool RequireImplementers, string RequirementsMissing = "warn"); private static Options ReadOptions(string caseDir) { @@ -79,7 +82,26 @@ private static Options ReadOptions(string caseDir) $"{file}: 'requireImplementers' must be a boolean"); require = req.GetBoolean(); } - return new Options(libraries, require); + + // `verify` is the config block exactly as a project writes it, run through the port's OWN config + // reader, so a key that reader does not know fails the case instead of being ignored. + var missing = Options_Default_Missing; + if (doc.RootElement.TryGetProperty("verify", out var verify)) + { + var cfg = Directory.CreateTempSubdirectory("mo-req-verify-opt-").FullName; + try + { + Directory.CreateDirectory(Path.Combine(cfg, ".metaobjects")); + File.WriteAllText(Path.Combine(cfg, ".metaobjects", "config.json"), + "{ \"schema_version\": 1, \"verify\": " + verify.GetRawText() + " }"); + missing = NeutralConfig.Read(cfg)!.Rules.RequirementsMissing; + } + finally + { + Directory.Delete(cfg, recursive: true); + } + } + return new Options(libraries, require, missing); } private static Dictionary InputFiles(string name) => @@ -249,7 +271,7 @@ public void Fixture(string name) Assert.Empty(load.Errors.Select(e => e.Code + ": " + e.Message)); // No scope predicate and no forced coverage answer: both are the port's defaults. - var scan = RequirementCheck.Scan(load.Root, requireImplementers: options.RequireImplementers); + var scan = RequirementCheck.Scan(load.Root, requireImplementers: options.RequireImplementers, requirementsMissing: options.RequirementsMissing); var actual = RequirementCheck.Check(load.Root, scan) .Select(d => (d.Severity, d.Code, d.Path ?? "", d.Message)) diff --git a/server/csharp/MetaObjects.Conformance.Tests/RequirementsPackLeftOutTests.cs b/server/csharp/MetaObjects.Conformance.Tests/RequirementsPackLeftOutTests.cs index 44ccf6f041..e4ab619bbe 100644 --- a/server/csharp/MetaObjects.Conformance.Tests/RequirementsPackLeftOutTests.cs +++ b/server/csharp/MetaObjects.Conformance.Tests/RequirementsPackLeftOutTests.cs @@ -6,7 +6,7 @@ namespace MetaObjects.Conformance.Tests; /// /// The requirements vocabulary is its own pack (metaobjects-requirements), composed by default. -/// With the pack left out the gate has nothing to read and reports nothing, and a model that declares a +/// With the pack left out the gate has no ledger to read and reports only the absent-ledger advisory, and a model that declares a /// requirement fails to load instead. /// public class RequirementsPackLeftOutTests @@ -52,12 +52,16 @@ private static TypeRegistry WithoutPack() => Provider.ComposeRegistry(CoreTypes.LibraryProviders.Where(p => p.Id != RequirementsMetaDataProvider.ProviderId).ToList()); [Fact] - public void A_model_with_no_requirements_loads_and_the_gate_reports_nothing() + public void A_model_with_no_requirements_loads_and_the_gate_reports_only_the_absent_ledger_advisory() { var result = Load(WithoutPack(), Order); Assert.Empty(result.Errors.Select(e => e.Code + ": " + e.Message)); var scan = RequirementCheck.Scan(result.Root); - Assert.Empty(RequirementCheck.Check(result.Root, scan)); + var only = Assert.Single(RequirementCheck.Check(result.Root, scan)); + Assert.Equal(RequirementCheck.WARN_REQUIREMENT_LEDGER_EMPTY, only.Code); + Assert.Equal(RequirementCheck.SeverityWarn, only.Severity); + Assert.Null(only.Path); + Assert.Empty(RequirementCheck.Check(result.Root, RequirementCheck.Scan(result.Root, requirementsMissing: "off"))); Assert.Null(RequirementCheck.Summarise(result.Root, scan)); } diff --git a/server/csharp/MetaObjects/Config/NeutralConfig.cs b/server/csharp/MetaObjects/Config/NeutralConfig.cs index 2b3381c32c..0d770b5a01 100644 --- a/server/csharp/MetaObjects/Config/NeutralConfig.cs +++ b/server/csharp/MetaObjects/Config/NeutralConfig.cs @@ -653,6 +653,7 @@ private static RulesSettings ReadRules(JsonElement root, string path) string create = RulesSettings.Default.LifecycleCreate; string commands = RulesSettings.Default.LifecycleCommands; string unreachable = RulesSettings.Default.LifecycleUnreachable; + string requirementsMissing = RulesSettings.Default.RequirementsMissing; static JsonElement.ObjectEnumerator Block(JsonElement owner, string name, string path) { @@ -720,7 +721,16 @@ static MetaModelException Unknown(string path, string block, string key, string Choice(p.Value, "verify.handEdits", HandEditsPolicies, path); continue; } - if (p.Name != "lifecycle") throw Unknown(path, "verify", p.Name, "\"handEdits\" and/or \"lifecycle\""); + if (p.Name == "requirements") + { + foreach (var q in Block(p.Value, "verify.requirements", path)) + { + if (q.Name != "missing") throw Unknown(path, "verify.requirements", q.Name, "\"missing\""); + requirementsMissing = Choice(q.Value, "verify.requirements.missing", RulesSettings.RequirementsMissingValues, path); + } + continue; + } + if (p.Name != "lifecycle") throw Unknown(path, "verify", p.Name, "\"handEdits\", \"lifecycle\" and/or \"requirements\""); foreach (var q in Block(p.Value, "verify.lifecycle", path)) { if (q.Name != "unreachable") throw Unknown(path, "verify.lifecycle", q.Name, "\"unreachable\""); @@ -728,7 +738,7 @@ static MetaModelException Unknown(string path, string block, string key, string } } } - return new RulesSettings(permissionNames, create, commands, unreachable); + return new RulesSettings(permissionNames, create, commands, unreachable, requirementsMissing); } /// The `wire` block (ADR-0019 Amendment 2): an unknown key, an unknown value, or a diff --git a/server/csharp/MetaObjects/Config/RulesSettings.cs b/server/csharp/MetaObjects/Config/RulesSettings.cs index 5ea983109b..50ebc32f3b 100644 --- a/server/csharp/MetaObjects/Config/RulesSettings.cs +++ b/server/csharp/MetaObjects/Config/RulesSettings.cs @@ -12,17 +12,21 @@ namespace MetaObjects.Config; /// rules.lifecycle.create: initial (default) or any. Read and validated; changes nothing yet. /// rules.lifecycle.commands: unclaimed (default), all, none. /// verify.lifecycle.unreachable: warn (default), error, off. +/// verify.requirements.missing: warn (default) or off. Never error. public sealed record RulesSettings( string PermissionNames = "derive", string LifecycleCreate = "initial", string LifecycleCommands = "unclaimed", - string LifecycleUnreachable = "warn") + string LifecycleUnreachable = "warn", + string RequirementsMissing = "warn") { public static readonly string[] PermissionNameValues = ["derive", "advise", "require"]; public static readonly string[] LifecycleCreateValues = ["initial", "any"]; public static readonly string[] LifecycleCommandsValues = ["unclaimed", "all", "none"]; public static readonly string[] LifecycleUnreachableValues = ["warn", "error", "off"]; + public static readonly string[] RequirementsMissingValues = ["warn", "off"]; + /// Every key at its default. public static readonly RulesSettings Default = new(); } diff --git a/server/csharp/MetaObjects/Core/Requirement/RequirementCheck.cs b/server/csharp/MetaObjects/Core/Requirement/RequirementCheck.cs index 0858b5946a..a68064711e 100644 --- a/server/csharp/MetaObjects/Core/Requirement/RequirementCheck.cs +++ b/server/csharp/MetaObjects/Core/Requirement/RequirementCheck.cs @@ -49,7 +49,8 @@ public sealed record RequirementScan( IReadOnlyList Addressed, IReadOnlySet ClaimedObjects, bool MeasureCoverage, - bool RequireImplementers); + bool RequireImplementers, + string RequirementsMissing = "warn"); /// /// Counts behind the summary line printed on every run, clean or not. EntitiesTotal and @@ -82,6 +83,7 @@ public static class RequirementCheck public const string WARN_REQUIREMENT_OBJECT_UNCLAIMED = "WARN_REQUIREMENT_OBJECT_UNCLAIMED"; public const string WARN_REQUIREMENT_DISPOSITION_NOT_APPLICABLE = "WARN_REQUIREMENT_DISPOSITION_NOT_APPLICABLE"; public const string WARN_REQUIREMENT_DEFERRED_UNTRACKED = "WARN_REQUIREMENT_DEFERRED_UNTRACKED"; + public const string WARN_REQUIREMENT_LEDGER_EMPTY = "WARN_REQUIREMENT_LEDGER_EMPTY"; public const string WARN_REQUIREMENT_NOTHING_IMPLEMENTS = "WARN_REQUIREMENT_NOTHING_IMPLEMENTS"; /// @@ -151,14 +153,15 @@ public static string EffectivePackage(MetaData node) /// /// The strict switch: raise to an error. /// - public static RequirementScan Scan(MetaData root, bool? measureCoverage = null, bool requireImplementers = false) + public static RequirementScan Scan(MetaData root, bool? measureCoverage = null, bool requireImplementers = false, string requirementsMissing = "warn") { var addressed = CollectLedger(root); return new RequirementScan( addressed, ClaimedObjectKeys(root, addressed.Select(a => a.Node)), measureCoverage ?? ProjectAuthoredRequirements(addressed, (root as MetaRoot)?.ImportScope), - requireImplementers); + requireImplementers, + requirementsMissing); } /// @@ -272,6 +275,25 @@ private static List CoverableEntities(MetaData root) => .Where(n => (root as MetaRoot)?.ImportScope?.InScope(n.ResolutionKey()) ?? true) .ToList(); + /// + /// Coverable entities that are not a shipped library's and have a writable source among their + /// RESOLVING children (inherited via extends counts, ADR-0039). The count behind + /// . + /// + private static int WritableProjectEntities(MetaData root) + { + var libraryPackages = LibrarySources.LibraryPackages(); + var n = 0; + foreach (var ent in CoverableEntities(root)) + { + var key = ent.ResolutionKey(); + var sep = key.LastIndexOf(PACKAGE_SEPARATOR, StringComparison.Ordinal); + if (libraryPackages.Contains(sep < 0 ? "" : key[..sep])) continue; + if (ent.Children().Any(c => c is MetaSource ms && ms.IsWritable())) n++; + } + return n; + } + /// /// True when this requirement, or anything nested beneath it, names an implementing node. /// Subtree-scoped deliberately: an L1 solution that delegates everything to its children @@ -322,13 +344,30 @@ private static bool SubtreeClaimsAnything(MetaRequirement req) // -- the gate --------------------------------------------------------------------------- /// - /// Check the requirement tree against the loaded model. No requirements: no diagnostics. + /// Check the requirement tree against the loaded model. No requirements: at most the absent-ledger advisory. /// Rows are evaluated per requirement in the order of the reference's code table; object /// coverage runs once, after every requirement. /// public static IReadOnlyList Check(MetaData root, RequirementScan scan) { var output = new List(); + + // The one finding about an ABSENT ledger: a project with writable entities and no requirement + // of its own gets ONE advisory, never an error. Evaluated before the early exit so it fires + // with zero requirements. A forced MeasureCoverage (the standalone library gate) is the + // library's own ledger, so no advice. + if (!scan.MeasureCoverage && scan.RequirementsMissing != "off") + { + var n = WritableProjectEntities(root); + if (n > 0) + { + output.Add(new RequirementDiagnostic( + SeverityWarn, WARN_REQUIREMENT_LEDGER_EMPTY, null, + Invariant($"{n} writable {(n == 1 ? "entity" : "entities")} and no requirement of the project's own, ") + + "so nothing records what the software is for. Declare a requirement.functional for each " + + "feature, or set \"verify\": { \"requirements\": { \"missing\": \"off\" } } in .metaobjects/config.json.")); + } + } if (scan.Addressed.Count == 0) return output; // opt-in by declaration foreach (var (req, reqPath) in scan.Addressed) diff --git a/server/java/maven-plugin/src/main/java/com/metaobjects/mojo/MetaDataVerifyMojo.java b/server/java/maven-plugin/src/main/java/com/metaobjects/mojo/MetaDataVerifyMojo.java index 8b1c826dc9..e06413f1a9 100644 --- a/server/java/maven-plugin/src/main/java/com/metaobjects/mojo/MetaDataVerifyMojo.java +++ b/server/java/maven-plugin/src/main/java/com/metaobjects/mojo/MetaDataVerifyMojo.java @@ -392,8 +392,9 @@ private static List sourceFiles(MetaDataLoader loader) { /** * Runs once per {@code execute()}, whichever mode was selected, as soon as the metadata has - * loaded, so what it found is printed even when the drift gate then fails the build. A model - * that declares no {@code requirement.*} node sees no change at all: nothing is logged. + * loaded, so what it found is printed even when the drift gate then fails the build. For a + * model that declares no {@code requirement.*} node, the requirement ledger logs at most the + * absent-ledger advisory; the business-rules gate run here reports separately. * * @return the number of errors found; the caller fails the build once its own gate has reported */ @@ -439,17 +440,27 @@ private int runRulesGate(MetaDataLoader loader) { } private int runRequirementLedger(MetaDataLoader loader) { + RulesSettings settings = RulesSettings.DEFAULT; + try { + settings = resolveProjectConfig(getSourceDir()).map(NeutralConfig::getRulesSettings) + .orElse(RulesSettings.DEFAULT); + } catch (MetaDataException e) { + // A bad config is reported once, by the rules gate that runs next. + } RequirementCheck.Scan scan = RequirementCheck.scan(loader.getRoot(), new RequirementCheck.Options(null, - requireImplementers || "1".equals(getEnv(ENV_REQUIRE_IMPLEMENTERS)))); + requireImplementers || "1".equals(getEnv(ENV_REQUIRE_IMPLEMENTERS)), + settings.requirementsMissing())); RequirementCheck.Summary summary = RequirementCheck.summarise(loader.getRoot(), scan); - if (summary == null) return 0; // Printed on every run, clean or not: a gate that says nothing when it passes cannot be - // told apart from a gate that checked nothing. - getLog().info(PREFIX + RequirementCheck.summaryText(summary, sourceFiles(loader).size())); - String undecided = RequirementCheck.undecidedText(summary); - if (undecided != null) getLog().info(PREFIX + undecided); + // told apart from a gate that checked nothing. No requirement: no summary, but the + // absent-ledger advisory (WARN_REQUIREMENT_LEDGER_EMPTY) still prints. + if (summary != null) { + getLog().info(PREFIX + RequirementCheck.summaryText(summary, sourceFiles(loader).size())); + String undecided = RequirementCheck.undecidedText(summary); + if (undecided != null) getLog().info(PREFIX + undecided); + } // Every error, then every warning, as the reference and the other ports print them: the // checks find them interleaved, and an error must not be lost among the warnings. diff --git a/server/java/maven-plugin/src/test/java/com/metaobjects/mojo/MetaDataVerifyRequirementsTest.java b/server/java/maven-plugin/src/test/java/com/metaobjects/mojo/MetaDataVerifyRequirementsTest.java index 39b68472ee..74e6298be7 100644 --- a/server/java/maven-plugin/src/test/java/com/metaobjects/mojo/MetaDataVerifyRequirementsTest.java +++ b/server/java/maven-plugin/src/test/java/com/metaobjects/mojo/MetaDataVerifyRequirementsTest.java @@ -2,6 +2,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; +import com.metaobjects.config.Dependencies; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.logging.SystemStreamLog; import org.junit.Test; @@ -137,6 +138,73 @@ public void aModelWithNoRequirementLogsNothingAndDoesNotFail() throws Exception } } + private static final String STORED_ORDER_ENTITY = """ + { "object.entity": { "name": "Order", "children": [ + { "source.rdb": { "name": "src", "@table": "orders" } }, + { "field.long": { "name": "id" } }, + { "identity.primary": { "name": "pk", "@fields": ["id"] } } ] } }"""; + + private static final String LEDGER_EMPTY_MESSAGE = " WARN_REQUIREMENT_LEDGER_EMPTY: 1 writable entity and no requirement " + + "of the project's own, so nothing records what the software is for. Declare a requirement.functional for " + + "each feature, or set \"verify\": { \"requirements\": { \"missing\": \"off\" } } in .metaobjects/config.json."; + + @Test + public void aWritableEntityWithNoRequirementPrintsTheLedgerEmptyAdvisoryAndDoesNotFail() throws Exception { + Run run = run(model(STORED_ORDER_ENTITY), "templates", false, NO_ENV); + assertNull(run.failure()); + assertTrue(run.log().warnings.toString(), run.log().warnings.contains(LEDGER_EMPTY_MESSAGE)); + assertTrue(run.log().errors.toString(), run.log().errors.isEmpty()); + } + + @Test + public void verifyRequirementsMissingOffSilencesTheLedgerEmptyAdvisory() throws Exception { + Path dir = model(STORED_ORDER_ENTITY); + Files.createDirectories(dir.resolve(".metaobjects")); + Files.writeString(dir.resolve(".metaobjects/config.json"), + "{ \"schema_version\": 1, \"verify\": { \"requirements\": { \"missing\": \"off\" } } }", StandardCharsets.UTF_8); + Run run = run(dir, "templates", false, NO_ENV); + assertNull(run.failure()); + assertEquals(run.log().all().toString(), 0, run.log().count("WARN_REQUIREMENT_LEDGER_EMPTY")); + } + + @Test + public void aDependencysWritableEntityIsNotCountedByTheLedgerEmptyAdvisory() throws Exception { + byte[] shared = """ + { "metadata.root": { "package": "acme::common", "children": [ + { "object.entity": { "name": "Account", "children": [ + { "source.rdb": { "name": "src", "@table": "accounts" } }, + { "field.long": { "name": "id" } }, + { "identity.primary": { "name": "pk", "@fields": ["id"] } } ] } } ] } }""" + .getBytes(StandardCharsets.UTF_8); + + Path importsOnly = model(); + importShared(importsOnly, shared); + Run none = run(importsOnly, "templates", false, NO_ENV); + assertNull(none.failure()); + assertEquals(none.log().all().toString(), 0, none.log().count("WARN_REQUIREMENT_LEDGER_EMPTY")); + + Path withOwn = model(STORED_ORDER_ENTITY); + importShared(withOwn, shared); + Run own = run(withOwn, "templates", false, NO_ENV); + assertNull(own.failure()); + assertTrue(own.log().warnings.toString(), own.log().warnings.contains(LEDGER_EMPTY_MESSAGE)); + } + + private static void importShared(Path project, byte[] artifact) throws IOException { + Path snapshot = project.resolve(".metaobjects/deps/acme-common/acme-common.metaobjects.json"); + Files.createDirectories(snapshot.getParent()); + Files.write(snapshot, artifact); + Files.writeString(project.resolve(".metaobjects/config.json"), + "{ \"schema_version\": 1, \"dependencies\": [ { \"name\": \"acme-common\", \"path\": \"../acme-common\" } ] }", + StandardCharsets.UTF_8); + Files.writeString(project.resolve(".metaobjects/deps.lock.json"), + "{ \"schema_version\": 1, \"dependencies\": { \"acme-common\": { \"version\": \"1.0.0\", " + + "\"metamodelVersion\": \"1.0\", \"resolvedFrom\": { \"path\": \"../acme-common\" }, " + + "\"artifact\": \"acme-common.metaobjects.json\", \"integrity\": \"" + Dependencies.sha256Integrity(artifact) + + "\", \"packages\": [\"acme::common\"], \"nodes\": [\"acme::common::Account\"] } } }", + StandardCharsets.UTF_8); + } + @Test public void aDanglingLiveReferenceFailsTheBuildAfterLoggingTheCodePathAndSummary() throws Exception { Run run = run(model(ORDER_ENTITY, requirement("Recorded", "live", "Ordr")), "templates", false, NO_ENV); diff --git a/server/java/metadata/src/main/java/com/metaobjects/config/NeutralConfig.java b/server/java/metadata/src/main/java/com/metaobjects/config/NeutralConfig.java index 9c21da9a1c..c7dd5c20ce 100644 --- a/server/java/metadata/src/main/java/com/metaobjects/config/NeutralConfig.java +++ b/server/java/metadata/src/main/java/com/metaobjects/config/NeutralConfig.java @@ -639,6 +639,7 @@ private static RulesSettings parseRulesSettings(JsonElement rules, JsonElement v RulesSettings.LifecycleCreate create = null; RulesSettings.LifecycleCommands commands = null; RulesSettings.LifecycleUnreachable unreachable = null; + RulesSettings.RequirementsMissing missing = null; if (rules != null) { if (!rules.isJsonObject()) throw bad(origin + ": \"rules\" must be an object"); JsonObject rulesObj = rules.getAsJsonObject(); @@ -660,8 +661,8 @@ private static RulesSettings parseRulesSettings(JsonElement rules, JsonElement v if (!verify.isJsonObject()) throw bad(origin + ": \"verify\" must be an object"); JsonObject verifyObj = verify.getAsJsonObject(); for (String k : verifyObj.keySet()) { - if (!k.equals("lifecycle") && !k.equals(VERIFY_KEY_HAND_EDITS)) { - throw bad(origin + ": \"verify\" has unknown key \"" + k + "\"; expected \"handEdits\" and/or \"lifecycle\""); + if (!k.equals("lifecycle") && !k.equals("requirements") && !k.equals(VERIFY_KEY_HAND_EDITS)) { + throw bad(origin + ": \"verify\" has unknown key \"" + k + "\"; expected \"handEdits\", \"lifecycle\" and/or \"requirements\""); } } // `verify.handEdits` is read by the TypeScript `meta verify` only (this port's verify @@ -674,9 +675,13 @@ private static RulesSettings parseRulesSettings(JsonElement rules, JsonElement v JsonObject life = settingsBlock(verifyObj, "lifecycle", "verify.lifecycle", List.of("unreachable"), origin); unreachable = settingValue(life, "unreachable", "verify.lifecycle.unreachable", RulesSettings.LifecycleUnreachable::of, "\"warn\", \"error\", \"off\"", origin); + JsonObject reqs = settingsBlock(verifyObj, "requirements", "verify.requirements", List.of("missing"), origin); + missing = settingValue(reqs, "missing", "verify.requirements.missing", + RulesSettings.RequirementsMissing::of, "\"warn\", \"off\"", origin); } return new RulesSettings(names != null ? names : d.permissionNames(), create != null ? create : d.lifecycleCreate(), - commands != null ? commands : d.lifecycleCommands(), unreachable != null ? unreachable : d.lifecycleUnreachable()); + commands != null ? commands : d.lifecycleCommands(), unreachable != null ? unreachable : d.lifecycleUnreachable(), + missing != null ? missing : d.requirementsMissing()); } /** diff --git a/server/java/metadata/src/main/java/com/metaobjects/config/RulesSettings.java b/server/java/metadata/src/main/java/com/metaobjects/config/RulesSettings.java index 3b40feba8b..deeb49e30e 100644 --- a/server/java/metadata/src/main/java/com/metaobjects/config/RulesSettings.java +++ b/server/java/metadata/src/main/java/com/metaobjects/config/RulesSettings.java @@ -28,12 +28,15 @@ * @param lifecycleCreate {@code rules.lifecycle.create}: read and validated, changes nothing yet * @param lifecycleCommands {@code rules.lifecycle.commands} * @param lifecycleUnreachable {@code verify.lifecycle.unreachable} + * @param requirementsMissing {@code verify.requirements.missing} */ public record RulesSettings(PermissionNames permissionNames, LifecycleCreate lifecycleCreate, - LifecycleCommands lifecycleCommands, LifecycleUnreachable lifecycleUnreachable) { + LifecycleCommands lifecycleCommands, LifecycleUnreachable lifecycleUnreachable, + RequirementsMissing requirementsMissing) { public static final RulesSettings DEFAULT = new RulesSettings( - PermissionNames.DERIVE, LifecycleCreate.INITIAL, LifecycleCommands.UNCLAIMED, LifecycleUnreachable.WARN); + PermissionNames.DERIVE, LifecycleCreate.INITIAL, LifecycleCommands.UNCLAIMED, LifecycleUnreachable.WARN, + RequirementsMissing.WARN); /** {@code derive} (default) says nothing, {@code advise} warns, {@code require} fails the build. */ public enum PermissionNames { @@ -71,6 +74,19 @@ public enum LifecycleUnreachable { public static LifecycleUnreachable of(String s) { return parse(values(), s); } } + /** + * {@code verify.requirements.missing}: whether the requirement gate advises a project that + * declares writable entities and no requirement of its own. {@code warn} (default) or + * {@code off}; never {@code error}, the advisory cannot fail a build. + */ + public enum RequirementsMissing { + WARN, OFF; + + public String wireName() { return name().toLowerCase(Locale.ROOT); } + + public static RequirementsMissing of(String s) { return parse(values(), s); } + } + /** The constant whose wire name is {@code s}, or {@code null}. */ private static > E parse(E[] values, String s) { for (E e : values) if (e.name().toLowerCase(Locale.ROOT).equals(s)) return e; diff --git a/server/java/metadata/src/main/java/com/metaobjects/requirement/RequirementCheck.java b/server/java/metadata/src/main/java/com/metaobjects/requirement/RequirementCheck.java index 4dfe49e302..7528eadd4f 100644 --- a/server/java/metadata/src/main/java/com/metaobjects/requirement/RequirementCheck.java +++ b/server/java/metadata/src/main/java/com/metaobjects/requirement/RequirementCheck.java @@ -3,10 +3,12 @@ import com.metaobjects.MetaData; import com.metaobjects.MetaRoot; import com.metaobjects.config.DependencySet; +import com.metaobjects.config.RulesSettings; import com.metaobjects.io.util.IOUtil; import com.metaobjects.library.LibrarySources; import com.metaobjects.loader.ValidationPhase; import com.metaobjects.object.MetaObject; +import com.metaobjects.source.MetaSource; import com.metaobjects.validation.SymbolTable; import java.util.ArrayList; @@ -52,15 +54,23 @@ public record Addressed(MetaRequirement node, String path) {} * the requirements (see {@code projectAuthoredRequirements}) * @param requireImplementers the strict switch: raise {@link #WARN_REQUIREMENT_NOTHING_IMPLEMENTS} * to an error + * @param requirementsMissing {@code verify.requirements.missing}; {@code null} reads as the + * default, {@code warn} */ - public record Options(Boolean measureCoverage, boolean requireImplementers) {} + public record Options(Boolean measureCoverage, boolean requireImplementers, + RulesSettings.RequirementsMissing requirementsMissing) { + public Options(Boolean measureCoverage, boolean requireImplementers) { + this(measureCoverage, requireImplementers, RulesSettings.RequirementsMissing.WARN); + } + } /** * What one run computes once and both the gate and the summary read, so the printed * summary cannot disagree with the diagnostics beneath it. */ public record Scan(List addressed, Set claimedObjects, boolean measureCoverage, - boolean requireImplementers, SymbolTable symbols) {} + boolean requireImplementers, SymbolTable symbols, + RulesSettings.RequirementsMissing requirementsMissing) {} /** * Counts behind the summary line printed on every run, clean or not. @@ -81,6 +91,7 @@ public record Summary(int total, int functional, int architectural, Map coverableEntities(MetaRoot root) { return out; } + /** + * How many coverable entities store data: concrete, with a writable source (declared or + * inherited, ADR-0039), not a dependency's unless {@code scope.include} names its package, and + * not in a shipped library's package. The count behind + * {@link #WARN_REQUIREMENT_LEDGER_EMPTY}. + */ + private static int writableProjectEntities(MetaRoot root) { + Set libraryPackages = LibrarySources.libraryPackages(); + DependencySet dependencies = root.getDependencySet(); + int n = 0; + for (MetaData ent : coverableEntities(root)) { + if (!dependencies.inScope(ent.getName())) continue; + if (libraryPackages.contains(effectivePackage(ent))) continue; + // Resolving read (ADR-0039): a source inherited via extends counts. + for (MetaData c : ent.getChildren(MetaData.class, true)) { + if (c instanceof MetaSource src && src.isWritable()) { n++; break; } + } + } + return n; + } + // ------------------------------------------------------------------ // the gate // ------------------------------------------------------------------ /** - * Check the requirement tree against the loaded model. No requirements: no diagnostics. + * Check the requirement tree against the loaded model. No requirements: at most the absent-ledger advisory. * Rows are evaluated per requirement in the order of the reference's code table; object * coverage runs once, after every requirement. */ public static List check(MetaRoot root, Scan scan) { List out = new ArrayList<>(); + + // The one finding about an ABSENT ledger: a project with writable entities and no + // requirement of its own gets ONE advisory, never an error, silenced by + // verify.requirements.missing: off. "Of its own" is the coverage-activation rule, so an + // empty ledger file, a library's ledger or a dependency's counts as none. + if (!scan.measureCoverage() && scan.requirementsMissing() != RulesSettings.RequirementsMissing.OFF) { + int n = writableProjectEntities(root); + if (n > 0) { + out.add(new Diagnostic(Severity.WARN, WARN_REQUIREMENT_LEDGER_EMPTY, null, + n + " writable " + (n == 1 ? "entity" : "entities") + " and no requirement of the project's own, " + + "so nothing records what the software is for. Declare a requirement.functional for each " + + "feature, or set \"verify\": { \"requirements\": { \"missing\": \"off\" } } in .metaobjects/config.json.")); + } + } if (scan.addressed().isEmpty()) return out; // opt-in by declaration Map ledger = ledgerIndex(scan.addressed()); diff --git a/server/java/metadata/src/test/java/com/metaobjects/config/NeutralConfigTest.java b/server/java/metadata/src/test/java/com/metaobjects/config/NeutralConfigTest.java index 666af21467..9fee45e437 100644 --- a/server/java/metadata/src/test/java/com/metaobjects/config/NeutralConfigTest.java +++ b/server/java/metadata/src/test/java/com/metaobjects/config/NeutralConfigTest.java @@ -205,6 +205,7 @@ public void rulesSettingsAbsentKeysTakeTheDefaults() throws IOException { assertEquals(RulesSettings.DEFAULT, NeutralConfig.read(dir).orElseThrow().getRulesSettings()); assertEquals("derive", RulesSettings.DEFAULT.permissionNames().wireName()); assertEquals("warn", RulesSettings.DEFAULT.lifecycleUnreachable().wireName()); + assertEquals("warn", RulesSettings.DEFAULT.requirementsMissing().wireName()); } @Test @@ -212,12 +213,14 @@ public void rulesSettingsEveryKeyIsRead() throws IOException { Path dir = writeConfig("{ \"schema_version\": 1, " + "\"rules\": { \"permissions\": { \"names\": \"require\" }, " + "\"lifecycle\": { \"create\": \"any\", \"commands\": \"none\" } }, " - + "\"verify\": { \"handEdits\": \"fail\", \"lifecycle\": { \"unreachable\": \"error\" } } }"); + + "\"verify\": { \"handEdits\": \"fail\", \"lifecycle\": { \"unreachable\": \"error\" }, " + + "\"requirements\": { \"missing\": \"off\" } } }"); RulesSettings s = NeutralConfig.read(dir).orElseThrow().getRulesSettings(); assertEquals("require", s.permissionNames().wireName()); assertEquals("any", s.lifecycleCreate().wireName()); assertEquals("none", s.lifecycleCommands().wireName()); assertEquals("error", s.lifecycleUnreachable().wireName()); + assertEquals("off", s.requirementsMissing().wireName()); } @Test @@ -233,6 +236,9 @@ public void rulesSettingsMistakesAreRefusedNotDefaulted() throws IOException { "\"verify\": { \"lifecycle\": { \"unreachable\": \"fail\" } }", "\"verify\": { \"lifecycles\": {} }", "\"verify\": { \"handEdits\": \"warn\" }", + "\"verify\": { \"requirements\": { \"missing\": \"error\" } }", + "\"verify\": { \"requirements\": { \"mising\": \"off\" } }", + "\"verify\": { \"requirements\": \"off\" }", }; for (String mistake : mistakes) { Path dir = writeConfig("{ \"schema_version\": 1, " + mistake + " }"); diff --git a/server/java/metadata/src/test/java/com/metaobjects/conformance/RequirementCheckConformanceTest.java b/server/java/metadata/src/test/java/com/metaobjects/conformance/RequirementCheckConformanceTest.java index 23edd6945d..379372f91b 100644 --- a/server/java/metadata/src/test/java/com/metaobjects/conformance/RequirementCheckConformanceTest.java +++ b/server/java/metadata/src/test/java/com/metaobjects/conformance/RequirementCheckConformanceTest.java @@ -5,6 +5,8 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.metaobjects.MetaRoot; +import com.metaobjects.config.NeutralConfig; +import com.metaobjects.config.RulesSettings; import com.metaobjects.library.LibrarySources; import com.metaobjects.loader.DirectorySource; import com.metaobjects.loader.LoaderOptions; @@ -49,7 +51,7 @@ public class RequirementCheckConformanceTest { private static final Path CORPUS = CorpusRoot.locate().resolveSibling("requirement-check-conformance"); /** The whole of {@code options.json}: a key outside this list is refused, not ignored. */ - private static final List OPTION_KEYS = List.of("libraries", "requireImplementers"); + private static final List OPTION_KEYS = List.of("libraries", "requireImplementers", "verify"); /** A case whose {@code input/} must be, file for file, another case's. */ private static final Map SAME_INPUT_AS = Map.of( @@ -98,6 +100,7 @@ public void fixture() throws IOException { List libraries = new ArrayList<>(); boolean requireImplementers = false; + RulesSettings settings = RulesSettings.DEFAULT; Path optionsFile = dir.resolve("options.json"); if (Files.isRegularFile(optionsFile)) { JsonObject options = JsonParser.parseString(Files.readString(optionsFile, StandardCharsets.UTF_8)).getAsJsonObject(); @@ -112,6 +115,13 @@ public void fixture() throws IOException { options.get("requireImplementers").getAsJsonPrimitive().isBoolean()); requireImplementers = options.get("requireImplementers").getAsBoolean(); } + if (options.has("verify")) { + // The verify block exactly as a project writes it, through the port's own config reader. + JsonObject cfg = new JsonObject(); + cfg.addProperty("schema_version", 1); + cfg.add("verify", options.get("verify")); + settings = NeutralConfig.parse(cfg.toString(), optionsFile.toString()).getRulesSettings(); + } } String twin = SAME_INPUT_AS.get(name); @@ -128,7 +138,7 @@ public void fixture() throws IOException { // Step 2: no scope predicate, no forced coverage answer. MetaRoot root = loader.getRoot(); - RequirementCheck.Scan scan = RequirementCheck.scan(root, new RequirementCheck.Options(null, requireImplementers)); + RequirementCheck.Scan scan = RequirementCheck.scan(root, new RequirementCheck.Options(null, requireImplementers, settings.requirementsMissing())); // Step 3: compare. assertEquals(name, multiset(expected.getAsJsonArray("diagnostics")), actualRows(RequirementCheck.check(root, scan))); diff --git a/agent-context-shipped/files/651a126eaa501924.md b/server/python/src/metaobjects/agent_context/shipped/files/507ff854b296858c.md similarity index 97% rename from agent-context-shipped/files/651a126eaa501924.md rename to server/python/src/metaobjects/agent_context/shipped/files/507ff854b296858c.md index 2bcebe9ec1..f3d8db9d24 100644 --- a/agent-context-shipped/files/651a126eaa501924.md +++ b/server/python/src/metaobjects/agent_context/shipped/files/507ff854b296858c.md @@ -145,7 +145,9 @@ deleted, and nothing reports them. something, never so every member must carry one. - **Dangling links on `planned`.** Correct — the plan precedes the nodes. - **A project with no requirements at all.** The feature is opt-in by declaration; absence is - not a finding. + not a finding of this audit. `verify` already says it once, as `WARN_REQUIREMENT_LEDGER_EMPTY` + when the project has writable entities, and `"verify": { "requirements": { "missing": "off" } }` + is how a project records that it chose not to keep a ledger. ## Reporting diff --git a/server/rust/metaobjects-cli/agent-context-shipped/files/0ee567e8d039312d.md b/server/python/src/metaobjects/agent_context/shipped/files/805c0b6a53fc3464.md similarity index 98% rename from server/rust/metaobjects-cli/agent-context-shipped/files/0ee567e8d039312d.md rename to server/python/src/metaobjects/agent_context/shipped/files/805c0b6a53fc3464.md index e859076180..0c61a778ff 100644 --- a/server/rust/metaobjects-cli/agent-context-shipped/files/0ee567e8d039312d.md +++ b/server/python/src/metaobjects/agent_context/shipped/files/805c0b6a53fc3464.md @@ -89,6 +89,7 @@ So on a `planned` entry a dangling reference is the entry doing its job, not dri | situation | exit | |---|---| | clean tree, or no `requirement.*` nodes at all | 0 | +| writable entities and no requirement of the project's own (an empty ledger file counts as none) | 0 (warning `WARN_REQUIREMENT_LEDGER_EMPTY`; `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns it off) | | dangling `@implementedBy` on `live`/`partial` | 1 | | the same reference on `planned` | 0 | | `@implementedBy` above the L4 link floor | 1 | diff --git a/server/python/src/metaobjects/agent_context/shipped/manifest.json b/server/python/src/metaobjects/agent_context/shipped/manifest.json index b1e912da4f..0ee3bcedbe 100644 --- a/server/python/src/metaobjects/agent_context/shipped/manifest.json +++ b/server/python/src/metaobjects/agent_context/shipped/manifest.json @@ -35,7 +35,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -215,7 +215,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -257,7 +257,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -437,7 +437,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -481,7 +481,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -665,7 +665,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -709,7 +709,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -893,7 +893,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -938,7 +938,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1126,7 +1126,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1171,7 +1171,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1359,7 +1359,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1403,7 +1403,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1583,7 +1583,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1627,7 +1627,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1807,7 +1807,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1853,7 +1853,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2005,7 +2005,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2051,7 +2051,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2203,7 +2203,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2251,7 +2251,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2407,7 +2407,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2455,7 +2455,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2611,7 +2611,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2660,7 +2660,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2820,7 +2820,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2869,7 +2869,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3029,7 +3029,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3077,7 +3077,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3229,7 +3229,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3277,7 +3277,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3429,7 +3429,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3475,7 +3475,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3627,7 +3627,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3673,7 +3673,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3825,7 +3825,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3873,7 +3873,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4029,7 +4029,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4077,7 +4077,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4233,7 +4233,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4282,7 +4282,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4442,7 +4442,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4491,7 +4491,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4651,7 +4651,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4699,7 +4699,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4851,7 +4851,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4899,7 +4899,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5051,7 +5051,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5097,7 +5097,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5249,7 +5249,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5295,7 +5295,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5447,7 +5447,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5495,7 +5495,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5651,7 +5651,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5699,7 +5699,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5855,7 +5855,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5904,7 +5904,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6064,7 +6064,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6113,7 +6113,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6273,7 +6273,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6321,7 +6321,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6473,7 +6473,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6521,7 +6521,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6673,7 +6673,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6719,7 +6719,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6871,7 +6871,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6917,7 +6917,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7069,7 +7069,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7117,7 +7117,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7273,7 +7273,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7321,7 +7321,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7477,7 +7477,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7526,7 +7526,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7686,7 +7686,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7735,7 +7735,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7895,7 +7895,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7943,7 +7943,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8095,7 +8095,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8143,7 +8143,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8295,7 +8295,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8337,7 +8337,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8473,7 +8473,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8515,7 +8515,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8651,7 +8651,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8695,7 +8695,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8835,7 +8835,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8879,7 +8879,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9019,7 +9019,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9064,7 +9064,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9208,7 +9208,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9253,7 +9253,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9397,7 +9397,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9441,7 +9441,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9577,7 +9577,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9621,7 +9621,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9757,7 +9757,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9808,7 +9808,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9976,7 +9976,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10027,7 +10027,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10195,7 +10195,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10248,7 +10248,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10420,7 +10420,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10473,7 +10473,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10645,7 +10645,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10699,7 +10699,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10875,7 +10875,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10929,7 +10929,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -11105,7 +11105,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -11158,7 +11158,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -11326,7 +11326,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -11379,7 +11379,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -11547,7 +11547,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", diff --git a/server/python/src/metaobjects/cli.py b/server/python/src/metaobjects/cli.py index ff9c78fe92..d133cf03da 100644 --- a/server/python/src/metaobjects/cli.py +++ b/server/python/src/metaobjects/cli.py @@ -3366,7 +3366,7 @@ def _format_requirement_diagnostic(d: Diagnostic) -> str: def _verify_requirements(args: argparse.Namespace, model: "_VerifyModel | None") -> int: """The requirement (capability) gate (see :mod:`metaobjects.requirement_check`) — runs on EVERY ``verify``, with no subverb to select it: ``requirement.*`` nodes are metadata, - so a model declaring none is silent, not in drift. + so a model declaring none is not in drift (it gets at most the absent-ledger advisory). Prints the summary line on every run that has a requirement, clean or not (a gate that says nothing when it passes cannot be told apart from one that checked nothing), then @@ -3384,9 +3384,14 @@ def _verify_requirements(args: argparse.Namespace, model: "_VerifyModel | None") imported=collection.imported if collection is not None else None, require_implementers=bool(getattr(args, "require_implementers", False)) or os.environ.get(REQUIRE_IMPLEMENTERS_ENV) == "1", + requirements_missing=rules_settings_of(model.root).requirements_missing, ) summary = summarise_requirements(model.root, scan) if summary is None: + # No requirement, so no summary line; the one finding about an ABSENT ledger + # (WARN_REQUIREMENT_LEDGER_EMPTY) is still reported, as a warning. + for d in check_requirements(model.root, scan): + print(_format_requirement_diagnostic(d), file=sys.stderr) return 0 statuses = ", ".join( diff --git a/server/python/src/metaobjects/config/neutral_config.py b/server/python/src/metaobjects/config/neutral_config.py index e92b7ce969..9395c5aa25 100644 --- a/server/python/src/metaobjects/config/neutral_config.py +++ b/server/python/src/metaobjects/config/neutral_config.py @@ -28,6 +28,7 @@ RULES_LIFECYCLE_CREATE, RULES_PERMISSION_NAMES, VERIFY_LIFECYCLE_UNREACHABLE, + VERIFY_REQUIREMENTS_MISSING, RulesSettings, ) from metaobjects.wire import WIRE_DECIMALS, WIRE_DURATIONS, WIRE_NULL_MEMBERS, WireFormat @@ -424,7 +425,10 @@ def _read_naming(raw: dict[str, object], path: Path) -> NamingRules: "permissions": {"names": RULES_PERMISSION_NAMES}, "lifecycle": {"create": RULES_LIFECYCLE_CREATE, "commands": RULES_LIFECYCLE_COMMANDS}, }, - "verify": {"lifecycle": {"unreachable": VERIFY_LIFECYCLE_UNREACHABLE}}, + "verify": { + "lifecycle": {"unreachable": VERIFY_LIFECYCLE_UNREACHABLE}, + "requirements": {"missing": VERIFY_REQUIREMENTS_MISSING}, + }, } @@ -488,6 +492,7 @@ def _read_rules(raw: dict[str, object], path: Path) -> RulesSettings: lifecycle_create=found.get(("rules", "lifecycle", "create"), defaults.lifecycle_create), lifecycle_commands=found.get(("rules", "lifecycle", "commands"), defaults.lifecycle_commands), lifecycle_unreachable=found.get(("verify", "lifecycle", "unreachable"), defaults.lifecycle_unreachable), + requirements_missing=found.get(("verify", "requirements", "missing"), defaults.requirements_missing), ) diff --git a/server/python/src/metaobjects/requirement_check.py b/server/python/src/metaobjects/requirement_check.py index 7ab8693960..d747111ef7 100644 --- a/server/python/src/metaobjects/requirement_check.py +++ b/server/python/src/metaobjects/requirement_check.py @@ -62,6 +62,7 @@ WARN_REQUIREMENT_DISPOSITION_NOT_APPLICABLE = "WARN_REQUIREMENT_DISPOSITION_NOT_APPLICABLE" WARN_REQUIREMENT_DEFERRED_UNTRACKED = "WARN_REQUIREMENT_DEFERRED_UNTRACKED" WARN_REQUIREMENT_NOTHING_IMPLEMENTS = "WARN_REQUIREMENT_NOTHING_IMPLEMENTS" +WARN_REQUIREMENT_LEDGER_EMPTY = "WARN_REQUIREMENT_LEDGER_EMPTY" #: Severity of the object-coverage gate. It stays ``"warn"``: on a real estate carrying a #: single requirement the gate reports every entity, so at ``"error"`` a project adopting @@ -121,6 +122,10 @@ class RequirementScan: require_implementers: bool #: FR-023 — narrows which entities count; ``None`` means every non-abstract entity. coverable: Callable[[str], bool] | None = None + #: ``verify.requirements.missing``: ``warn`` (default) reports + #: ``WARN_REQUIREMENT_LEDGER_EMPTY`` on a project with writable entities and no requirement + #: of its own; ``off`` does not. + requirements_missing: str = "warn" def effective_package(req: MetaRequirement) -> str: @@ -278,6 +283,7 @@ def scan_requirements( coverable: Callable[[str], bool] | None = None, measure_coverage: bool | None = None, require_implementers: bool = False, + requirements_missing: str = "warn", in_ledger: Callable[[str], bool] | None = None, imported: Callable[[str], bool] | None = None, ) -> RequirementScan: @@ -307,6 +313,7 @@ def scan_requirements( ), require_implementers=require_implementers, coverable=coverable, + requirements_missing=requirements_missing, ) @@ -328,6 +335,24 @@ def _coverable_entities(root: MetaData, coverable: Callable[[str], bool] | None) ] +def _writable_project_entities(root: MetaData, coverable: Callable[[str], bool] | None) -> int: + """How many coverable entities store data: concrete, with a writable source (declared or + inherited, ADR-0039: the resolving ``children()``), and not in a shipped library's package. + The count behind ``WARN_REQUIREMENT_LEDGER_EMPTY``.""" + from metaobjects.meta.persistence.source.meta_source import MetaSource + + lib_pkgs = library_packages() + n = 0 + for ent in _coverable_entities(root, coverable): + key = ent.resolution_key() + sep = key.rfind(PACKAGE_SEP) + if (key[:sep] if sep >= 0 else "") in lib_pkgs: + continue + if any(isinstance(c, MetaSource) and c.is_writable() for c in ent.children()): + n += 1 + return n + + def check_requirements(root: MetaData, scan: RequirementScan | None = None) -> list[Diagnostic]: """Check the requirement tree against the loaded model. @@ -337,8 +362,27 @@ def check_requirements(root: MetaData, scan: RequirementScan | None = None) -> l """ scan = scan if scan is not None else scan_requirements(root) out: list[Diagnostic] = [] + + # The one finding about an ABSENT ledger: a project with writable entities and no + # requirement of its own gets ONE advisory (never an error; no setting raises it), and + # ``verify.requirements.missing: off`` silences it. "Of its own" is the coverage-activation + # rule, so an empty ledger file, a library's ledger or a dependency's counts as none, and a + # forced ``measure_coverage`` (the standalone library gate) gets no advice. + if not scan.measure_coverage and scan.requirements_missing != "off": + n = _writable_project_entities(root, scan.coverable) + if n > 0: + out.append( + Diagnostic( + SEVERITY_WARN, + WARN_REQUIREMENT_LEDGER_EMPTY, + f"{n} writable {'entity' if n == 1 else 'entities'} and no requirement of the " + "project's own, so nothing records what the software is for. Declare a " + "requirement.functional for each feature, or set " + '"verify": { "requirements": { "missing": "off" } } in .metaobjects/config.json.', + ) + ) if not scan.addressed: - return out # opt-in by declaration — no requirements, nothing to say + return out # opt-in by declaration — no requirements, nothing more to say for item in scan.addressed: req, req_path = item.node, item.path diff --git a/server/python/src/metaobjects/rules_settings.py b/server/python/src/metaobjects/rules_settings.py index 3eb0184bb7..e90d794dc9 100644 --- a/server/python/src/metaobjects/rules_settings.py +++ b/server/python/src/metaobjects/rules_settings.py @@ -29,6 +29,10 @@ #: that starts only from unreachable states. VERIFY_LIFECYCLE_UNREACHABLE = ("warn", "error", "off") +#: ``verify.requirements.missing``: whether a project with writable entities and no requirement +#: of its own is advised (``warn``, default) or left alone (``off``). Never an error. +VERIFY_REQUIREMENTS_MISSING = ("warn", "off") + @dataclass(frozen=True) class RulesSettings: @@ -39,6 +43,7 @@ class RulesSettings: lifecycle_create: str = "initial" lifecycle_commands: str = "unclaimed" lifecycle_unreachable: str = "warn" + requirements_missing: str = "warn" DEFAULT_RULES_SETTINGS = RulesSettings() diff --git a/server/python/tests/codegen/test_cli_verify_requirements.py b/server/python/tests/codegen/test_cli_verify_requirements.py index 60a8a0e965..87c0f8c0ad 100644 --- a/server/python/tests/codegen/test_cli_verify_requirements.py +++ b/server/python/tests/codegen/test_cli_verify_requirements.py @@ -89,6 +89,53 @@ def test_a_model_with_no_requirements_prints_nothing_and_exits_as_before( assert "requirements" not in after.err +def _writable_meta_dir(tmp_path: Path, config: dict[str, Any] | None = None) -> str: + doc = { + "metadata.root": { + "package": "app", + "children": [ + { + "object.entity": { + "name": "Order", + "children": [ + {"field.long": {"name": "id"}}, + _PK, + {"source.rdb": {"name": "src", "@table": "orders"}}, + ], + } + } + ], + } + } + d = tmp_path / "meta" + d.mkdir() + (d / "meta.app.json").write_text(json.dumps(doc)) + if config is not None: + (tmp_path / ".metaobjects").mkdir() + (tmp_path / ".metaobjects" / "config.json").write_text(json.dumps({"schema_version": 1, **config})) + return str(d) + + +def test_a_writable_entity_and_no_requirement_prints_the_ledger_advisory_and_exits_0( + tmp_path: Path, capsys: pytest.CaptureFixture[str] +) -> None: + meta_dir = _writable_meta_dir(tmp_path) + capsys.readouterr() + assert _verify(tmp_path, meta_dir) == 0 + err = capsys.readouterr().err + assert " WARN_REQUIREMENT_LEDGER_EMPTY: 1 writable entity and no requirement of the project's own" in err + assert "error(s)." not in err + + +def test_the_ledger_advisory_is_silenced_by_verify_requirements_missing_off( + tmp_path: Path, capsys: pytest.CaptureFixture[str] +) -> None: + meta_dir = _writable_meta_dir(tmp_path, {"verify": {"requirements": {"missing": "off"}}}) + capsys.readouterr() + assert _verify(tmp_path, meta_dir) == 0 + assert "WARN_REQUIREMENT_LEDGER_EMPTY" not in capsys.readouterr().err + + def test_a_dangling_live_reference_exits_1_and_prints_the_code_the_path_and_the_summary( tmp_path: Path, capsys: pytest.CaptureFixture[str] ) -> None: diff --git a/server/python/tests/codegen/test_one_generator_list.py b/server/python/tests/codegen/test_one_generator_list.py index 324f7a147c..bb8d722fa6 100644 --- a/server/python/tests/codegen/test_one_generator_list.py +++ b/server/python/tests/codegen/test_one_generator_list.py @@ -388,11 +388,13 @@ def test_a_target_with_no_generators_key_is_refused_with_the_migration_line( monkeypatch.chdir(tmp_path) assert main(command) == 2 name = " ".join(["metaobjects", *command]) - assert capsys.readouterr().err.strip() == ( + # `verify` also runs the requirement gate, whose absent-ledger advisory (a warning) may + # precede the refusal on a model with writable entities: the refusal line is the contract. + assert ( f"{name}: target(s) 'api' declare no `generators` key. In 1.1.0 a target runs only the " "generators it lists: list them, or write `generators: []` for a target that writes " 'nothing. See https://github.com/metaobjectsdev/metaobjects/blob/v1.1.0/docs/features/migrations/docs-are-generators.md, section "Python".' - ) + ) in capsys.readouterr().err assert not (tmp_path / "gen").exists() @@ -445,5 +447,6 @@ def test_a_conventional_template_spec_no_target_declares_is_refused( before = _files(tmp_path) monkeypatch.chdir(tmp_path) assert main(argv) == 2 - assert capsys.readouterr().err.strip() == legacy_template_spec_message(command) + # The requirement gate's absent-ledger advisory (a warning) may precede the refusal. + assert legacy_template_spec_message(command) in capsys.readouterr().err assert _files(tmp_path) == before diff --git a/server/python/tests/config/test_neutral_config.py b/server/python/tests/config/test_neutral_config.py index c550a5aae3..04fdf2564d 100644 --- a/server/python/tests/config/test_neutral_config.py +++ b/server/python/tests/config/test_neutral_config.py @@ -251,6 +251,9 @@ def test_rules_settings_are_read(tmp_path: Path) -> None: {"rules": "advise"}, {"verify": {"lifecycle": {"unreachable": "fail"}}}, {"verify": {"lifecycles": {}}}, + {"verify": {"requirements": {"missing": "error"}}}, + {"verify": {"requirements": {"absent": "warn"}}}, + {"verify": {"requirements": "off"}}, {"verify": {"handEdits": "warn"}}, ]) def test_rules_settings_mistakes_are_refused(tmp_path: Path, extra: dict) -> None: @@ -258,3 +261,12 @@ def test_rules_settings_mistakes_are_refused(tmp_path: Path, extra: dict) -> Non with pytest.raises(ParseError) as exc: read_neutral_config(tmp_path) assert exc.value.code == ErrorCode.ERR_BAD_ATTR_VALUE + + +def test_verify_requirements_missing_defaults_to_warn_and_is_read(tmp_path: Path) -> None: + _write_config(tmp_path, {"schema_version": 1}) + cfg = read_neutral_config(tmp_path) + assert cfg is not None and cfg.rules.requirements_missing == "warn" + _write_config(tmp_path, {"schema_version": 1, "verify": {"requirements": {"missing": "off"}}}) + cfg = read_neutral_config(tmp_path) + assert cfg is not None and cfg.rules.requirements_missing == "off" diff --git a/server/python/tests/conformance/test_requirement_check_conformance.py b/server/python/tests/conformance/test_requirement_check_conformance.py index c9c6b89333..39874ecf08 100644 --- a/server/python/tests/conformance/test_requirement_check_conformance.py +++ b/server/python/tests/conformance/test_requirement_check_conformance.py @@ -16,6 +16,7 @@ import pytest from metaobjects import MetaDataLoader +from metaobjects.config.neutral_config import read_neutral_config from metaobjects.requirement_check import ( RequirementSummary, check_requirements, @@ -40,7 +41,7 @@ def _corpus_root() -> Path: #: type, is refused rather than ignored: a misspelt ``requireImplementers``, or one #: written as the string "true", would otherwise run the case without the strict #: switch and pin the wrong severity. -OPTION_KEYS = {"libraries", "requireImplementers"} +OPTION_KEYS = {"libraries", "requireImplementers", "verify"} #: A case whose ``input/`` must be, file for file and byte for byte, another case's. SAME_INPUT_AS = {"require-implementers": "nothing-implements-subtree"} @@ -62,9 +63,27 @@ def _read_options(case_dir: Path) -> dict[str, Any]: require = options.get("requireImplementers") if require is not None and not isinstance(require, bool): raise AssertionError(f"{file}: 'requireImplementers' must be a boolean") + verify = options.get("verify") + if verify is not None and not isinstance(verify, dict): + raise AssertionError(f"{file}: 'verify' must be an object") return options +def _requirements_missing(options: dict[str, Any], scratch: Path) -> str: + """``verify.requirements.missing`` read through the port's own config reader, so a + misspelt key fails the case instead of being ignored.""" + verify = options.get("verify") + if verify is None: + return "warn" + (scratch / ".metaobjects").mkdir() + (scratch / ".metaobjects" / "config.json").write_text( + json.dumps({"schema_version": 1, "verify": verify}), encoding="utf-8" + ) + cfg = read_neutral_config(scratch) + assert cfg is not None + return cfg.rules.requirements_missing + + def _summary_dict(summary: RequirementSummary | None) -> dict[str, Any] | None: """The corpus's JSON shape. ``entities*`` are absent unless coverage was measured.""" if summary is None: @@ -104,7 +123,7 @@ def test_every_case_on_disk_is_documented_in_the_readme_and_nothing_else_is() -> @pytest.mark.parametrize("name", FIXTURES) -def test_fixture(name: str) -> None: +def test_fixture(name: str, tmp_path: Path) -> None: case_dir = CORPUS / name expected = json.loads((case_dir / "expected.json").read_text(encoding="utf-8")) options = _read_options(case_dir) @@ -119,7 +138,11 @@ def test_fixture(name: str) -> None: assert [str(e) for e in result.errors] == [] # No scope predicate and no forced coverage answer: both are the port's defaults. - scan = scan_requirements(result.root, require_implementers=options.get("requireImplementers", False)) + scan = scan_requirements( + result.root, + require_implementers=options.get("requireImplementers", False), + requirements_missing=_requirements_missing(options, tmp_path), + ) actual = sorted( (d.severity, d.code, d.path or "", d.message) for d in check_requirements(result.root, scan) diff --git a/server/python/tests/test_requirements_pack_left_out.py b/server/python/tests/test_requirements_pack_left_out.py index 0199add35c..87f7fe7363 100644 --- a/server/python/tests/test_requirements_pack_left_out.py +++ b/server/python/tests/test_requirements_pack_left_out.py @@ -1,6 +1,6 @@ """The requirements vocabulary is its own pack (``metaobjects-requirements``), composed by default. The verify gate's ledger reads requirement nodes the pack registered, so with the -pack left out of an embedder's providers the gate has nothing to read and reports nothing, +pack left out of an embedder's providers the gate has nothing to read and reports at most the absent-ledger advisory, and a model that declares a requirement fails to load instead.""" from __future__ import annotations @@ -9,6 +9,7 @@ from metaobjects import MetaDataLoader from metaobjects.core_types import core_providers from metaobjects.requirement_check import ( + WARN_REQUIREMENT_LEDGER_EMPTY, check_requirements, scan_requirements, summarise_requirements, @@ -45,11 +46,13 @@ def _load(children: list[dict], *, pack: bool): return MetaDataLoader.from_string(_model(children), providers=providers, strict=True) -def test_a_model_with_no_requirements_loads_and_the_gate_reports_nothing() -> None: +def test_a_model_with_no_requirements_loads_and_the_gate_reports_only_the_absent_ledger_advisory() -> None: result = _load([ORDER], pack=False) assert [str(e) for e in result.errors] == [] scan = scan_requirements(result.root) - assert check_requirements(result.root, scan) == [] + assert [d.code for d in check_requirements(result.root, scan)] == [WARN_REQUIREMENT_LEDGER_EMPTY] + off = scan_requirements(result.root, requirements_missing="off") + assert check_requirements(result.root, off) == [] assert summarise_requirements(result.root, scan) is None diff --git a/server/python/src/metaobjects/agent_context/shipped/files/651a126eaa501924.md b/server/rust/metaobjects-cli/agent-context-shipped/files/507ff854b296858c.md similarity index 97% rename from server/python/src/metaobjects/agent_context/shipped/files/651a126eaa501924.md rename to server/rust/metaobjects-cli/agent-context-shipped/files/507ff854b296858c.md index 2bcebe9ec1..f3d8db9d24 100644 --- a/server/python/src/metaobjects/agent_context/shipped/files/651a126eaa501924.md +++ b/server/rust/metaobjects-cli/agent-context-shipped/files/507ff854b296858c.md @@ -145,7 +145,9 @@ deleted, and nothing reports them. something, never so every member must carry one. - **Dangling links on `planned`.** Correct — the plan precedes the nodes. - **A project with no requirements at all.** The feature is opt-in by declaration; absence is - not a finding. + not a finding of this audit. `verify` already says it once, as `WARN_REQUIREMENT_LEDGER_EMPTY` + when the project has writable entities, and `"verify": { "requirements": { "missing": "off" } }` + is how a project records that it chose not to keep a ledger. ## Reporting diff --git a/server/python/src/metaobjects/agent_context/shipped/files/0ee567e8d039312d.md b/server/rust/metaobjects-cli/agent-context-shipped/files/805c0b6a53fc3464.md similarity index 98% rename from server/python/src/metaobjects/agent_context/shipped/files/0ee567e8d039312d.md rename to server/rust/metaobjects-cli/agent-context-shipped/files/805c0b6a53fc3464.md index e859076180..0c61a778ff 100644 --- a/server/python/src/metaobjects/agent_context/shipped/files/0ee567e8d039312d.md +++ b/server/rust/metaobjects-cli/agent-context-shipped/files/805c0b6a53fc3464.md @@ -89,6 +89,7 @@ So on a `planned` entry a dangling reference is the entry doing its job, not dri | situation | exit | |---|---| | clean tree, or no `requirement.*` nodes at all | 0 | +| writable entities and no requirement of the project's own (an empty ledger file counts as none) | 0 (warning `WARN_REQUIREMENT_LEDGER_EMPTY`; `"verify": { "requirements": { "missing": "off" } }` in `.metaobjects/config.json` turns it off) | | dangling `@implementedBy` on `live`/`partial` | 1 | | the same reference on `planned` | 0 | | `@implementedBy` above the L4 link floor | 1 | diff --git a/server/rust/metaobjects-cli/agent-context-shipped/manifest.json b/server/rust/metaobjects-cli/agent-context-shipped/manifest.json index b1e912da4f..0ee3bcedbe 100644 --- a/server/rust/metaobjects-cli/agent-context-shipped/manifest.json +++ b/server/rust/metaobjects-cli/agent-context-shipped/manifest.json @@ -35,7 +35,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -215,7 +215,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -257,7 +257,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -437,7 +437,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -481,7 +481,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -665,7 +665,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -709,7 +709,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -893,7 +893,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -938,7 +938,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1126,7 +1126,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1171,7 +1171,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1359,7 +1359,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1403,7 +1403,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1583,7 +1583,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1627,7 +1627,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -1807,7 +1807,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -1853,7 +1853,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2005,7 +2005,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2051,7 +2051,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2203,7 +2203,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2251,7 +2251,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2407,7 +2407,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2455,7 +2455,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2611,7 +2611,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2660,7 +2660,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -2820,7 +2820,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -2869,7 +2869,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3029,7 +3029,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3077,7 +3077,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3229,7 +3229,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3277,7 +3277,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3429,7 +3429,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3475,7 +3475,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3627,7 +3627,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3673,7 +3673,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -3825,7 +3825,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -3873,7 +3873,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4029,7 +4029,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4077,7 +4077,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4233,7 +4233,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4282,7 +4282,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4442,7 +4442,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4491,7 +4491,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4651,7 +4651,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4699,7 +4699,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -4851,7 +4851,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -4899,7 +4899,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5051,7 +5051,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5097,7 +5097,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5249,7 +5249,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5295,7 +5295,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5447,7 +5447,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5495,7 +5495,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5651,7 +5651,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5699,7 +5699,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -5855,7 +5855,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -5904,7 +5904,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6064,7 +6064,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6113,7 +6113,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6273,7 +6273,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6321,7 +6321,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6473,7 +6473,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6521,7 +6521,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6673,7 +6673,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6719,7 +6719,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -6871,7 +6871,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -6917,7 +6917,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7069,7 +7069,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7117,7 +7117,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7273,7 +7273,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7321,7 +7321,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7477,7 +7477,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7526,7 +7526,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7686,7 +7686,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7735,7 +7735,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -7895,7 +7895,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -7943,7 +7943,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8095,7 +8095,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8143,7 +8143,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8295,7 +8295,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8337,7 +8337,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8473,7 +8473,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8515,7 +8515,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8651,7 +8651,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8695,7 +8695,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -8835,7 +8835,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -8879,7 +8879,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9019,7 +9019,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9064,7 +9064,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9208,7 +9208,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9253,7 +9253,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9397,7 +9397,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9441,7 +9441,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9577,7 +9577,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9621,7 +9621,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9757,7 +9757,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -9808,7 +9808,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -9976,7 +9976,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10027,7 +10027,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10195,7 +10195,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10248,7 +10248,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10420,7 +10420,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10473,7 +10473,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10645,7 +10645,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10699,7 +10699,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -10875,7 +10875,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -10929,7 +10929,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -11105,7 +11105,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -11158,7 +11158,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -11326,7 +11326,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", @@ -11379,7 +11379,7 @@ }, { "path": ".claude/skills/metaobjects-audit/references/requirements.md", - "file": "651a126eaa501924.md" + "file": "507ff854b296858c.md" }, { "path": ".claude/skills/metaobjects-audit/references/surface-review-axes.md", @@ -11547,7 +11547,7 @@ }, { "path": ".claude/skills/metaobjects-verify/references/requirements.md", - "file": "0ee567e8d039312d.md" + "file": "805c0b6a53fc3464.md" }, { "path": ".claude/skills/metaobjects-verify/references/upgrading.md", diff --git a/server/rust/metaobjects-cli/src/lib.rs b/server/rust/metaobjects-cli/src/lib.rs index 0848f30aa1..797a1f7f70 100644 --- a/server/rust/metaobjects-cli/src/lib.rs +++ b/server/rust/metaobjects-cli/src/lib.rs @@ -775,6 +775,10 @@ fn verify_codegen( for line in rules_lines(&report) { let _ = writeln!(err, "{line}"); } + for d in &report.requirements { + // The advisory has no node to point at, so no `[path]`. + let _ = writeln!(err, " {}: {}", d.code, d.message); + } } if s.has("--timings") { print_timings(out, &report.timings); diff --git a/server/rust/metaobjects-cli/tests/cli.rs b/server/rust/metaobjects-cli/tests/cli.rs index 6a74f48f88..a8b9e2a25e 100644 --- a/server/rust/metaobjects-cli/tests/cli.rs +++ b/server/rust/metaobjects-cli/tests/cli.rs @@ -925,6 +925,39 @@ fn verify_runs_the_rules_gate_and_a_setting_decides_whether_a_finding_fails_it() ); } +#[test] +fn verify_advises_an_absent_requirement_ledger_and_a_setting_turns_it_off() { + // The default model has a writable entity and no requirement: advised, exit 0. + let p = Project::new("ledger-empty"); + ok(&p.run(&["meta", "gen"])); + let r = p.run(&["meta", "verify"]); + let err = text(&r.stderr); + assert_eq!(r.status.code(), Some(0), "a warning never fails: {err}"); + assert!( + err.contains("WARN_REQUIREMENT_LEDGER_EMPTY: 1 writable entity and no requirement of the project's own"), + "{err}" + ); + + // `verify.requirements.missing: off` silences it. + std::fs::write( + p.0.join(".metaobjects/config.json"), + r#"{ "schema_version": 1, "verify": { "requirements": { "missing": "off" } } }"#, + ) + .unwrap(); + let r = p.run(&["meta", "verify"]); + let err = text(&r.stderr); + assert_eq!(r.status.code(), Some(0), "{err}"); + assert!(!err.contains("WARN_REQUIREMENT_LEDGER_EMPTY"), "{err}"); + + // `error` is not a value: the config is refused. + std::fs::write( + p.0.join(".metaobjects/config.json"), + r#"{ "schema_version": 1, "verify": { "requirements": { "missing": "error" } } }"#, + ) + .unwrap(); + assert_ne!(p.run(&["meta", "verify"]).status.code(), Some(0)); +} + /// A prompt over a payload value object, replying with a typed answer in xml. fn prompt_model(required_tags: &str) -> String { format!( diff --git a/server/rust/metaobjects-codegen/src/engine.rs b/server/rust/metaobjects-codegen/src/engine.rs index 899ee11e05..5d8907bfbe 100644 --- a/server/rust/metaobjects-codegen/src/engine.rs +++ b/server/rust/metaobjects-codegen/src/engine.rs @@ -22,8 +22,10 @@ use serde_json::{Map, Value}; use std::path::{Path, PathBuf}; use std::time::Instant; +use metaobjects::dependencies::requirement_ledger; use metaobjects::errors::MetaError; -use metaobjects::rules_check::{RulesCheckResult, check_rules}; +use metaobjects::requirement_check::ledger_empty_diagnostic; +use metaobjects::rules_check::{Diagnostic, RulesCheckResult, check_rules}; use metaobjects::sources::{CONFIG_FILE, DEFAULT_METAOBJECTS_DIR}; use metaobjects::timing::LoadTimings; use metaobjects::validate::util::ObjectIndex; @@ -1111,6 +1113,9 @@ pub struct VerifyReport { /// The business-rules gate (ADR-0066) over the loaded model. It does not depend on /// generated files, so it is part of every `verify`, rendered or not. pub rules: RulesCheckResult, + /// The requirement advisories the port computes (only `WARN_REQUIREMENT_LEDGER_EMPTY` + /// until the requirement gate lands, RS-V2). A warning: it never changes the exit code. + pub requirements: Vec, } impl VerifyReport { @@ -1156,6 +1161,7 @@ pub fn verify( extra: Vec::new(), timings: p.timings, rules: rules_of(&p.loaded), + requirements: requirements_of(&p.loaded), warnings: p.warnings, project_root: p.project_root, }); @@ -1206,6 +1212,7 @@ pub fn verify( extra, timings: p.timings, rules: rules_of(&p.loaded), + requirements: requirements_of(&p.loaded), warnings: p.warnings, project_root: p.project_root, }) @@ -1223,6 +1230,27 @@ fn rules_of(loaded: &LoadedProject) -> RulesCheckResult { ) } +/// The requirement advisories over a loaded project, under its `verify.requirements` setting. +fn requirements_of(loaded: &LoadedProject) -> Vec { + let result = &loaded.result; + let collection = &loaded.collection; + let ledger = requirement_ledger( + &result.tree, + result.root, + |f| collection.in_ledger(f), + |f| collection.imported(f), + ); + ledger_empty_diagnostic( + &result.tree, + result.root, + &collection.config.rules, + &ledger, + |f| collection.in_scope(f), + ) + .into_iter() + .collect() +} + /// Remove the now-empty directories above `path`, stopping at (and keeping) `stop`. fn remove_empty_parents(path: &Path, stop: &Path) { let mut cur = path.parent(); diff --git a/server/rust/metaobjects/src/config.rs b/server/rust/metaobjects/src/config.rs index 1d7545f01b..36d3961f8f 100644 --- a/server/rust/metaobjects/src/config.rs +++ b/server/rust/metaobjects/src/config.rs @@ -121,6 +121,10 @@ string_enum!( /// `verify.lifecycle.unreachable`: the severity of an unreachable lifecycle state. VerifyLifecycleUnreachable { Warn => "warn", Error => "error", Off => "off" } ); +string_enum!( + /// `verify.requirements.missing`: whether an absent requirement ledger is advised. + VerifyRequirementsMissing { Warn => "warn", Off => "off" } +); /// The business-rules settings (ADR-0066), from the `rules` and `verify` blocks, each /// absent key at its default. Every port reads the same keys with the same defaults. @@ -133,6 +137,7 @@ pub struct RulesSettings { pub lifecycle_create: RulesLifecycleCreate, pub lifecycle_commands: RulesLifecycleCommands, pub lifecycle_unreachable: VerifyLifecycleUnreachable, + pub requirements_missing: VerifyRequirementsMissing, } impl Default for RulesSettings { @@ -142,6 +147,7 @@ impl Default for RulesSettings { lifecycle_create: RulesLifecycleCreate::Initial, lifecycle_commands: RulesLifecycleCommands::Unclaimed, lifecycle_unreachable: VerifyLifecycleUnreachable::Warn, + requirements_missing: VerifyRequirementsMissing::Warn, } } } @@ -1229,14 +1235,13 @@ pub fn parse_config( match v.as_object() { None => issues.add("verify", "\"verify\" must be an object"), Some(vo) => { - if let Some(k) = vo - .keys() - .find(|k| !["handEdits", "lifecycle"].contains(&k.as_str())) - { + if let Some(k) = vo.keys().find(|k| { + !["handEdits", "lifecycle", "requirements"].contains(&k.as_str()) + }) { issues.add( "verify", format!( - "\"verify\" has an unknown key \"{k}\" (expected \"handEdits\" or \"lifecycle\")" + "\"verify\" has an unknown key \"{k}\" (expected \"handEdits\", \"lifecycle\" or \"requirements\")" ), ); } @@ -1254,6 +1259,20 @@ pub fn parse_config( { cfg.rules.lifecycle_unreachable = u; } + if let Some(r) = vo.get("requirements") + && let Some(ro) = + strict_object(r, "verify.requirements", &["missing"], &mut issues) + && let Some(m) = enum_key( + ro, + "verify.requirements", + "missing", + VerifyRequirementsMissing::ALL, + &mut issues, + ) + .and_then(|s| VerifyRequirementsMissing::parse(&s)) + { + cfg.rules.requirements_missing = m; + } if let Some(h) = vo.get("handEdits") { let list: Vec = HandEditsPolicy::ALL .iter() diff --git a/server/rust/metaobjects/src/lib.rs b/server/rust/metaobjects/src/lib.rs index 841cd63b0b..289cb17182 100644 --- a/server/rust/metaobjects/src/lib.rs +++ b/server/rust/metaobjects/src/lib.rs @@ -25,6 +25,7 @@ pub mod providers; pub mod reference; pub mod registry; pub mod report_shape; +pub mod requirement_check; pub mod rules_check; pub mod rules_names; pub mod scope; diff --git a/server/rust/metaobjects/src/requirement_check.rs b/server/rust/metaobjects/src/requirement_check.rs new file mode 100644 index 0000000000..ef8886481d --- /dev/null +++ b/server/rust/metaobjects/src/requirement_check.rs @@ -0,0 +1,72 @@ +//! The one requirement-gate advisory the Rust port computes: `WARN_REQUIREMENT_LEDGER_EMPTY`. +//! +//! The port has no requirement gate yet (RS-V2), so this is not the gate. It is the absent +//! ledger advisory alone, with the condition and message of the TypeScript reference +//! (`checkRequirements`, `writableProjectEntities`), gated by the shared corpus +//! `fixtures/requirement-check-conformance/ledger-empty-*`. + +use crate::config::{RulesSettings, VerifyRequirementsMissing}; +use crate::dependencies::Ledger; +use crate::library::library_packages; +use crate::naming::source_is_writable; +use crate::node::{NodeId, Tree}; +use crate::parser::TYPE_OBJECT; +use crate::rules_check::{Diagnostic, Severity}; + +pub const WARN_REQUIREMENT_LEDGER_EMPTY: &str = "WARN_REQUIREMENT_LEDGER_EMPTY"; + +const SUB_ENTITY: &str = "entity"; + +/// How many entities the project owns that store data: concrete `object.entity` root +/// children the project generates (`in_scope`), outside every shipped library's package, +/// with a writable `source.rdb` among their resolving children (inherited counts, ADR-0039). +pub fn writable_project_entities( + tree: &Tree, + root: NodeId, + in_scope: impl Fn(&str) -> bool, +) -> usize { + let libraries = library_packages(); + tree.children(root) + .iter() + .filter(|&&e| { + let n = tree.node(e); + n.type_name == TYPE_OBJECT + && n.sub_type == SUB_ENTITY + && !n.is_abstract + && !libraries.contains(&tree.effective_package(e)) + && in_scope(&tree.resolution_key(e)) + && tree + .children(e) + .iter() + .any(|&c| source_is_writable(tree, c)) + }) + .count() +} + +/// The absent-ledger advisory: `Some` (always `warn`, no path) when the setting is not +/// `off`, coverage is not measured (no requirement of the project's own) and at least one +/// writable project entity exists. +pub fn ledger_empty_diagnostic( + tree: &Tree, + root: NodeId, + settings: &RulesSettings, + ledger: &Ledger, + in_scope: impl Fn(&str) -> bool, +) -> Option { + if settings.requirements_missing == VerifyRequirementsMissing::Off || ledger.measure_coverage { + return None; + } + let n = writable_project_entities(tree, root, in_scope); + if n == 0 { + return None; + } + let noun = if n == 1 { "entity" } else { "entities" }; + Some(Diagnostic { + severity: Severity::Warn, + code: WARN_REQUIREMENT_LEDGER_EMPTY, + path: String::new(), + message: format!( + "{n} writable {noun} and no requirement of the project's own, so nothing records what the software is for. Declare a requirement.functional for each feature, or set \"verify\": {{ \"requirements\": {{ \"missing\": \"off\" }} }} in .metaobjects/config.json." + ), + }) +} diff --git a/server/rust/metaobjects/tests/config_reader.rs b/server/rust/metaobjects/tests/config_reader.rs index 411f9a60a4..660a58bd3a 100644 --- a/server/rust/metaobjects/tests/config_reader.rs +++ b/server/rust/metaobjects/tests/config_reader.rs @@ -282,6 +282,8 @@ fn a_nested_typo_or_wrong_type_is_an_error() { json!({"schema_version": 1, "verify": {"other": 1}}), json!({"schema_version": 1, "verify": {"lifecycle": {"unreachable": "loud"}}}), json!({"schema_version": 1, "verify": {"lifecycle": {"unreachablee": "off"}}}), + json!({"schema_version": 1, "verify": {"requirements": {"missing": "error"}}}), + json!({"schema_version": 1, "verify": {"requirements": {"absent": "off"}}}), json!({"schema_version": 1, "rules": []}), json!({"schema_version": 1, "rules": {"permission": {}}}), json!({"schema_version": 1, "rules": {"permissions": {"names": "always"}}}), @@ -331,7 +333,7 @@ fn extract_and_confidence_thresholds_ignore_unknown_keys_as_the_typescript_reade fn the_business_rules_settings_default_and_are_kept() { use metaobjects::config::{ RulesLifecycleCommands, RulesLifecycleCreate, RulesPermissionNames, RulesSettings, - VerifyLifecycleUnreachable, + VerifyLifecycleUnreachable, VerifyRequirementsMissing, }; let parse = |doc: Value| { parse_config(&doc, "c.json", &NamingRegistry::builtin()) @@ -342,14 +344,14 @@ fn the_business_rules_settings_default_and_are_kept() { for doc in [ json!({"schema_version": 1}), json!({"schema_version": 1, "rules": {}, "verify": {}}), - json!({"schema_version": 1, "rules": {"permissions": {}, "lifecycle": {}}, "verify": {"lifecycle": {}}}), + json!({"schema_version": 1, "rules": {"permissions": {}, "lifecycle": {}}, "verify": {"lifecycle": {}, "requirements": {}}}), ] { assert_eq!(parse(doc).rules, RulesSettings::default()); } let c = parse(json!({ "schema_version": 1, "rules": {"permissions": {"names": "require"}, "lifecycle": {"create": "any", "commands": "none"}}, - "verify": {"handEdits": "fail", "lifecycle": {"unreachable": "error"}} + "verify": {"handEdits": "fail", "lifecycle": {"unreachable": "error"}, "requirements": {"missing": "off"}} })); assert_eq!( c.rules, @@ -358,6 +360,7 @@ fn the_business_rules_settings_default_and_are_kept() { lifecycle_create: RulesLifecycleCreate::Any, lifecycle_commands: RulesLifecycleCommands::NoneDerived, lifecycle_unreachable: VerifyLifecycleUnreachable::Error, + requirements_missing: VerifyRequirementsMissing::Off, } ); assert_eq!(c.hand_edits, Some(HandEditsPolicy::Fail)); @@ -381,7 +384,7 @@ fn a_verify_typo_names_both_keys_it_accepts() { .unwrap_err(); assert!( err.message.contains( - "\"verify\" has an unknown key \"lifecycles\" (expected \"handEdits\" or \"lifecycle\")" + "\"verify\" has an unknown key \"lifecycles\" (expected \"handEdits\", \"lifecycle\" or \"requirements\")" ), "{}", err.message @@ -716,3 +719,28 @@ fn read_sources_puts_libraries_first_then_own_files_and_reports_unreadable_ones( assert_eq!(errors.len(), 1); assert!(errors[0].message.contains("bad.json")); } + +#[test] +fn verify_requirements_missing_defaults_to_warn_and_reads_off() { + use metaobjects::config::VerifyRequirementsMissing as M; + let parse = |doc: Value| { + parse_config(&doc, "c.json", &NamingRegistry::builtin()) + .unwrap() + .config + .rules + .requirements_missing + }; + assert_eq!(parse(json!({"schema_version": 1})), M::Warn); + assert_eq!( + parse(json!({"schema_version": 1, "verify": {"requirements": {}}})), + M::Warn + ); + assert_eq!( + parse(json!({"schema_version": 1, "verify": {"requirements": {"missing": "warn"}}})), + M::Warn + ); + assert_eq!( + parse(json!({"schema_version": 1, "verify": {"requirements": {"missing": "off"}}})), + M::Off + ); +} diff --git a/server/rust/metaobjects/tests/requirement_ledger_conformance.rs b/server/rust/metaobjects/tests/requirement_ledger_conformance.rs new file mode 100644 index 0000000000..4640d1cc45 --- /dev/null +++ b/server/rust/metaobjects/tests/requirement_ledger_conformance.rs @@ -0,0 +1,113 @@ +//! The absent-ledger advisory of the requirement-gate corpus +//! (`fixtures/requirement-check-conformance/`). The Rust port has no requirement gate yet +//! (RS-V2), so this runs only the cases that pin `WARN_REQUIREMENT_LEDGER_EMPTY` +//! (`ledger-empty-*`, and `no-requirements`, which has no writable entity) and compares only +//! that code's diagnostics with `expected.json`. `options.json`'s `libraries` and `verify` +//! keys are applied as the shared README says: `verify` goes through the config reader. + +use std::path::{Path, PathBuf}; + +use serde_json::{Value, json}; + +use metaobjects::config::parse_config; +use metaobjects::dependencies::requirement_ledger; +use metaobjects::library::library_sources; +use metaobjects::loader::Loader; +use metaobjects::naming::NamingRegistry; +use metaobjects::providers::default_registry; +use metaobjects::requirement_check::{WARN_REQUIREMENT_LEDGER_EMPTY, ledger_empty_diagnostic}; + +const CASES: &[&str] = &[ + "ledger-empty-writable-entities", + "ledger-empty-off", + "ledger-empty-file", + "ledger-empty-library-only", + "no-requirements", +]; + +fn corpus() -> PathBuf { + PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("../../../fixtures/requirement-check-conformance") +} + +fn input_files(dir: &Path, out: &mut Vec) { + let mut entries: Vec<_> = std::fs::read_dir(dir) + .unwrap() + .map(|e| e.unwrap().path()) + .collect(); + entries.sort(); + for p in entries { + if p.is_dir() { + input_files(&p, out); + } else if p.extension().is_some_and(|e| e == "yaml" || e == "json") { + out.push(p); + } + } +} + +fn actual(case: &Path) -> Vec { + let options: Value = std::fs::read_to_string(case.join("options.json")) + .map(|t| serde_json::from_str(&t).unwrap()) + .unwrap_or_else(|_| json!({})); + let libraries: Vec = options + .get("libraries") + .and_then(Value::as_array) + .map(|a| a.iter().map(|v| v.as_str().unwrap().to_string()).collect()) + .unwrap_or_default(); + + let mut registry = default_registry().expect("the built-in providers compose"); + registry.seal(); + let mut files = Vec::new(); + input_files(&case.join("input"), &mut files); + let mut sources = library_sources(&libraries); + for f in &files { + sources.push(( + f.to_string_lossy().into_owned(), + std::fs::read_to_string(f).unwrap(), + )); + } + let loaded = Loader::new(®istry).load_sources(&sources); + assert!( + loaded.errors.is_empty(), + "{}: must load clean: {:?}", + case.display(), + loaded.errors + ); + + let mut config = json!({ "schema_version": 1 }); + if let Some(v) = options.get("verify") { + config["verify"] = v.clone(); + } + let settings = parse_config(&config, "options.json", &NamingRegistry::builtin()) + .expect("options.json `verify` is a valid config block") + .config + .rules; + + // No dependency: every requirement is the project's or a library's own. + let ledger = requirement_ledger(&loaded.tree, loaded.root, |_| true, |_| false); + ledger_empty_diagnostic(&loaded.tree, loaded.root, &settings, &ledger, |_| true) + .into_iter() + .map(|d| { + assert!(d.path.is_empty(), "the advisory has no path"); + json!({"severity": d.severity.as_str(), "code": d.code, "message": d.message}) + }) + .collect() +} + +#[test] +fn the_ledger_empty_cases_match_the_shared_corpus() { + for name in CASES { + let case = corpus().join(name); + let expected: Value = + serde_json::from_str(&std::fs::read_to_string(case.join("expected.json")).unwrap()) + .unwrap(); + let want: Vec = expected["diagnostics"] + .as_array() + .unwrap() + .iter() + .filter(|d| d["code"] == WARN_REQUIREMENT_LEDGER_EMPTY) + .cloned() + .collect(); + assert_eq!(actual(&case), want, "{name}"); + } +} diff --git a/server/typescript/packages/cli/src/commands/init.ts b/server/typescript/packages/cli/src/commands/init.ts index fbf18b738c..d1d90d7f17 100644 --- a/server/typescript/packages/cli/src/commands/init.ts +++ b/server/typescript/packages/cli/src/commands/init.ts @@ -55,8 +55,9 @@ const META_COMMON_JSON = JSON.stringify( ) + "\n"; // The requirement ledger, empty: the same canonical empty root as meta.common.json, so it -// loads clean and passes `meta fmt --check`. With no requirement declared every requirement -// check stays silent; the project adds its first level-1 node when it opts in. The config names +// loads clean and passes `meta fmt --check`. An empty ledger is no requirement: once the project +// declares a writable entity, `meta verify` advises it (WARN_REQUIREMENT_LEDGER_EMPTY, silenced by +// `verify.requirements.missing: off`); the project adds its first level-1 node when it opts in. The config names // `requirementTests()` without wiring it (ADR-0034 Amendment 2: init wires no generator). const META_REQUIREMENTS_FILE = "meta.requirements.json"; const META_REQUIREMENTS_JSON = META_COMMON_JSON; diff --git a/server/typescript/packages/cli/src/commands/verify.ts b/server/typescript/packages/cli/src/commands/verify.ts index f46844b4f2..23dc8dd79f 100644 --- a/server/typescript/packages/cli/src/commands/verify.ts +++ b/server/typescript/packages/cli/src/commands/verify.ts @@ -523,7 +523,7 @@ export async function verifyCommand( const uuidValuesExit = flags.uuidValues ? await runUuidValuesVerify() : 0; // Requirements have no subverb: `requirement.*` nodes are metadata, so they // are checked on every `meta verify`. Opt-in by DECLARATION — a model with no - // requirement nodes is silent, not in drift. + // requirement nodes is not in drift (it gets at most the absent-ledger advisory). const requirementExit = runRequirementVerify(); // Business rules (ADR-0066): operations and lifecycles are metadata too, so this gate // also runs on every `meta verify`, and is also opt-in by declaration. @@ -852,6 +852,7 @@ export async function verifyCommand( inLedger: collection.inLedger, imported: collection.imported, requireImplementers: flags.requireImplementers || process.env.META_REQUIRE_IMPLEMENTERS === "1", + requirementsMissing: collection.rulesSettings.requirementsMissing, }); const diags = [...checkRequirements(root, scan)]; diff --git a/server/typescript/packages/cli/src/lib/requirement-check.ts b/server/typescript/packages/cli/src/lib/requirement-check.ts index 329faa05d1..4c97a2bc90 100644 --- a/server/typescript/packages/cli/src/lib/requirement-check.ts +++ b/server/typescript/packages/cli/src/lib/requirement-check.ts @@ -40,7 +40,9 @@ import { resolveClaimTarget, resolveMember, didYouMeanHint, + isWritableSource, type MetaData, + type VerifyRequirementsMissing, type MetaRequirement, type RequirementStatus, } from "@metaobjectsdev/metadata"; @@ -82,6 +84,7 @@ export const WARN_REQUIREMENT_OBJECT_UNCLAIMED = "WARN_REQUIREMENT_OBJECT_UNCLAI export const WARN_REQUIREMENT_DISPOSITION_NOT_APPLICABLE = "WARN_REQUIREMENT_DISPOSITION_NOT_APPLICABLE"; export const WARN_REQUIREMENT_DEFERRED_UNTRACKED = "WARN_REQUIREMENT_DEFERRED_UNTRACKED"; export const WARN_REQUIREMENT_NOTHING_IMPLEMENTS = "WARN_REQUIREMENT_NOTHING_IMPLEMENTS"; +export const WARN_REQUIREMENT_LEDGER_EMPTY = "WARN_REQUIREMENT_LEDGER_EMPTY"; /** Counts behind the summary line `meta verify` prints on every run, clean or * not. A clean run that says nothing cannot distinguish "checked, all good" @@ -293,6 +296,9 @@ export interface RequirementScan { * path and message do not change, and no other diagnostic is touched. Carried on * the scan, like `measureCoverage`, so a caller decides it once per run. */ readonly requireImplementers: boolean; + /** `verify.requirements.missing` — `warn` (default) reports `WARN_REQUIREMENT_LEDGER_EMPTY` + * on a project with writable entities and no requirement of its own; `off` does not. */ + readonly requirementsMissing: VerifyRequirementsMissing; } /** @@ -348,6 +354,8 @@ export function scanRequirements( measureCoverage?: boolean; /** Raise WARN_REQUIREMENT_NOTHING_IMPLEMENTS to severity "error". Default false. */ requireImplementers?: boolean; + /** `verify.requirements.missing`. Default `warn`. */ + requirementsMissing?: VerifyRequirementsMissing; /** FR-023 — which requirements are this project's ledger (`Collection.inLedger`), read * with `::`. One left out is still loaded, so an overlay of it resolves, * but nothing here addresses it: not checked, summarised, linted or claimed. Undefined @@ -367,6 +375,7 @@ export function scanRequirements( claimedObjects: claimedObjectKeys(root, addressed.map((r) => r.node)), measureCoverage: opts?.measureCoverage ?? projectAuthoredRequirements(addressed, opts?.imported), requireImplementers: opts?.requireImplementers ?? false, + requirementsMissing: opts?.requirementsMissing ?? "warn", // `exactOptionalPropertyTypes` — an omitted key, never an explicit `undefined`. ...(opts?.coverable !== undefined ? { coverable: opts.coverable } : {}), }; @@ -442,6 +451,23 @@ function coverableEntities(root: MetaData, coverable?: (fqn: string) => boolean) ); } +/** + * How many coverable entities store data: concrete, with a writable source (declared or + * inherited, ADR-0039), and not in a shipped library's package. The count behind + * `WARN_REQUIREMENT_LEDGER_EMPTY`. + */ +function writableProjectEntities(root: MetaData, coverable?: (fqn: string) => boolean): number { + const libPkgs = libraryPackages(); + let n = 0; + for (const ent of coverableEntities(root, coverable)) { + const key = ent.resolutionKey(); + const sep = key.lastIndexOf(PACKAGE_SEPARATOR); + if (libPkgs.has(sep < 0 ? "" : key.slice(0, sep))) continue; + if (ent.children().some((c) => isWritableSource(c))) n++; + } + return n; +} + /** * Check the requirement tree against the loaded model. * @@ -453,7 +479,28 @@ function coverableEntities(root: MetaData, coverable?: (fqn: string) => boolean) export function checkRequirements(root: MetaData, scan: RequirementScan = scanRequirements(root)): Diagnostic[] { const out: Diagnostic[] = []; const { addressed, claimedObjects, coverable, measureCoverage } = scan; - if (addressed.length === 0) return out; // opt-in by declaration — no requirements, nothing to say + + // The one finding about an ABSENT ledger. Pillar 5 used to promise a project with no + // requirement "no change at all"; the captain reversed that on 2026-12-05 for projects + // that store data: a project with writable entities and no requirement of its own gets + // ONE advisory, never an error (no setting raises it), and `verify.requirements.missing: + // off` silences it. "Of its own" is the coverage-activation rule (FR-043 §5.4): an empty + // ledger file, a library's ledger or a dependency's counts as none. A library's entities + // (`iam/db`) and a dependency's do not make a project one that stores data. A forced + // `measureCoverage` (the standalone library gate) is the library's own ledger, so no advice. + if (!measureCoverage && scan.requirementsMissing !== "off") { + const n = writableProjectEntities(root, coverable); + if (n > 0) { + out.push({ + severity: "warn", code: WARN_REQUIREMENT_LEDGER_EMPTY, + message: + `${n} writable ${n === 1 ? "entity" : "entities"} and no requirement of the project's own, ` + + `so nothing records what the software is for. Declare a requirement.functional for each ` + + `feature, or set "verify": { "requirements": { "missing": "off" } } in .metaobjects/config.json.`, + }); + } + } + if (addressed.length === 0) return out; // opt-in by declaration — no requirements, nothing more to say for (const { node: req, path: reqPath } of addressed) { const report = (d: Diagnostic): void => { diagnosticRequirement.set(d, req); out.push(d); }; diff --git a/server/typescript/packages/cli/src/lib/requirement-payload.ts b/server/typescript/packages/cli/src/lib/requirement-payload.ts index f6b23ea061..75a811845b 100644 --- a/server/typescript/packages/cli/src/lib/requirement-payload.ts +++ b/server/typescript/packages/cli/src/lib/requirement-payload.ts @@ -7,7 +7,7 @@ // `--require-implementers`, the authoring lint on. Fixed defaults rather than the caller's // flags, so the generated site depends on the model alone and `verify --codegen` can hold it. -import type { MetaData } from "@metaobjectsdev/metadata"; +import type { MetaData, RulesSettings } from "@metaobjectsdev/metadata"; import { REQUIREMENT_STATUSES } from "@metaobjectsdev/metadata"; import type { AdvisoryDiagnosticRow } from "./advisory.js"; import { @@ -91,6 +91,7 @@ export function requirementPayload( inCoverage: (fqn: string) => boolean; inLedger?: (fqn: string) => boolean; imported?: (fqn: string) => boolean; + rulesSettings?: Pick; files: readonly string[]; }, ): RequirementPayload | undefined { @@ -99,6 +100,9 @@ export function requirementPayload( requireImplementers: false, ...(collection.inLedger !== undefined ? { inLedger: collection.inLedger } : {}), ...(collection.imported !== undefined ? { imported: collection.imported } : {}), + ...(collection.rulesSettings !== undefined + ? { requirementsMissing: collection.rulesSettings.requirementsMissing } + : {}), }); const s = summariseRequirements(root, scan); if (s === undefined) return undefined; diff --git a/server/typescript/packages/cli/test/explorer-site-ledger.test.ts b/server/typescript/packages/cli/test/explorer-site-ledger.test.ts index 0f17915cbc..276d509b17 100644 --- a/server/typescript/packages/cli/test/explorer-site-ledger.test.ts +++ b/server/typescript/packages/cli/test/explorer-site-ledger.test.ts @@ -9,7 +9,11 @@ import { buildDocsView } from "@metaobjectsdev/metadata"; import { loadMemory } from "@metaobjectsdev/sdk"; import { generateExplorerSite } from "@metaobjectsdev/docs-site"; import { requirementPayload } from "../src/lib/requirement-payload.js"; -import { ERR_REQUIREMENT_DANGLING_REF, WARN_REQUIREMENT_NOTHING_IMPLEMENTS } from "../src/lib/requirement-check.js"; +import { + ERR_REQUIREMENT_DANGLING_REF, + WARN_REQUIREMENT_LEDGER_EMPTY, + WARN_REQUIREMENT_NOTHING_IMPLEMENTS, +} from "../src/lib/requirement-check.js"; import { WARN_REQUIREMENT_TITLE_IS_AN_ID } from "../src/lib/requirement-lint.js"; const dirs: string[] = []; @@ -105,6 +109,25 @@ metadata: `; describe("explorer requirement views follow the gate's ledger", () => { + test("verify.requirements.missing: off keeps the empty-ledger advisory out of the payload", async () => { + const dir = mkdtempSync(join(tmpdir(), "explorer-ledger-")); + dirs.push(dir); + mkdirSync(join(dir, "metaobjects")); + writeFileSync(join(dir, "metaobjects", "meta.a.yaml"), billing("a", "acme::a::Invoice")); + const root = await loadMemory(dir, { strict: true }); + // Every requirement is a dependency's, so the project has a ledger to show and none of its own. + const codes = (requirementsMissing: "warn" | "off"): string[] | undefined => + requirementPayload(root, { + inCoverage: () => true, + imported: () => true, + rulesSettings: { requirementsMissing }, + files: ["meta.a.yaml"], + })?.requirements.rows.map((r) => r.code); + expect(codes("warn")).toContain(WARN_REQUIREMENT_LEDGER_EMPTY); + expect(codes("off")).not.toContain(WARN_REQUIREMENT_LEDGER_EMPTY); + expect(codes("off")).toBeDefined(); + }); + test("two packages' requirements at one path each show only their own findings", async () => { const s = await site({ "meta.a.yaml": billing("a", "acme::a::Invoice"), "meta.b.yaml": billing("b", "acme::b::Receipt") }); const a = s.page("requirements/acme/a/Billing.Invoicing.html"); diff --git a/server/typescript/packages/cli/test/gen-requirement-advisories.test.ts b/server/typescript/packages/cli/test/gen-requirement-advisories.test.ts index d7396b9cb6..d2f853ea40 100644 --- a/server/typescript/packages/cli/test/gen-requirement-advisories.test.ts +++ b/server/typescript/packages/cli/test/gen-requirement-advisories.test.ts @@ -2,7 +2,7 @@ // tests, or (b) the scaffolded agent context has no requirements pages. Both are advisories: // the exit code never changes. import { describe, test, expect } from "bun:test"; -import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs"; +import { mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { run } from "../src/index.js"; @@ -177,10 +177,11 @@ describe("meta verify repeats the requirement-tests advisory", () => { }, TIMEOUT_MS); }); -// `meta init` scaffolds an empty requirement ledger. Requirements stay opt-in: until the project -// declares one, `meta verify` raises no requirement advisory and still reads "nothing advisory". +// `meta init` scaffolds an empty requirement ledger, and an empty ledger is no requirement. Once +// the project declares a writable entity, `meta verify` advises it (the captain's 2026-12-05 +// ruling): a warning that never moves the exit code, silenced by `verify.requirements.missing: off`. describe("meta init's empty requirement ledger", () => { - test("init, one entity, verify → no requirement advisory and nothing advisory to answer", async () => { + test("init, one entity, verify → the absent-ledger advisory; off → nothing advisory to answer", async () => { const dir = mkdtempSync(join(tmpdir(), "mo-init-ledger-")); writeFileSync(join(dir, "package.json"), JSON.stringify({ name: "app", type: "module", private: true })); const origLog = console.log; @@ -195,14 +196,24 @@ describe("meta init's empty requirement ledger", () => { } try { writeFileSync(join(dir, "metaobjects", "meta.shop.json"), ENTITY_JSON); - const { exit, out, err } = await verifyJson(dir); - const all = `${out}\n${err}`; - expect(exit).toBe(0); + const first = await verifyJson(dir); + const all = `${first.out}\n${first.err}`; + expect(first.exit).toBe(0); + expect(all).toContain("WARN_REQUIREMENT_LEDGER_EMPTY"); + expect(all).toContain("1 writable entity and no requirement of the project's own"); expect(all).not.toContain("WARN_REQUIREMENT_OBJECT_UNCLAIMED"); - expect(all).not.toContain("no requirement claims"); expect(all).not.toContain("no generator writes their tests"); - expect(all).not.toContain("with no @disposition"); - expect(out).toContain("nothing advisory to answer"); + expect(first.out).not.toContain("nothing advisory to answer"); + + const cfgFile = join(dir, ".metaobjects", "config.json"); + const cfg = JSON.parse(readFileSync(cfgFile, "utf8")) as Record; + const verify = (cfg["verify"] ?? {}) as Record; + cfg["verify"] = { ...verify, requirements: { missing: "off" } }; + writeFileSync(cfgFile, JSON.stringify(cfg, null, 2) + "\n"); + const off = await verifyJson(dir); + expect(off.exit).toBe(0); + expect(`${off.out}\n${off.err}`).not.toContain("WARN_REQUIREMENT_LEDGER_EMPTY"); + expect(off.out).toContain("nothing advisory to answer"); } finally { rmSync(dir, { recursive: true, force: true }); } }, TIMEOUT_MS); }); diff --git a/server/typescript/packages/cli/test/requirement-check-conformance.test.ts b/server/typescript/packages/cli/test/requirement-check-conformance.test.ts index d8997bff12..fe94631bb4 100644 --- a/server/typescript/packages/cli/test/requirement-check-conformance.test.ts +++ b/server/typescript/packages/cli/test/requirement-check-conformance.test.ts @@ -11,7 +11,8 @@ import { describe, test, expect } from "bun:test"; import { existsSync, readdirSync, readFileSync, statSync } from "node:fs"; import { join } from "node:path"; -import { MetaDataLoader } from "@metaobjectsdev/metadata"; +import { MetaDataLoader, rulesSettingsOf, type VerifyRequirementsMissing } from "@metaobjectsdev/metadata"; +import { ConfigSchema } from "@metaobjectsdev/sdk"; import { checkRequirements, scanRequirements, @@ -29,14 +30,15 @@ interface Expected { diagnostics: Finding[]; summary: RequirementSummary | null * refused rather than ignored: a misspelt `requireImplementers`, or one written as the * string "true", would otherwise run the case without the strict switch and pin the * wrong severity in every port. */ -const OPTION_KEYS = ["libraries", "requireImplementers"] as const; -interface Options { libraries?: string[]; requireImplementers?: boolean } +const OPTION_KEYS = ["libraries", "requireImplementers", "verify"] as const; +interface Options { libraries?: string[]; requireImplementers?: boolean; requirementsMissing?: VerifyRequirementsMissing } /** A case whose `input/` must be, file for file and byte for byte, another case's. The * pair differs in `options.json` only, so the two expectations isolate what the option * does; an input edited on one side would quietly end that. */ const SAME_INPUT_AS: Readonly> = { "require-implementers": "nothing-implements-subtree", + "ledger-empty-off": "ledger-empty-writable-entities", }; type Row = readonly [severity: string, code: string, path: string, message: string]; @@ -59,7 +61,7 @@ function readOptions(caseDir: string): Options { const unknown = Object.keys(options).filter((k) => !(OPTION_KEYS as readonly string[]).includes(k)); if (unknown.length > 0) throw new Error(`${file}: unknown option(s) ${unknown.join(", ")}`); - const { libraries, requireImplementers } = options; + const { libraries, requireImplementers, verify } = options; if (libraries !== undefined && !(Array.isArray(libraries) && libraries.every((l): l is string => typeof l === "string"))) { throw new Error(`${file}: 'libraries' must be an array of strings`); @@ -70,6 +72,10 @@ function readOptions(caseDir: string): Options { return { ...(libraries === undefined ? {} : { libraries }), ...(requireImplementers === undefined ? {} : { requireImplementers }), + // The project's `verify` block, through the real config reader: a misspelt key fails. + ...(verify === undefined ? {} : { + requirementsMissing: rulesSettingsOf(ConfigSchema.pick({ verify: true }).parse({ verify })).requirementsMissing, + }), }; } @@ -119,6 +125,7 @@ describe("requirement-check conformance corpus", () => { const scan = scanRequirements(result.root, { requireImplementers: options.requireImplementers ?? false, + ...(options.requirementsMissing === undefined ? {} : { requirementsMissing: options.requirementsMissing }), }); expect(multiset(checkRequirements(result.root, scan))).toEqual(multiset(expected.diagnostics)); expect(summariseRequirements(result.root, scan) ?? null).toStrictEqual(expected.summary); diff --git a/server/typescript/packages/cli/test/requirements-pack-left-out.test.ts b/server/typescript/packages/cli/test/requirements-pack-left-out.test.ts index 59cd0c3ca7..abea09fb88 100644 --- a/server/typescript/packages/cli/test/requirements-pack-left-out.test.ts +++ b/server/typescript/packages/cli/test/requirements-pack-left-out.test.ts @@ -1,7 +1,9 @@ // The requirements vocabulary is its own pack (`metaobjects-requirements`), composed by // default. The verify gate's ledger reads requirement nodes the pack registered, so with -// the pack left out of an embedder's registry the gate has nothing to read and reports -// nothing, and a model that declares a requirement fails to load instead. +// the pack left out of an embedder's registry the gate has nothing to read: it reports only +// the absent-ledger advisory (the model stores data and declares no requirement; an embedder +// that left the pack out on purpose passes `requirementsMissing: "off"`), and a model that +// declares a requirement fails to load instead. import { describe, test, expect } from "bun:test"; import { MetaDataLoader, @@ -10,7 +12,12 @@ import { coreProviders, REQUIREMENTS_PROVIDER_ID, } from "@metaobjectsdev/metadata"; -import { checkRequirements, scanRequirements, summariseRequirements } from "../src/lib/requirement-check.js"; +import { + checkRequirements, + scanRequirements, + summariseRequirements, + WARN_REQUIREMENT_LEDGER_EMPTY, +} from "../src/lib/requirement-check.js"; const ORDER = { "object.entity": { @@ -40,13 +47,14 @@ function model(children: unknown[]): string { const withoutPack = () => composeRegistry(coreProviders.filter((p) => p.id !== REQUIREMENTS_PROVIDER_ID)); describe("requirements pack left out", () => { - test("a model with no requirements loads and the gate reports nothing", async () => { + test("a model with no requirements loads and the gate reports only the absent-ledger advisory", async () => { const result = await new MetaDataLoader({ registry: withoutPack(), strict: true }).load([ new InMemoryStringSource(model([ORDER]), { format: "json" }), ]); expect(result.errors).toEqual([]); const scan = scanRequirements(result.root); - expect(checkRequirements(result.root, scan)).toEqual([]); + expect(checkRequirements(result.root, scan).map((d) => d.code)).toEqual([WARN_REQUIREMENT_LEDGER_EMPTY]); + expect(checkRequirements(result.root, scanRequirements(result.root, { requirementsMissing: "off" }))).toEqual([]); expect(summariseRequirements(result.root, scan)).toBeUndefined(); }); diff --git a/server/typescript/packages/cli/test/unit/requirement-check.test.ts b/server/typescript/packages/cli/test/unit/requirement-check.test.ts index ab2ad96f42..beb01376cb 100644 --- a/server/typescript/packages/cli/test/unit/requirement-check.test.ts +++ b/server/typescript/packages/cli/test/unit/requirement-check.test.ts @@ -37,6 +37,7 @@ import { ERR_REQUIREMENT_L5_NOT_MEMBER, ERR_REQUIREMENT_ARCH_NO_IMPLEMENTERS, WARN_REQUIREMENT_OBJECT_UNCLAIMED, + WARN_REQUIREMENT_LEDGER_EMPTY, WARN_REQUIREMENT_NOTHING_IMPLEMENTS, WARN_REQUIREMENT_DEFERRED_UNTRACKED, type Diagnostic, @@ -917,13 +918,18 @@ describe("requirement.* — object coverage", () => { } }); - test("a model declaring no requirements is silent — opt-in by declaration", async () => { + // The captain's 2026-12-05 ruling: a project that stores data and declares no requirement + // gets ONE advisory, never an error, and `verify.requirements.missing: off` silences it. + test("a model declaring no requirements gets only the absent-ledger advisory, which off silences", async () => { const dir = mkdtempSync(join(tmpdir(), "req-none-")); try { mkdirSync(join(dir, "metaobjects")); writeFileSync(join(dir, "metaobjects/meta.shop.yaml"), MODEL); const root = await loadMemory(dir, { strict: true }); - expect(checkRequirements(root)).toEqual([]); + const diags = checkRequirements(root); + expect(diags.map((d) => [d.severity, d.code])).toEqual([["warn", WARN_REQUIREMENT_LEDGER_EMPTY]]); + expect(diags[0]!.path).toBeUndefined(); + expect(checkRequirements(root, scanRequirements(root, { requirementsMissing: "off" }))).toEqual([]); } finally { rmSync(dir, { recursive: true, force: true }); } diff --git a/server/typescript/packages/metadata/src/index.ts b/server/typescript/packages/metadata/src/index.ts index fa05008193..9e34167bc0 100644 --- a/server/typescript/packages/metadata/src/index.ts +++ b/server/typescript/packages/metadata/src/index.ts @@ -511,12 +511,12 @@ export type { WireFormat, WireDecimals, WireNullMembers, WireDurations } from ". // ADR-0066: the `rules` and `verify` blocks of .metaobjects/config.json. export { - RULES_PERMISSION_NAMES, RULES_LIFECYCLE_CREATE, RULES_LIFECYCLE_COMMANDS, VERIFY_LIFECYCLE_UNREACHABLE, + RULES_PERMISSION_NAMES, RULES_LIFECYCLE_CREATE, RULES_LIFECYCLE_COMMANDS, VERIFY_LIFECYCLE_UNREACHABLE, VERIFY_REQUIREMENTS_MISSING, DEFAULT_RULES_SETTINGS, rulesSettingsOf, rulesSettingsOfModel, } from "./rules-settings.js"; export type { RulesSettings, RulesConfigBlocks, RulesPermissionNames, RulesLifecycleCreate, RulesLifecycleCommands, - VerifyLifecycleUnreachable, + VerifyLifecycleUnreachable, VerifyRequirementsMissing, } from "./rules-settings.js"; // Retired vocabulary: the map the loader reads to explain a retirement, and the raw-document diff --git a/server/typescript/packages/metadata/src/rules-settings.ts b/server/typescript/packages/metadata/src/rules-settings.ts index b51734934e..0a4a3f6d20 100644 --- a/server/typescript/packages/metadata/src/rules-settings.ts +++ b/server/typescript/packages/metadata/src/rules-settings.ts @@ -25,12 +25,20 @@ export type RulesLifecycleCommands = (typeof RULES_LIFECYCLE_COMMANDS)[number]; export const VERIFY_LIFECYCLE_UNREACHABLE = ["warn", "error", "off"] as const; export type VerifyLifecycleUnreachable = (typeof VERIFY_LIFECYCLE_UNREACHABLE)[number]; +/** `verify.requirements.missing`: whether the requirement gate advises a project that declares + * writable entities and no requirement of its own (`WARN_REQUIREMENT_LEDGER_EMPTY`). `warn` + * (default) or `off`. Never `error`: the advisory cannot fail a build (captain's ruling, + * 2026-12-05). */ +export const VERIFY_REQUIREMENTS_MISSING = ["warn", "off"] as const; +export type VerifyRequirementsMissing = (typeof VERIFY_REQUIREMENTS_MISSING)[number]; + /** The resolved settings, every absent key at its default. */ export interface RulesSettings { readonly permissionNames: RulesPermissionNames; readonly lifecycleCreate: RulesLifecycleCreate; readonly lifecycleCommands: RulesLifecycleCommands; readonly lifecycleUnreachable: VerifyLifecycleUnreachable; + readonly requirementsMissing: VerifyRequirementsMissing; } export const DEFAULT_RULES_SETTINGS: RulesSettings = { @@ -38,6 +46,7 @@ export const DEFAULT_RULES_SETTINGS: RulesSettings = { lifecycleCreate: "initial", lifecycleCommands: "unclaimed", lifecycleUnreachable: "warn", + requirementsMissing: "warn", }; /** The `rules` and `verify` config blocks as written; every key optional. */ @@ -51,6 +60,7 @@ export interface RulesConfigBlocks { } | undefined; readonly verify?: { readonly lifecycle?: { readonly unreachable?: VerifyLifecycleUnreachable | undefined } | undefined; + readonly requirements?: { readonly missing?: VerifyRequirementsMissing | undefined } | undefined; } | undefined; } @@ -71,5 +81,6 @@ export function rulesSettingsOf(cfg: RulesConfigBlocks): RulesSettings { lifecycleCreate: cfg.rules?.lifecycle?.create ?? DEFAULT_RULES_SETTINGS.lifecycleCreate, lifecycleCommands: cfg.rules?.lifecycle?.commands ?? DEFAULT_RULES_SETTINGS.lifecycleCommands, lifecycleUnreachable: cfg.verify?.lifecycle?.unreachable ?? DEFAULT_RULES_SETTINGS.lifecycleUnreachable, + requirementsMissing: cfg.verify?.requirements?.missing ?? DEFAULT_RULES_SETTINGS.requirementsMissing, }; } diff --git a/server/typescript/packages/sdk/src/config.ts b/server/typescript/packages/sdk/src/config.ts index bfd1ce0f89..198afb8c8e 100644 --- a/server/typescript/packages/sdk/src/config.ts +++ b/server/typescript/packages/sdk/src/config.ts @@ -27,6 +27,7 @@ import { RULES_LIFECYCLE_CREATE, RULES_LIFECYCLE_COMMANDS, VERIFY_LIFECYCLE_UNREACHABLE, + VERIFY_REQUIREMENTS_MISSING, rulesSettingsOf, type RulesSettings, API_KEY_PAGINATION, @@ -258,6 +259,9 @@ export const ConfigSchema = z.object({ * on any edit to a generated file. `lifecycle.unreachable`: the severity of a lifecycle state * no transition reaches from the initial state, and of a transition that starts only from * such states — `warn` (default), `error` or `off` (ADR-0066); read by every port's config reader. + * `requirements.missing`: `warn` (default) lets the requirement gate advise a project that + * declares writable entities and no requirement of its own; `off` silences it. Never fails a + * build; read by every port's config reader. */ verify: z .strictObject({ @@ -267,9 +271,12 @@ export const ConfigSchema = z.object({ lifecycle: z.strictObject({ unreachable: z.enum(VERIFY_LIFECYCLE_UNREACHABLE).optional(), }).optional(), + requirements: z.strictObject({ + missing: z.enum(VERIFY_REQUIREMENTS_MISSING).optional(), + }).optional(), }, { error: (iss) => iss.code === "unrecognized_keys" - ? `"verify" has an unknown key "${iss.keys[0]}" (expected "handEdits" or "lifecycle")` + ? `"verify" has an unknown key "${iss.keys[0]}" (expected "handEdits", "lifecycle" or "requirements")` : iss.code === "invalid_type" ? `"verify" must be an object` : undefined, }) .optional(), diff --git a/server/typescript/packages/sdk/test/config.test.ts b/server/typescript/packages/sdk/test/config.test.ts index 6121d58471..ac55ddee49 100644 --- a/server/typescript/packages/sdk/test/config.test.ts +++ b/server/typescript/packages/sdk/test/config.test.ts @@ -305,6 +305,7 @@ describe("ConfigSchema — rules and verify blocks (ADR-0066)", () => { test("absent keys take the defaults, which behave as before the blocks existed", () => { expect(rulesSettingsFromConfig(ConfigSchema.parse({ schema_version: 1 }))).toEqual({ permissionNames: "derive", lifecycleCreate: "initial", lifecycleCommands: "unclaimed", lifecycleUnreachable: "warn", + requirementsMissing: "warn", }); }); @@ -312,10 +313,11 @@ describe("ConfigSchema — rules and verify blocks (ADR-0066)", () => { const cfg = ConfigSchema.parse({ schema_version: 1, rules: { permissions: { names: "require" }, lifecycle: { create: "any", commands: "none" } }, - verify: { handEdits: "fail", lifecycle: { unreachable: "error" } }, + verify: { handEdits: "fail", lifecycle: { unreachable: "error" }, requirements: { missing: "off" } }, }); expect(rulesSettingsFromConfig(cfg)).toEqual({ permissionNames: "require", lifecycleCreate: "any", lifecycleCommands: "none", lifecycleUnreachable: "error", + requirementsMissing: "off", }); }); @@ -328,6 +330,9 @@ describe("ConfigSchema — rules and verify blocks (ADR-0066)", () => { [{ verify: { lifecycle: { unreachable: "fail" } } }], [{ verify: { lifecycles: {} } }], [{ verify: { handEdits: "warn" } }], + // The advisory never fails a build, so `error` is not a value it takes. + [{ verify: { requirements: { missing: "error" } } }], + [{ verify: { requirements: { absent: "off" } } }], ])("a mistake is refused, not defaulted: %j", (extra) => { expect(ConfigSchema.safeParse({ schema_version: 1, ...extra }).success).toBe(false); }); diff --git a/spec/decisions/ADR-0057-requirement-checks-and-tests-in-every-port.md b/spec/decisions/ADR-0057-requirement-checks-and-tests-in-every-port.md index 772f15a369..ab6c815a7f 100644 --- a/spec/decisions/ADR-0057-requirement-checks-and-tests-in-every-port.md +++ b/spec/decisions/ADR-0057-requirement-checks-and-tests-in-every-port.md @@ -79,7 +79,8 @@ them is open. The flag is not called `--strict`, because `verify` already has `--lax` on a different axis (ADR-0023 attribute strictness) and a `--strict` beside it would read as that flag's opposite. 5. **A model with no `requirement.*` node sees no change in any port**: no line printed, no - exit-code change, no file generated. + exit-code change, no file generated. *(Narrowed by Amendment 1: a model that also declares a + writable entity gets one advisory. The exit code and the generated files are still unchanged.)* ### The generator @@ -178,6 +179,35 @@ split. Two things remain TypeScript-only: the seven authoring-lint advisories (Consequences), and the structured `--format` payload of `verify`. +## Amendment 1 (2026-12-05): a project that stores data and declares no requirement is advised + +**Ruling.** The captain answered "Yes" on 2026-12-05 to the question "should `meta verify` advise +a project that has writable entities and no `requirement.*` nodes?", choosing the option that +puts the advisory in every port. Clause 5's promise, repeated in the pillar summaries as "a +project that declares no `requirement.*` nodes sees no change at all", is reversed for such a +project. The adopter review behind the question found a project whose ledger stayed empty +through two releases while its hand-written code grew, and nothing it ran ever mentioned the +absence: an opt-in that nobody is told about is not chosen, it is missed. + +1. **The gate reports `WARN_REQUIREMENT_LEDGER_EMPTY`** when the project has authored no + requirement of its own and at least one coverable entity is concrete, has a writable source + (declared or inherited through `extends`) and is not in a shipped library's package. "Of its + own" is the coverage-activation rule (FR-043 §5.4): an empty ledger file (what `meta init` + scaffolds), a library's ledger and a dependency's all count as none. A model whose entities + store nothing (no source, or only read-only sources) still sees no change. +2. **It never fails a build.** Its severity is always `warn`; no switch raises it, and + `--require-implementers` does not touch it. It has no path and adds nothing to the summary, + which stays `null` unless a library's or a dependency's ledger is loaded. +3. **One off switch, spelled the same in every port:** `"verify": { "requirements": { "missing": + "off" } }` in `.metaobjects/config.json` (default `warn`). It is read by the config reader + that reads `verify.lifecycle.unreachable`, and a value other than `warn` or `off` is refused. +4. **Every port that has `verify` reports it**, held to the TypeScript reference by the + `ledger-empty-*` cases of `fixtures/requirement-check-conformance/` (whose `options.json` + now takes the `verify` block). Rust has no requirement gate yet (RS-V2), so its `cargo meta + verify` computes this one advisory on its own, gated by the same cases. + +Registers no vocabulary: `metamodelVersion` and `expected-registry.json` are untouched. + ## Alternatives considered - **Keep the checks TypeScript-only and have other ports run the Node CLI for them.** Rejected: diff --git a/spec/roadmap.md b/spec/roadmap.md index 1597c4871f..3f7ced50f3 100644 --- a/spec/roadmap.md +++ b/spec/roadmap.md @@ -249,7 +249,8 @@ _(FR-032 was developed under the working number "FR-026" — see commit history; - **`requirement.functional` / `requirement.architectural`** — capabilities as registered metamodel vocabulary in all five ports. Opt-in by declaration: a model with no - `requirement.*` nodes gets no diagnostics and no generated output. Loader owns the + `requirement.*` nodes gets no diagnostics and no generated output (since ADR-0057 + Amendment 1, 2026-12-05, one with writable entities gets a never-failing advisory). Loader owns the `@status` enum and required attrs; `meta verify` (TS CLI) owns `@implementedBy` / `@verifiedBy` resolution, whose severity depends on `@status` — a dangling reference is an error on `live` and *expected* on `abandoned`. Justified by resurrection, not duplication: