Repository navigation
Implement native preludes (RV_PACK_OPEN + RvLua) and Lua source preludes - #100
Merged
Merged
Conversation
A review of the merged follow-up found no fault in the code, six places of the conversion of a table to data that no test failed for, and comments of two tests and sentences of the plan that were not exact. With two of those places changed, one value had two results among VMs. - `data-tests.rs`: a list whose items are in the part of the table that holds names converts, the key -1 is no item of a list, a marked table that holds a view under a name stays a list, an item of a marked table is read as that of any list, and a table with a gap that itself holds more than the budget is too large. - `messages-tests-view.rs`: a view of a record spends its values where the conversion does not read it and where it nests too deep. - The comment of the cases of a list that is no table in `tests/sandbox.rs` gives the method call of the comparison as the reason why two of them put the `__index` of strings back. - The plan tells of the review, names the VM of the measurements of "Known" that had none, names the `markdown` functions in the rule of a weak table, and corrects sentences of its account of the earlier reviews. Plan: /plan/2026-11-23-1-deterministic-lua-follow-up.plan.md
A string that is not UTF-8 raised `error converting Lua string to &str (invalid utf-8 sequence of 1 bytes from index 0)` in `tools.get`, `tools.packs.get`, `jump`, `call`, a spawn, a fanout, the `prompt` reads, and `require`, and as a key of the collection of `tasks.fanout`. `untrusted`, `models.get`, `compactors.fail`, and `compactors.clear` raised the same with `String` behind `bad argument cppalliance#1: `. An assignment to a tool object or a Pack object with such a key raised it behind ``bad argument cppalliance#2 to `LuaToolHandle.__newindex`: ``, with `LuaPackHandle` for a Pack object. The short form of the parameters of `tools.adhoc` raised the first text for a parameter's name and description. That text is the Lua binding's and names a type of Rust. `tasks.join_any` and `tasks.join` with such an id ended the block with `scripts may not yield directly`, which `pcall` did not catch. This is issue cppalliance#55. - The functions of the first two sentences raise `{name} must be a valid UTF-8 string`, the sentence that the `store` functions and the calls with text have, as in `section target must be a valid UTF-8 string` and `tools.get id must be a valid UTF-8 string`. One function makes the sentence, and the read of a call's text takes it from there. - A key of the collection of `tasks.fanout` raises `fanout collection key must be a valid UTF-8 string`, beside the two other refusals of a key. - An id in the set of `tasks.join_any` or of `tasks.join` raises `task must be a valid UTF-8 string`, as the other calls that name a task do, and `pcall` catches it. - An assignment to a tool object or a Pack object names the field with U+FFFD for such bytes, as in `Tool objects are frozen: cannot assign field "a�"`, and a key that is neither a string nor a number by the name of its type without the quotes, as the refusal of a write to `args` does. A key that is a string of UTF-8 or a number reads as before. A key that is not UTF-8 is quoted up to 64 bytes, with its length behind a longer one, so the refusal does not grow with the key. - `tools.adhoc` raises `tools.adhoc: param "q" has a description that is not valid UTF-8`, and the same with `name`, as its other refusals read. - Every one of them failed before and fails now, so the guide's sentences on `tools.get` and `tools.packs.get` stand. `untrusted`, `models.get`, and the two compactors take a number as before, and fail in the binding's words for a value that is neither a string nor a number, as before. - The two lookups read the id in place, as before. - A string that is not UTF-8 inside a value that becomes data keeps the text of the conversion, `invalid type: byte array, expected any valid JSON value`, as before; the page and the plan say so. - The page has an entry on a string argument that is not UTF-8, and the plan of the follow-up says that its entry of "Left alone" on the words of `tools.adhoc` is no longer so. - The guide's sentences on the key of a fanout collection, on a task id, on the label of `models.get`, and on the field of such an assignment change with it, in the guide's repository.
A change that gave `next` one nil at the end of a table and the words of `pairs` for a value that is no table was tried and dropped. The plan's entry of "Left alone" on those words says why: the time of a call, and one more text with `mlua`'s label.
Record the multi-wave plan to add native preludes (RV_PACK_OPEN and RvLua) and optional Lua source preludes to the C Plugin contract (version 0.10.0), unvil-plugin-sdk, and unvil-harness. Plan: /plan/2026-12-02-3-native-preludes.plan.md
Add LuaHost, UserdataSpec, and NativePrelude in unvil-lua and extend Prelude, Pack::native_prelude, and RunPacks::snapshot so declared Packs can run a native prelude before an optional Lua prelude in every section VM. - Keep unvil_types::packs::Prelude's public surface unchanged by storing an optional type-erased native opener behind unvil_types::packs::detail and re-exporting LuaHost through unvil_plugin::detail. - Reuse order::WalkPlace for deterministic table walks, proxy::view_data for Engine view unsealing, and json::json_of_text / json::to_json for bulk JSON conversion. - Protect PackUserdata metatables via getmetatable in __impl_globals.lua so getmetatable(u) returns the type name and ostring(u) never exposes a pointer address. Plan: /plan/2026-12-02-3-native-preludes.plan.md
Pin unvil-plugin-sys to contract
Plan: /plan/2026-12-02-3-native-preludes.plan.md
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.
Implements native preludes (\RV_PACK_OPEN\ + handle-based \RvLua) and optional Lua source preludes (\RvPackInfo.lua_prelude) against contract \
Summary by CodeRabbit