Fix host API type declarations flagged by the sound checker#462
Merged
Conversation
skhaz
approved these changes
Jul 10, 2026
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.
Summary
Align the host API declarations with the actual runtime contracts and close the runtime gaps exposed by the sound checker:
fs.FS:readdirnow models the complete Lua generic-for protocol. It returns an optional iterator plus opaque iterator-state-or-error, the iterator accepts state/control arguments, and each step yields{ name: string, type: "file" | "directory" }?.Message:header()returnsstring?, andMessage:headers()returns{[string]: string}. Drivers keep typed values internally for broker operations, while the Lua boundary normalizes numbers and booleans to strings, preserves binary attributes as raw Lua strings, and treats missing/nil values as absent.Manager.AddNoderetains a supplied host-module manifest so dependency alias imports, LSP dependency manifests, and builtin cache fingerprints can consume it.process.set_optionsnow declares its actual partial-update contract, whileprocess.get_optionsretains the complete result shape.The SQS and queue handlers now explicitly default a missing
correlation_id, rather than hiding that valid nil path in the host declaration. The intentional undeclared-module fixture also uses a dynamic module name so the static application lint can complete while runtime scoping still rejects the undeclaredjsonimport.Checker validation
The corrected declarations and call-site narrowing validate with the repository's published
github.com/wippyai/go-lua v1.5.16; the target fixes do not depend on an unpublished go-lua checkout.Source-backed strict lint over the complete test application reports:
tests/appApplication-suite reliability
The application suite now binds its HTTP/WebSocket gateway to dedicated port
18085and fails fast if that port is already occupied, preventing an unrelated local Wippy process from returning plausible but incorrect responses. Its external-service probes are bounded, and the Docker image dependency is checked before execution.Tests
tests/app/test.sh: 389/389 passed across 50 suiteswippy lint --json --cache-reset: 597 entries, 0 diagnosticsgo test -race ./runtime/lua/modules/process ./runtime/lua/modules/queue ./runtime/lua/modules/fs ./runtime/lua/code -count=1go test ./runtime/lua/... -count=1go test ./service/queue/... ./service/aws/sqs -count=1make lint: 0 issuesCI passes on Ubuntu and Windows, along with lint and CodeQL.