Repository navigation
dk 0.8.2: recall honours --top-k with a Context section, dk document, release hardening - #156
Merged
Merged
Conversation
…release hardening
`dk memory recall` printed the server's neighbourhood context as extra rows
after the ranked results, so --top-k 5 could print 7. It now sends
neighborhood_mode (new --neighborhood separate|inline|off, default separate)
and --include-summaries[=false], prints at most --top-k ranked rows (with a
MATCHED_TEXT column when results were collapsed), then a separate Context
section naming which result each neighbour belongs to. --format json prints
one document {memories, context_memories} with matched_text/matched_ids and
context_of/context_of_rank (notes go to stderr). An older server's unmarked
overflow is left out with a warning.
Hardening (Dakera-AI/dakera#920 follow-up):
- ~/.dakera/config.toml written 0600 (dir 0700), existing file narrowed,
warning on stderr when readable by others
- `dk config` shows DAKERA_API_KEY masked, the transport, URL password masked
- warning when the key would go over plain http to a remote host
- raw requests: 10 s connect timeout, 330 s read timeout
- 422/400 "unknown field" hint for the strict admin routes; keys commands use
the shared error path; ids percent-encoded in keys/admin paths
- rustls 0.23.46, quinn-proto 0.11.19, chacha20 0.10.2 (cargo audit clean)
- README: config example no longer shows an api_key/--key dk never read
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019GcW157E6uJuFrBa2RgZBz
`dk document` (Dakera v0.12.3, Dakera-AI/dakera#923):
- import <file|->: text/Markdown/HTML through POST /v1/memory/documents;
PDF/DOCX (and non-UTF-8 text) uploaded as an attachment to the agent's
namespace, then POST /v1/namespaces/{ns}/attachments/{ref}/document.
Media type from the extension or --media-type; --title, --document-id,
--tag, --session-id, --type, --importance, --lang, --chunk-tokens,
--overlap, --strategy, --decompose, --wait/--timeout
- job, list (--limit/--cursor), show (chunks with pages and headings),
delete; table and JSON; an older server is told it needs v0.12.3
- shell completions
`dk memory recall` cites document chunks (SOURCE column; `document` in
JSON) from memory.metadata._dakera_document.
Release dk 0.8.2 for Dakera server v0.12.3: Cargo.toml/lock, CHANGELOG
[0.8.2] with a Breaking entry for the owner-approved recall JSON shape
({memories, context_memories}), README compatibility table, hint text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019GcW157E6uJuFrBa2RgZBz
- dk memory recall lists the server's rank_score (dakera#940), the score that follows the order of the results; smart_score is the fallback for older servers. - A 429 (overload since 0.12.3, where it was 503) exits 6 with the Retry-After hint, for raw and SDK-backed commands alike. - rustls-webpki 0.103.16 (RUSTSEC-2026-0382) and webpki-root-certs 1.0.10 (RUSTSEC-2026-0383): cargo audit is clean again. - Route list: the 0.12.3 restorable-dedup routes. - Container tests for 0.12.3 (document import, citation and delete; PDF without attachments; recall scores follow the order; empty agents answer 200), skipped on an older server. The CI service health check works on images without curl (0.12.3+), so moving CI to 0.12.3 is one line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
dk 0.8.2 for Dakera server v0.12.3 (engine PR Dakera-AI/dakera#922: #917 recall correctness, #920 security hardening, #923 document import).
dk memory recallnow prints at most--top-kranked rows, followed by a separate Context section.dk documentcommand.Merge order: merge engine Dakera-AI/dakera#922 first (its merge tags v0.12.3 and publishes the images), then this PR. helm and deploy go after the clients. This PR does not depend on the 0.12.3 SDK PRs: it stays on
dakera-client0.12.2 and uses raw requests for the 0.12.3 routes and fields.Changes
dk --format json|compact memory recallnow prints one object,{"memories": [...], "context_memories": [...]}, instead of an array of rows. Read the results from.memories. The old output could not be parsed anyway: an info line was printed before the JSON on stdout.dk memory recallneighborhood_modethrough--neighborhood <separate|inline|off>(defaultseparate).include_summariesonly when--include-summaries[=false]is given.--top-kranked rows, then the Context section, where each row names the result it belongs to (#2 <id>).MATCHED_TEXTcolumn when results were collapsed.SOURCEcolumn for results that are document chunks (Field Manual, p. 39-40 › Install). In JSON this isdocument:document_id,title, pages,heading_path,chunk_index.--top-kare left out, with a warning.dk document(Dakera-AI/dakera#923). Uses raw requests; dakera-client stays at 0.12.2.import <file|->, routed by format:POST /v1/memory/documents.--namespace), then imported throughPOST /v1/namespaces/{ns}/attachments/{ref}/document.--media-typeis given; an unknown extension exits 5 before any request.--title,--document-id,--tag,--session-id,--type,--importance,--lang,--chunk-tokens,--overlap,--strategy,--decompose,--wait/--timeout.--wait, a failed job exits non-zero with its status and code.job <id>,list(--limit,--cursor),show <id>(chunks with pages and heading paths),delete <id>. All print as a table or JSON.dkcalls matches the engine router. The route list now includes the document routes.dk keyserrors now carry exit codes and hints.ops shutdowncommand.~/.dakera/config.tomlis written with mode 0600, and its directory with 0700.dk configmasks the API key and shows the transport.dk memory recalllists the server'srank_score, the score that follows the order of the results.scoreandsmart_scorecan rise down the list. Older servers send norank_score;smart_scoreis listed as before.429exits 6 (server busy) with theRetry-Afterhint. Since 0.12.3 an overloaded server answers429where it answered503.dkprints "No memories found" (container test).cargo auditis clean.Cargo.tomlandCargo.lock; CHANGELOG[0.8.2]has a Breaking section; the README compatibility table now covers v0.12.3; hint text updated. The deb/rpm packages read the version fromCargo.toml, and the snap takes it from the tag.Testing
cargo checkpassescargo clippy -- -D warningspasses (--all-targets)cargo fmt --checkpassescargo testpasses: 171 unit, 47 mock integration, 2 route audit, 84 inv012, 26 inv0122, and 18 inv0123(documents, recall citations and context, config, keys).DAKERA_ATTACHMENTS); recall scores that follow the order; and empty agents. These tests skip themselves on an older server.dk document import(Markdown,--wait),list, recall with a citation and a context row, and a PDF import refused while attachments are off.cargo build --release:dk --versionprints 0.8.2, anddk document --helpruns.Checklist
CHANGELOG.mdmemory recall --format jsonshape (see Breaking).🤖 Generated with Claude Code
https://claude.ai/code/session_019GcW157E6uJuFrBa2RgZBz