Skip to content

[ENG-4060] Declare every runtime option and keep the declarations in step - #303

Merged
patchstackdave merged 2 commits into
mainfrom
fix/declaration-drift
Sep 29, 2026
Merged

patchstackdave merged 2 commits into
mainfrom
fix/declaration-drift

Conversation

@patchstackdave

@patchstackdave patchstackdave commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

protect.d.ts is written by hand, and it had fallen behind the runtime.

Added: declarations for the options the runtime already reads — onSkip, onRuleRejected, bootTimeoutMs, refreshTimeoutMs, acceptPartialBundle, allowGlobalWhitelists and the top-level maxBodyBytes — and for the coverage() method.

Corrected:

  • fetchImpl is used by the reporters, not the rules client.
  • reportManifest applies whenever a refresh path is configured, not only with refreshMs > 0.

New test: it compares the option names the runtime reads, and the members the protection object carries, with the declarations, in both directions. A new option or member without a declaration fails it, and so does a declaration the runtime no longer uses.

No runtime change.

Rebased onto current main. The test also passes against the options and members that have landed there since, so they are all declared.

Validation: full suite, typecheck, build.

Part of ENG-4060.

🤖 Generated with Claude Code

@coderbuds

coderbuds Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Adds missing runtime option declarations and robust drift tests.

🎯 Quality: 100% Elite · 📦 Size: Medium

🤖 Authorship: Agent-written — Claude Code, going by its own attribution. Whether a person read it is unknown; coding agents can call the report-ai-usage tool to say.

📈 This month: Your 164th PR — above team average · Averaging Excellent

See how your team is trending →

@patchstackdave

Copy link
Copy Markdown
Contributor Author

/review

patchstackdave and others added 2 commits September 29, 2026 11:34
Add the options the runtime reads but protect.d.ts did not declare, and
coverage(). Correct the fetchImpl and reportManifest descriptions. A test now
compares the option names the runtime reads, and the members the protection
object carries, with the declarations in both directions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@patchstackdave
patchstackdave merged commit 11eca2b into main Sep 29, 2026
18 checks passed
@patchstackdave
patchstackdave deleted the fix/declaration-drift branch September 29, 2026 09:37
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.

2 participants