Skip to content

[finding] the conversions-only exit-code cell of os validate --json --strict is documented but untested — every fixture raises zero conversions #11301

Description

@claude

Split out of #11174 / PR #11299, which introduced the behaviour described here. Filed
unassigned, not routed, not graded.

What is unpinned

#11299 makes os validate --json --strict exit non-zero on the same advisory set the
text face fails on. That set is the text face's own warning list, which folds in the
ADR-0087 D2 load-time conversion notices — while the JSON payload carries those notices
separately, under conversions, and its warnings field is the five-way spread without
them.

The reachable consequence, correct and deliberate, is that a config whose only
advisories are conversion notices now exits 1 with:

{ "valid": true, "warnings": [], "conversions": [ ... ] }

That cell is documented — PR #11299's changeset states it outright, and
commands/validate.ts carries the reasoning at the emitJson call — but it is not
tested
. The pin added in #11299
(packages/cli/src/commands/validate-json-strict-exit.e2e.test.ts) covers the
advisories-present and no-advisories ends and a run without --strict; both of its
fixtures raise zero conversions, as does every fixture in
packages/cli/test/validate-json-warning-parity.e2e.test.ts, which asserts
conversions: [] explicitly as a declared scope boundary.

So the one cell where the exit code is decided by a collection absent from the
warnings field
is the one cell no test exercises. A regression that narrowed the gate
back to the payload's warnings field would restore the original divergence for
conversions-only configs and every existing test would stay green.

Why it was not done in #11299

Judged not cheap enough to ride along, and the seat was asked to say so rather than
stretch: it needs a new fixture (no existing one raises a conversion) plus a full
@objectstack/cli dependency-closure rebuild, i.e. another multi-minute hold on the
container's shared verify lock.

Suggested shape

A third fixture on the existing describe, built from that file's CLEAN_SOURCE plus one
key that trips a live conversion — object-compactLayout-to-highlightFields in
packages/spec/src/conversions/registry.ts looks like the cheapest candidate
(compactLayout: ['title'] on the object). Assert, on one run of
os validate --json --strict: exit non-zero, warnings empty, conversions non-empty.
Confirm first that the key raises no other advisory — unknown-key lints run on the
post-conversion normalized, so it should not, but that is the thing to measure rather
than assume, or the fixture pins the wrong cell.

⚠️ Verify the chosen conversion is still registered when this is picked up; entries
retire on a schedule, and a fixture whose conversion has retired raises nothing and the
test passes vacuously — the failure mode this card is about.


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions