fix(types): remove phantom time_pressure field from VulnInputs#22
Open
dmchaledev wants to merge 1 commit into
Open
fix(types): remove phantom time_pressure field from VulnInputs#22dmchaledev wants to merge 1 commit into
dmchaledev wants to merge 1 commit into
Conversation
The published index.d.ts declared an optional `time_pressure` field on the `VulnInputs` interface, but the calculation engine never reads it. All timing is derived from `scan_intensity` (via TIME_MULT) and `scan_window`. The field was already dropped from the test suite in 82e5a30 ("use scan_window instead of non-existent time_pressure field") and is absent from the README Input Schema — index.d.ts was the last stale reference. A TypeScript consumer setting `time_pressure` would expect it to affect the result and instead get a silently ignored value. Removing it makes the shipped type contract match the actual engine behavior. The existing `[extra: string]: unknown` index signature still permits arbitrary extra fields, so this is not a breaking narrowing for real inputs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The published
index.d.tsadvertises an optionaltime_pressurefield on the publicVulnInputsinterface:But the calculation engine never reads
time_pressure. All timing is derived fromscan_intensity(viaTIME_MULT) andscan_window:time_pressureappears in exactly one place in the whole repo — this type declaration:It was already removed from the test suite in
82e5a30("use scan_window instead of non-existent time_pressure field"), and it's absent from the README's Input Schema table.index.d.tswas the last stale reference left behind.Impact
index.d.tsships in the npm tarball (it's listed inpackage.json'sfiles), so this is the type contract every TypeScript/IDE consumer sees. A developer who setstime_pressure— reasonably expecting it to influence scan timing — gets a value that is silently ignored, with green typechecking and no error. The advertised API and the actual behavior disagree.Fix
Remove the dead
time_pressurefield so the shipped type matches the engine. No runtime/source/behavior change.The interface keeps its
[extra: string]: unknownindex signature, so arbitrary extra fields are still permitted — this isn't a breaking narrowing for any input that actually affects a result.Verification
Self-contained: one-line deletion in
index.d.ts, no API or behavior change for existing consumers.https://claude.ai/code/session_015nnJU8VHsp6tzBjyUS44yH
Generated by Claude Code