Skip to content

Drop the inert unnecessary-assert disable from the typecheck config - #4

Merged
svc-finitelabs[bot] merged 1 commit into
mainfrom
agent/drop-inert-assert-disable
Aug 8, 2026
Merged

Drop the inert unnecessary-assert disable from the typecheck config#4
svc-finitelabs[bot] merged 1 commit into
mainfrom
agent/drop-inert-assert-disable

Conversation

@svc-finitelabs

@svc-finitelabs svc-finitelabs Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Follow-up to your approval on #3: you asked for the unnecessary-assert disable to be dropped, and #3 auto-merged before I could act on it.

I had kept the key verbatim from your proposed config on the assumption it was load-bearing on 3.18.2-dev. Your review confirmed it is not: 11 problems either way there, with no such diagnostic emitted, and 3.19.0 agrees.

Worth removing rather than leaving: a disabled diagnostic that never fires reads as a known exception to whoever next edits this file.

Verification

On lua-language-server 3.19.0, against main at 821ae5c:

  • make typecheck: 11 problems in 3 files (aes_gcm 5, ed25519 3, srp 3), unchanged
  • ./run_tests.sh: 15/15 modules
  • make format-check: clean

Not verified locally: make lint, same luacheck 1.2.0 / Lua 5.5 environment problem as before. CI covers it, and this changes no Lua.

…onfig

The key was carried over from the config proposed in the #3 review on the
assumption it was load-bearing on lua-language-server 3.18.2-dev. It is
not: the review confirmed 11 problems either way there, with no such
diagnostic emitted, and 3.19.0 agrees.

A disabled diagnostic that never fires reads as a known exception to
anyone changing this file later, so it is worse than nothing.

Verified: `make typecheck` 11 problems in 3 files, unchanged; 15/15
modules; `make format-check` clean.
@svc-finitelabs
svc-finitelabs Bot merged commit ce3e452 into main Aug 8, 2026
11 checks passed
@svc-finitelabs
svc-finitelabs Bot deleted the agent/drop-inert-assert-disable branch August 8, 2026 19:45
derek-miller added a commit that referenced this pull request Aug 8, 2026
The paragraph above the typecheck target named the two categories this
change resolves, type-narrowing and deliberate-bad-argument findings, and
deferred the decision this change makes. Left alone it reads as a current
known exception to anyone editing the file later, which is the same defect
class #4 removed.
derek-miller added a commit that referenced this pull request Aug 8, 2026
… narrowing (#5)

* Gate typecheck in check, fix the AESWord annotation and the SRP group narrowing

lua-crypto was the one library where typecheck was not part of check, so
this class of defect had no CI gate here at all.

Two real annotation defects fall out once it runs:

aes_gcm.lua create_aes_word() returns a 4-element word but annotated its
body @type AESState, which is [AESWord, AESWord, AESWord, AESWord]. Same
copy-paste as the one fixed in lua-bthome-ble aes_ccm.lua. Clearing it takes
the repo from 11 findings to 6.

srp.lua read group.g three times across a type(group.g) branch. Narrowing
applies to locals, not table fields, so neither arm was narrowed and both
bignum.from_number and bignum.from_hex saw the full string|integer union.
Reading it into a local once fixes both. Same root cause as the bit64
test.expected hoist in lua-bitn.

The remaining four are deliberate negative tests that pass nil or an integer
to assert the function rejects it, so the wrong type is the point. Those get
disable-next-line rather than a signature change.

The config carries the full bypass set the other four libraries now use,
including runtime.plugin, which a grep of the diagnostics paths cannot
surface: check_worker.lua does require "plugin", so an OnSetText returning an
empty edit blanks every file and the check passes having analysed nothing.
diagnostics.disable keeps its existing unnecessary-assert entry.

CI installs lua-language-server 3.19.0 before Check, matching the other four.

Full test suite passes, including the SRP change: AES, AES-GCM, ChaCha20,
Poly1305, SHA-256/512, BLAKE2, HKDF, SRP, bignum, X25519, X448, Ed25519 and
the OpenSSL gating.

* Correct the Makefile comment that still deferred gating typecheck

The paragraph above the typecheck target named the two categories this
change resolves, type-narrowing and deliberate-bad-argument findings, and
deferred the decision this change makes. Left alone it reads as a current
known exception to anyone editing the file later, which is the same defect
class #4 removed.
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