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
Found while fixing #11643 (which carries the undeclared-authoring-key list
into the
os build --jsonpayload). Out of that card's scope — it was fenced toone list — but the same defect class is still live for two more.
Measured
At
origin/main4ceae8ab0,packages/cli/src/commands/compile.tscomputestwo further advisory lists and gates both behind
!flags.json, so--jsonnever sees them:
capPreflight.warnings— Preflight that required capabilities have an installable provider in the current edition #3366 capability-provider hints (absent butinstallable, or an unknown token). Computed at
:270, printed at:275under
if (capPreflight.warnings.length > 0 && !flags.json).docWarnings— ADR-0046 package-docs advisories. Computed at:365,printed at
:379underif (docWarnings.length > 0 && !flags.json).Neither reaches the success payload: after #11643 the payload's
warningsis[...ruleAdvisories, ...unknownKeyWarnings], and no other key carries them.packages/cli/src/commands/validate.ts:313carries both:Reproduction
One temp project whose
requiresnames an unknown capability token:Both commands exit 0. A CI consumer reading
warningsoffos build --jsonsees an empty list where the same consumer reading
os validate --jsonon thesame tree sees a typo'd capability declaration.
Note on
structuralWarningsos validate --jsonalso carries four structural advisories (the second entryabove).
os compilecomputes no equivalent, so this one is a missingcomputation, 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
buildshould have it is a judgment call, not amechanical port.
Prior art
This is the fourth instance of one pattern in these two files — an advisory
computed under a
!flags.jsonguard and therefore structurally unreachable forthe machine face: #10953, #11174, #11643, and now this.
validate.ts's owncomments 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.tsare the same shape and would take the same fix.Filed unassigned; no severity attached — that is triage's call.
Generated by Claude Code