Repository navigation
Knowledge: space, the knowledge's usage and an import removed (draft-1) - #33
Merged
Merged
Conversation
cjus/chessdb#48) Capability space offers knowledge/usage (the bytes the node's knowledge takes on its disk) and knowledge/remove (an import's knowledge taken out, and the import with it, answered once its space is given back). So a client that downloads puzzles a part at a time can keep the knowledge within a disk limit the player sets, and remove a whole database a smaller set replaces. All optional. Spec, types, tests and a conformance session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
For cjus/chessdb#48: Solrac's puzzles move from one 6.2-million-puzzle import to a small starter set plus packs by rating band, fetched as the player needs them, within a disk limit the player sets. To keep to that limit, and to delete the old full import, a client needs two things the knowledge domain doesn't have. "Not in draft 1" already listed one of them, removing an import's knowledge.
What it adds (all optional, draft-1)
space, its own switch. A node that doesn't offer it is unchanged.knowledge/usage(no params) answers{"bytes": n}: what the node's knowledge takes on its disk, everything it keeps for it included.knowledge/remove{kind, checksum}takes an import's knowledge out, and the import with it. It answers{"removed": <the import>, "bytes": n}once the space is given back to the disk.statusand to reads from the moment the request arrives. A removal interrupted by the node stopping is finished when the node starts again.Changes
spec/knowledge.md: the capability, a new "Space" section, the Busy row in the errors table, "Not in draft 1", and "Changes".cnp::knowledge:Capabilities::space,KnowledgeUsage/UsageResult,RemoveImport/RemoveParams/RemoveResult.conformance/knowledge/space.jsonl: usage answers an integer; removing an unknown import gives -32025; a missing checksum gives -32602.Checks run locally:
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test,cargo docwith-D warnings,cargo deny check.Next: chessdb implements it and pins this, then Solrac.
🤖 Generated with Claude Code