fix: emit JSII2100 for a "@jsii struct" directive on a non-interface #3300
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 245 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.329
Real PR Conversation Timeline
1 comments
"Review active on #3300"
general
weight: 0.35
mrgrain
Fixes #2942
JSII2100(jsii-directive/struct-on-non-interface) was registered but nothing emitted it. Its message is about the@jsii structdirective, andDirectiveshas astructfield for it ("Whether the node has the@jsii structdirective set"). Both came with #42, but the parser only learnedignore, so@jsii structhas always been reported as an unknown directive (JSII2999).This finishes the directive:
| Source | Before | After |
|---|---|---|
|
/* @jsii struct / export class Klass {}(also an enum or a member) | JSII2999 unknown directive | JSII2100 ||
/* @jsii struct / export interface IConfig { readonly a: string }| JSII2999, and not a struct (its name starts withI) | a struct, same assembly and diagnostics as with@struct||
/* @jsii struct / export interface IConfig { method(): void }| JSII2999 | JSII7001 at the directive, as with@struct||
/* @struct / export class Klass {}| JSII7001 | unchanged |I chose this over removing
JSII2100:configureCategoriesthrowsUnrecognized diagnostic codefor a code it doesn't know, so a project that configuresJSII2100injsii.diagnosticswould stop building. If you would rather remove the code anyway, I can change the PR.Tests:
test/diagnostics/jsii-directive.test.tsdocumented that JSII2100 is never emitted. It now checks the rows above. Without the change insrc/, 5 of the new tests fail.yarn jest: the change adds no failures. On my Windows machine, 130 tests (fixture symlinks, project references, paths) fail onmainwithout this change as well. Lint passes.---
Disclosure: implemented with Claude Code (model Claude Opus 5.5): code, tests and this description.
By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].
[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
🤖 Generated with Claude Code