mirror of
https://github.com/storytold/craft-ai-integrations.git
synced 2026-11-27 17:00:52 +01:00
chore/lock-github-actions
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
7be5af833f |
feat(client): status, picker, route notes and engine advice agree with what the default route can do (#94) (#100)
* feat(client): one start button for setting up a built-in model, with no tick box unless a licence needs one (#94) Part of #94, slice 1 of 3. The shared pieces for a one-click setup existed but nothing joined them. - NativeRoute/NativeSetupPlan::needs_agreement: the licence tick shows, and a download waits for it, only when a file's licence needs agreement. SAM 2.1 needs none. - SetupSession::start/next_task/blocker: one button that checks complete files on disk or downloads, and says why it does nothing (SetupBlock). - FolderDesk::ensure_default(_at): takes the suggested folder only when none is chosen. The widget offers it (UseSuggestedFolder) instead of dead-ending at "Choose a model folder". - ToolDesk::adopt(&CheckedNative): only checked files, binds only if no choice exists, and returns the choice it kept. - Docs: the flow in use-in-your-app, LAYOUT lists the Burn crates, STATUS row. - Mutation group fr (6 cases, 6 caught); two older cases re-aimed at the changed code. Checked: fmt, strict clippy and tests for craft-ai-features, -client, -egui and -comfy-env (473 passed, 2 ignored), wasm check for craft-ai-features, every mutation group --dry clean, group fr run for real, documentation 14/14. Scripted tests only: no real download, no model run through it, no app has mounted it, no macOS or Linux run. * feat(client): try a built-in selection model with a click, and fail a selection that chose nothing (#94) Part of #94, slice 2 of 3 (stacked on slice 1). The launcher's try-it sample for Select subject sent only a description. The default built-in route (SAM 2.1 on rten) refuses descriptions and selects by clicking, so the sample failed on the default route. - sample_request_for(feature, built_in): for image.segment with a built-in route, one click on the middle of the test disc and no description. Everything else is the plain sample. - ToolDesk::start_sample: picks the sample from the tool's current choice (a built-in engine the tool's recipe lists gets the click; ComfyUI and hosted routes keep the description). - ToolDesk::finish: a selection that ran but reports matched: false is a failed test. - Docs: step 5 of the set-up flow, STATUS row. - Mutation group fr gains 2 cases (8 in all, 8 caught). Checked: fmt, strict clippy and tests for craft-ai-features, -client, -egui and -comfy-env (478 passed, 2 ignored), wasm check for craft-ai-features, group fr run for real, documentation 34/34. Scripted tests and a fake provider only: no real model, no app, no macOS or Linux run. * feat(client): status, picker, route notes and engine advice agree with what the default route can do (#94) Part of #94, slice 3 of 3 (stacked on slices 1 and 2). - AiClient::status: a built-in model whose weights file has gone is not Ready. - The picker lists such a model once, as one to set up again, not also as a ready one. - NativeRoute::note: the setup option, the picker row and its description say the built-in SAM 2.1 route selects by clicking on the picture, instead of offering a prompt it refuses. - NativeRoute::fast_on_processor (rten, one Windows machine, about 35 ms a click, not a benchmark): engine advice gives it Pace::Processor, not "slow", and ranks it level with a card engine, so the recipe's first engine is the suggestion with or without a graphics card. - Mutation group fr gains 6 cases (14 in all, 14 caught); the Burn route case is re-aimed. Checked: fmt, strict clippy and tests for craft-ai-features, -client, -egui and -comfy-env (483 passed, 2 ignored), wasm check for craft-ai-features, every mutation group --dry clean, group fr run for real. Documentation 66/67; the one flagged is an untouched neighbour of a doc line. Scripted tests only: no real download, no model run through it, no app, no macOS or Linux run. * fix(client): one real start button, a failed check falls through to download, folder order (#98 review) Fixes the CodeRabbit findings on #98 that held up. - The setup widget showed "Check existing files" and "Download model files" side by side when complete files were on disk, so a person could start a download instead of the check. It now draws one start button from SetupSession::next_task and blocker, and its click calls SetupSession::start. The licence tick shows only when the next task is a download. - After a failed check, start kept choosing the check again, so files that did not match were a dead end. The session now remembers the folder that failed and downloads next; a different folder, or a different target, is checked again. - FolderDesk::ensure_default needed the computer's suggested folder even when the person had already chosen one. It now looks at chosen folders first. - The adopting guide told a host to call ensure_default before drawing the first screen, which makes the folder before the person accepts it. It now says to call it only on their yes. Checked: fmt; strict clippy; client tests and egui tests pass except the existing panel::a_dead_server_is_reported flake, which passed 3 of 3 alone; docs bar 38/38; mutation group fr 11/11 caught. Group nw had a case aimed at the old two-button code; it is re-aimed and caught. * fix(client): the sample copies only the small result outputs, not whole pictures (#99 review) finish cloned every output to read the selection result, copying large inline pictures and videos. It now copies only inline JSON, the form of a selection result. Behaviour is unchanged, so no test can see the copy; the existing sample tests still pass. Checked: fmt, strict clippy, client tests (309 passed), docs bar 64/64, mutation group fr 13/13. * fix(client,engine-candle,features): a selection sample needs its result, Candle sends it, small card pace (#100 review) Fixes the CodeRabbit findings on #100. - A segmentation sample passed when the route returned a mask and no Found result. The contract gives every route both, so the sample now fails with "did not say whether it selected anything". Other tools are unchanged. - Candle SAM 3 returned only a mask, which would now fail that test. It sends the Found result too (matched with its score, or nothing found when the model gave no prediction). - A processor-quick engine whose matching card is too small was called slow. It is now judged by the processor, as the card is not needed. - The adopting guide said every built-in selection model rejects words. It now says the sample uses a click, which every built-in route reads, and names the new rule. Docs bar: undocumented neighbours of the changed hunks are documented, the chain walked up to the first documented function (tests/engine.rs helpers and tests, three Candle runner methods). Checked: fmt; strict clippy (features, client, engine-candle); tests (features, client, candle lib: 440 passed); wasm check of craft-ai-features; docs bar 124/124; mutation group fr 22/22 caught, with three new cases. Not run: the live Candle test (needs the SAM 3 weights), so Candle sending Found is covered by a unit test of the result, not by a real run. * fix(client): only the connection this suite saves gets the click sample (#99 review) start_sample treated any connection whose provider is a built-in engine's name as built in. A custom connection that reuses the name `rten` may serve a model that needs a description, and the click-only request is refused by the planner before it is sent. The click sample now needs the engine's own saved connection id as well. Others keep the description sample. Checked: fmt, strict clippy, client tests (310 passed), docs bar 65/65, mutation group fr 14/14 caught (one new case; 'sample-ignores-the-route' re-aimed at the changed line). * fix(egui): show suggested folder before creating it The suggestion action creates the folder. Display its actual path first, and hide the action if no suggestion can be made. Keep the native path helper available in the egui library, not only its tests. Checked: fmt, strict clippy, 492 focused tests, wasm, 24/24 first-run mutations, docs 134/134. * fix(egui): keep the folder suggestion idle-only and test no suggestion The suggestion now waits for an active check to finish. Tests guard systems without a suggested path and exercise a busy session with discovered read-only files. Checked: 493 affected tests, fmt, strict clippy, wasm, 25/25 first-run mutations, docs 135/135. * fix(client): recover from bad files in a new approved folder A failed check now blocks reuse of the rejected directory and the previously shown destination. The person chooses a fresh folder, and the worker creates its model directory only if absent. The old files remain untouched, even if the newly approved directory appears before the worker begins. Scripted transfer and retry regressions: 388 affected tests, fmt, strict clippy, wasm, 15/15 first-run mutations, docs 49/49. Four unrelated native-feature mutations survive on upstream main too. * fix(client): explain why a fresh model folder could not be made Preserve the atomic create and distinguish an occupied destination, a missing approved parent and permission denial. Red regressions cover missing and occupied paths, and a mutation checks the message. Checked: 390 affected tests, fmt, strict clippy, wasm, 16/16 first-run mutations, docs 66/66. * fix(client): try another model under the built-in connection with words The sample picked a click whenever the connection was the one this suite saves for the engine, without checking the model. Connection management can put another model under that id, one that wants a description, and the click sample then failed for the wrong reason. Match the model the engine's recipe names as well. --------- Co-authored-by: scratch <s@s> |
||
|
|
182e248e95 |
feat(ai-egui): a neutral widget for setting up a built-in model's files (#72)
* feat(ai-features): plan and offer a built-in runtime's own files plan_native and setup_offer_native compare the files a runtime reads, which are a different layout from the ComfyUI checkpoint, and need neither ComfyUI nor its node packs. Setup options gain Route::Native (native:<feature>:<provider>) for each runtime that names files. A runtime with no files of its own gets no plan, no offer and no option. The built-in install offer now lists the runtime's three files, not the ComfyUI checkpoint. * feat(ai-client): find, check and download a built-in runtime's own files NativeSetupPlan is an immutable, reviewable plan for one runtime's files: where they are, where a download would go, how many bytes are still needed. FolderDesk finds a runtime's files in the person's folders (only together in one directory), hashes them before reuse, and downloads only into the chosen default folder, with licence approval. The folder scan lists a runtime's tokenizer files on an exact name and size. The picker lists a runtime as needing an adapter when the app has none. * feat(ai-client): a setup session with approval, one running request and worker-safe answers SetupSession keeps the licence approval, one running request with a ticket, and cancel. It refuses late, stale and foreign answers, progress for the wrong request, and a result for a different reviewed directory or runtime. Starting a download consumes the approval. Mutation group nq covers these rules. * feat(ai-egui): a neutral widget for setting up a built-in model's files native_model_setup draws the review (destination, licences, size), keeps Download off until the licences are accepted, reports progress with Cancel, and returns a NativeSetupAction for the host. Checked files are offered for use, not called ready, and a source's error text is never shown. * fix(ai-features): one recipe rule for every built-in runtime path, and a build that compiles alone Planning, the Install offer and the setup options stopped at the first recipe, while registration and engine advice used the first usable one. An unusable recipe in front hid a usable one behind it, and two recipes naming one runtime gave two options with the same id. `Feature::first_usable_recipe` is now the one rule. `plan_native`, the built-in Install offer and `setup_options` use it, and each runtime gets a single option. The picker's route match gets a Native arm that lists nothing yet, so this change builds on main without the next one. * fix(ai-client): skip a registered folder that has gone, use the first usable recipe, test with and without Candle - `native_files` no longer fails every native call when one registered folder is missing (an unplugged drive, a deleted folder). That folder is not a candidate; the others are still read. - `native_route` uses `Feature::first_usable_recipe`, the rule the planner and the setup options now share, so a Set up link that the picker shows can be followed. - The picker tests accept the built-in engine either as NotSetUp (Candle built in) or as NeedsAdapter (not built in), as `picker_native` already did. Merges the fix to #69 (one recipe rule, and the picker's Native arm). * fix(ai-client): progress cannot cancel a download, and a lost model file can be set up again - `SetupSession::review` compares only what the person approved (tool, runtime, destination and availability, `NativeSetupPlan::same_target`). The bytes still needed and the directory where files were found change as a download runs, so a fresh plan for the same target no longer cancels the worker, clears the approval or drops the verified result. - A built-in model whose saved connection has lost its weights file is listed with its Set up link again, and says the files are missing, instead of showing a connection with no way back. Merges the fixes to #69 and #70. * fix(ai-features): list every local model before any built-in runtime A tool with a built-in runtime put its option ahead of a later tool's local models, which broke the documented order. Runtimes are now collected apart and added after all local options and before hosted services. * fix(ai-client): a result belongs to its directory, and a built-in option matches its own model - `SetupSession::review` drops a checked result when a later plan for the same target finds the files in another directory, so the widget cannot offer to use the old one. Progress in the same directory still keeps it. - The picker hides a built-in option only for the connection that option saves (`local-<feature>-<provider>`), not for any connection of the same runtime and role. Merges the ordering fix to #69. * fix(ai-features): the built-in Install offer agrees to words that match what it does The offer reused the ComfyUI terms, which promise that everything stays in the app's own folder and that ComfyUI is installed. The built-in route installs no ComfyUI and saves into the model folder the person chose. `agreement_for(route)` gives it its own wording and version; the ComfyUI route keeps `agreement()` unchanged. The wording is still draft, like the original. * feat(ai-features): a native setup option names its model Route::Native carries the model id its connection will have, so the picker can tell a saved connection for this model from one for another model of the same runtime. * fix(ai-client): match a built-in option to its own model, and drop a late result for a moved-from directory - The picker hides a built-in option only for a saved connection whose model id is the one the option names (`Route::Native::model`), so an older model on the same connection id does not hide the current one. - A worker's answer that arrives after a review moved to another directory is accepted as the running request's answer but not kept as a checked result, and is not an error. * fix(ai-features): the built-in terms name the Download click The built-in flow's control is Download, not Install, so its terms now say Download. * fix(ai-client): the picker matches a built-in option to its own model A saved connection hides a built-in option only if one of its models is the model that option names, so another model of the same runtime does not hide it. * fix(ai-client): keep a download's result when complete files exist elsewhere A checked result is kept for a directory the plan stands for: where it found complete files, or where a download would go. The stricter rule discarded the result of a download into its destination whenever discovery pointed at another complete copy. |