Skip to content

Knowledge: space, the knowledge's usage and an import removed (draft-1) - #33

Merged
cjus merged 1 commit into
mainfrom
claude/knowledge-space
Nov 17, 2026
Merged

cjus merged 1 commit into
mainfrom
claude/knowledge-space

Conversation

@cjus

@cjus cjus commented Nov 17, 2026

Copy link
Copy Markdown
Owner

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)

  • Capability 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.
    • The import is gone to status and to reads from the moment the request arrives. A removal interrupted by the node stopping is finished when the node starts again.
    • Only that import's knowledge goes: a position another import also has stays, and nothing of the player's is touched.
    • A running import is Busy (-32013), as is a second removal or an import while one runs. An unknown identity is -32025. Importing the same file later imports it afresh.

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.
  • Tests:
    • the spec's new examples parse as their types;
    • the switch is off for older nodes;
    • usage takes no params and holds more than 32 bits;
    • a removal's params and result round-trip.
  • 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 doc with -D warnings, cargo deny check.

Next: chessdb implements it and pins this, then Solrac.

🤖 Generated with Claude Code

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>
@cjus
cjus marked this pull request as ready for review November 17, 2026 03:26
@cjus
cjus merged commit d53ad39 into main Nov 17, 2026
2 checks passed
@cjus
cjus deleted the claude/knowledge-space branch November 17, 2026 03: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