Features and their tests
Everything the AI assistant plugin does, and the tests that check it. The test names are the ones cargo test prints. scripts/test-all.py fails when a feature here names no test, or names a test that doesn’t exist, so a new feature gets its row and its tests in the same pull request (the Testing page says how to run them).
The tests talk to a scripted server on 127.0.0.1 and to a stand-in for OxiGuitar; none needs a real model or the network.
| Feature | What it does | Tests |
|---|---|---|
| The chat tab | A Slint panel (Chat in ui/ai.slint) that fills the tab: the conversation, each entry with its kind, words and local time (the user’s in blue on the left, the model’s in green on the right, problems in red), selectable and copyable; a server to allow asked as a question with Allow and Cancel icons; the input under it, one line to start, growing with the text and taller when its divider is dragged; Send (Stop while the model works) and New Chat as icons beside it; the model’s thinking is left out. Through OxiGuitar’s host, a question sent shows and clears the box, and with no server to ask it ends in a sentence. | ui::chat::tests::the_view_shows_the_conversation, agent::tests::entries_are_stamped_with_the_time, ui::chat::tests::a_question_for_a_server_away_waits_and_new_chat_clears, ui::chat::tests::thinking_is_left_out_of_what_shows, contract::a_question_goes_through_the_host |
| Any chat completions server | OpenAI’s protocol: answers streamed in pieces or whole, tool calls, the model list; a server’s error is a sentence with a hint. | client::tests::a_stream_brings_text_and_tool_calls_in_pieces, client::tests::a_stream_without_indexes_or_with_an_error_is_understood, client::tests::a_whole_answer_and_the_model_list_are_read, client::tests::server_errors_are_sentences_with_a_hint, agent::tests::a_whole_answer_and_a_servers_error_show_in_the_chat |
| Presets and the address | Presets fill the address; scheme, host, port, path and query each kept on its own; numbers checked; old settings take defaults. | settings::tests::a_preset_fills_the_address_and_keeps_the_key_and_model, settings::tests::every_part_of_the_address_is_its_own, settings::tests::numbers_are_checked, settings::tests::settings_read_back_and_old_ones_take_defaults |
| Keys and headers | The key as typed, or from an environment variable the settings name; extra header lines. | settings::tests::headers_carry_the_key_and_the_extra_lines, settings::tests::a_named_environment_variable_gives_the_key |
| Your data | A server on this computer is used at once; one elsewhere only after the user allows it, by name. | settings::tests::only_this_computer_needs_no_permission, agent::tests::a_server_away_from_this_computer_needs_permission |
| Reading the score | An overview of the song (tracks, tunings, changes) and any bars, in the plugin’s text notation. | notation::tests::the_overview_names_tracks_tunings_and_changes, notation::tests::bars_written_read_back_the_same, notation::tests::pitches_and_durations_read_and_write, notation::tests::keys_read_and_write |
| Writing music | Bars into a track’s voice, new tracks, time and key signatures, tempo, sections and the song’s title, artist and album; wrong bars change nothing and say why, uneven ones are said. | tools::tests::writes_are_kept_as_one_change_at_the_end, tools::tests::set_info_changes_the_title_artist_and_album, tools::tests::section_letters_count_on, notation::tests::wrong_bars_change_nothing_and_say_why, notation::tests::uneven_bars_are_written_and_said |
| Running OxiGuitar’s tools | The model lists the core’s and other plugins’ tools, selects bars and runs them; the changes so far are handed back first. | tools::tests::a_tool_of_oxiguitar_runs_after_the_changes_are_handed_back, tools::tests::the_tools_are_well_formed |
| One answer, one Undo | Everything the model changes in one answer is one change named “AI: …”. | tools::tests::writes_are_kept_as_one_change_at_the_end, agent::tests::a_turn_streams_calls_a_tool_and_keeps_the_change |
| The conversation | A turn streams, calls tools and keeps the change; tool calls are described in words; the user’s instructions follow the plugin’s; New Chat starts over. | agent::tests::a_turn_streams_calls_a_tool_and_keeps_the_change, agent::tests::tool_calls_are_described_in_words, agent::tests::the_users_instructions_follow_the_plugins, agent::tests::clearing_starts_a_new_conversation |
| Skills | Markdown notes of the user’s own in the skills folder (NAME.md or NAME/SKILL.md, with an optional header): the model is told their names and descriptions and loads one with use_skill; always: true puts one in the instructions; files that are empty, too big or not text are left out and said; the user’s folder wins over a system one. | skills::tests::a_header_names_and_describes_a_skill, skills::tests::without_a_header_the_file_names_it_and_the_first_line_describes_it, skills::tests::files_and_folders_load_and_the_first_name_wins, skills::tests::the_prompt_lists_what_is_on_request_and_holds_what_always_applies, tools::tests::the_model_loads_a_skill_by_name, agent::tests::a_skill_is_listed_then_loaded_when_the_model_asks, agent::tests::the_skills_come_after_the_plugins_instructions_and_before_the_users |
| Mistakes are sentences | A wrong tool call gets a sentence the model can act on, never a crash. | tools::tests::mistakes_are_sentences_for_the_model |
| The settings window | A Slint window (SettingsWindow in ui/ai.slint) in six tabs: a preset fills the texts; what is typed counts and isn’t set back under the caret; the key is hidden unless shown; models and allowed servers are picked from lists; a number that isn’t one is said and the rest kept; Cancel forgets. | ui::settings_window::tests::a_preset_fills_the_texts_and_cancel_forgets, ui::settings_window::tests::a_number_that_isnt_one_is_said_and_the_rest_kept, ui::settings_window::tests::models_and_allowed_servers_are_picked_from_lists, links::tests::only_web_addresses_are_opened |
| The views compile | ui/ai.slint compiles as OxiGuitar compiles it, with every property and callback the chat and the window use. | tests::the_slint_file_has_what_the_views_set_and_hear |
| A working plugin file | The .oxp file keeps the plugin contract, with this repository’s SDK version and with the newest release of OxiGuitar. | contract::the_plugin_file_keeps_the_contract, tests::the_manifest_is_valid_for_the_plugin, oxiguitar_plugin_checks::the_manifest_matches_the_plugin, stage:contract (latest core) |