Skip to content

os build --json also drops the capability-provider and package-docs warnings that os validate --json carries #11727

Description

@claude

Found while fixing #11643 (which carries the undeclared-authoring-key list
into the os build --json payload). Out of that card's scope — it was fenced to
one list — but the same defect class is still live for two more.

Measured

At origin/main4ceae8ab0, packages/cli/src/commands/compile.ts computes
two further advisory lists and gates both behind !flags.json, so --json
never sees them:

Neither reaches the success payload: after #11643 the payload's warnings is
[...ruleAdvisories, ...unknownKeyWarnings], and no other key carries them.

packages/cli/src/commands/validate.ts:313 carries both:

warnings: [...ruleAdvisories, ...docWarnings, ...unknownKeyWarnings, ...capProviderWarnings, ...structuralWarnings]

Reproduction

One temp project whose requires names an unknown capability token:

exportdefault{manifest: {id: 'com.example.capgap',name: 'capgap',version: '1.0.0',type: 'app',namespace: 'capgap'},requires: ['zzz_unknown_capability_token'],objects: [{name: 'cg_thing',label: 'Thing',sharingModel: 'private',fields: {title: {type: 'text',label: 'T'}}}],};
os build --json -> warnings: []
os validate --json -> warnings: [
{"token":"zzz_unknown_capability_token",
"message":"requires: \"zzz_unknown_capability_token\" is not a known platform capability — check for a typo."},
"No apps or plugins defined — this stack may not do much"
]

Both commands exit 0. A CI consumer reading warnings off os build --json
sees an empty list where the same consumer reading os validate --json on the
same tree sees a typo'd capability declaration.

Note on structuralWarnings

os validate --json also carries four structural advisories (the second entry
above). os compile computes no equivalent, so this one is a missing
computation
, not a dropped list — a different fix from the other two, and
possibly not wanted on the build path at all. Recorded here so the three are
not conflated; whether build should have it is a judgment call, not a
mechanical port.

Prior art

This is the fourth instance of one pattern in these two files — an advisory
computed under a !flags.json guard and therefore structurally unreachable for
the machine face: #10953, #11174, #11643, and now this. validate.ts's own
comments call it out three times ("a single list cannot drift from itself") and
fixed it by hoisting the computation above the branch. The remaining two lists
in compile.ts are the same shape and would take the same fix.

Filed unassigned; no severity attached — that is triage's call.


Generated by Claude Code

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions