Skip to content

Prompt cache management#16

Merged
icppWorld merged 10 commits intomainfrom
prompt-cache-management
Jul 7, 2025
Merged

Prompt cache management#16
icppWorld merged 10 commits intomainfrom
prompt-cache-management

Conversation

@icppWorld
Copy link
Contributor

Endpoints to explore & manage the filesystem in a llama_cpp_canister

icppWorld added 10 commits July 4, 2025 10:30
Adds canister endpoints to expose `std::filesystem` functionality,
specifically for file size retrieval and file removal.

These functions are intended to provide canisters with basic
file system management capabilities, enabling features such as
checking file existence and size before attempting to download
or process them, and to clean up temporary files after use.
Implements filesystem management tests, covering file existence checks and removal, with permission validation for different user roles.

The tests cover the filesystem_file_size and filesystem_remove functions, ensuring proper handling of existing and non-existing files. It includes tests for anonymous, non-controller and controller user roles.

Also, an entry to the .gitignore file for the Work directory was added to ignore it.
Introduces tests for filesystem access control.

Specifically, this commit adds tests to verify that:
- Only the canister's controller can access and modify files
- Anonymous and non-controller identities are denied access

These tests cover filesystem file size retrieval and file removal operations, ensuring proper access control mechanisms are in place.
Extends the test suite to include tests for file-related functionalities, ensuring comprehensive coverage.
Disables filesystem tests that require a non-default identity.

These tests are currently failing because the test suite's QA script
does not yet support running tests with non-default identities. A TODO
has been added to address this limitation.
Implements functionality to recursively list the contents of a directory,
including files and subdirectories, with their types and sizes.

The new `recursive_dir_content` function allows retrieving
directory contents. It includes checks for directory existence
and proper permission handling.
Anonymous and non-controller principals are denied access.

Adds test coverage for existing and non-existing directories.
Adds new tests to verify the behavior of the
`recursive_dir_content` API under different access scenarios.
This includes tests for non-existent directories,
anonymous access, and controller access, enhancing the
overall robustness of the filesystem functionality.
Updates file creation logic to create nested directories
recursively, ensuring that the full path to the file exists
before attempting to create it.
@icppWorld icppWorld merged commit 84f17d2 into main Jul 7, 2025
1 check passed
@icppWorld icppWorld deleted the prompt-cache-management branch July 7, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant