Skip to content

docs(internals): record Settings unknown-option handling as design intent - #2068

Merged
lestrrat merged 1 commit into
develop/v4from
docs-v4-internals-settings-unknown-option-note
Apr 27, 2026
Merged

lestrrat merged 1 commit into
develop/v4from
docs-v4-internals-settings-unknown-option-note

Conversation

@lestrrat

Copy link
Copy Markdown
Collaborator

Adversarial review (JWA-20260426194121-003) flagged jwx.Settings / cert.Settings for silently skipping unknown options. The realistic motivator was a cross-package mix-up like cert.Settings(jwx.WithUseNumber(true)).

That scenario is a compile error today — jwx.GlobalOption and cert.GlobalOption each carry their own unexported globalOption() marker on their own *globalOption struct (jwx/options.go:8-17, cert/options.go:6-15). Because the marker is unexported, the two interfaces are not compiler-interchangeable despite both wrapping option.Interface. The Settings loops can never receive a foreign-package option.

Remaining failure modes are internal-only generator-drift cases adequately covered by per-option test discipline. Adding default: return error would be a future-contributor safety net but address no user-facing risk; v3 backport is also impossible (v3's Settings returns no error).

Doc-only PR adding a Settings unknown-option handling subsection to .claude/docs/internals.md so future review agents see the design intent and don't re-flag.

Resolves JWA-003 as WONTFIX.

…tent

Adversarial review JWA-20260426194121-003 flagged jwx.Settings /
cert.Settings for silently skipping unknown options. The motivating
cross-package mix-up case (cert.Settings(jwx.WithUseNumber(true))) is
a compile error today — the two GlobalOption interfaces use
unexported globalOption() markers on their own struct types, so they
are not compiler-interchangeable despite both wrapping
option.Interface. Remaining failure modes are internal-only
generator-drift cases caught by ordinary test discipline.

Adding the seal to internals.md so a future review agent sees the
design intent and does not re-flag.
@lestrrat
lestrrat merged commit a59f201 into develop/v4 Apr 27, 2026
7 checks passed
@lestrrat
lestrrat deleted the docs-v4-internals-settings-unknown-option-note branch April 27, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant