ScratchpadPlugin (https://github.com/fuseraft/fuseraft-cli/blob/main/src/Infrastructure/Plugins/ScratchpadPlugin.cs) has no test file — there is no ScratchpadPluginTests.cs under tests/FuseraftCli.Tests/.
The plugin gives agents a small per-session JSON key/value store (WriteAsync, ReadAsync, ReadAllAsync, SearchAsync, DeleteAsync), scoped either to the current agent or shared via a global scope, backed by a JSON file at {BasePath}/{AgentName}.json (or {BasePath}/global.json). It's fully self-contained — no AI client or network mocking needed, just a temp directory.
Good first areas to cover:
- Write then read round-trips a value, including tags
- Read of a missing key returns the
[NOT FOUND] message
ReadAllAsync on an empty scratchpad returns [EMPTY]
SearchAsync matches on key, value, and tag substrings (case-insensitively)
DeleteAsync removes an entry and returns [NOT FOUND] on a second delete
agent vs global scope write to different files and don't leak into each other
- A corrupted/invalid JSON file on disk falls back to an empty scratchpad rather than throwing (see the
catch in LoadAsync)
JsonPluginTests.cs and TodoPluginTests.cs (in the same tests/FuseraftCli.Tests/ directory) are good references for the file-backed-plugin test pattern used in this repo.
ScratchpadPlugin(https://github.com/fuseraft/fuseraft-cli/blob/main/src/Infrastructure/Plugins/ScratchpadPlugin.cs) has no test file — there is noScratchpadPluginTests.csundertests/FuseraftCli.Tests/.The plugin gives agents a small per-session JSON key/value store (
WriteAsync,ReadAsync,ReadAllAsync,SearchAsync,DeleteAsync), scoped either to the current agent or shared via aglobalscope, backed by a JSON file at{BasePath}/{AgentName}.json(or{BasePath}/global.json). It's fully self-contained — no AI client or network mocking needed, just a temp directory.Good first areas to cover:
[NOT FOUND]messageReadAllAsyncon an empty scratchpad returns[EMPTY]SearchAsyncmatches on key, value, and tag substrings (case-insensitively)DeleteAsyncremoves an entry and returns[NOT FOUND]on a second deleteagentvsglobalscope write to different files and don't leak into each othercatchinLoadAsync)JsonPluginTests.csandTodoPluginTests.cs(in the sametests/FuseraftCli.Tests/directory) are good references for the file-backed-plugin test pattern used in this repo.