CLI Version
hydradb-cli 0.2.0 (installed from source, main at d7f263d)
Python Version
Python 3.14.4
Operating System
EndeavourOS (Arch Linux), kernel 6.18
Bug Description
hydradb ingest does not validate --kind. The only value it checks for is knowledge; anything else falls through to the memory path. So a misspelled or wrongly-cased value (--kind knowlegde, --kind Knowledge) stores the text as a memory, prints ✓ Memory added, and exits 0.
Expected: the same rejection every other command gives. query, list, delete, relations and subgraph all fail with --kind must be one of: knowledge, memory for the same input. The README also documents --kind for ingest as exactly memory (default) or knowledge.
The cause is the branch in src/hydradb_cli/commands/canonical.py, ingest():
if kind == "knowledge":
_impl.do_ingest_knowledge_text(...)
return
_impl.do_ingest_memory(...)
Nothing before it checks kind against _impl.VALID_KINDS, and do_ingest_memory hard-codes kind="memory", so the bad value is never seen again.
Steps to Reproduce
- Have an API key and a default database configured (
hydradb login --database <db>).
- Run
hydradb ingest --kind knowlegde --text "quarterly notes".
- Observe
✓ Memory added, exit code 0. The request sent to /context/ingest carries type=memory and a memories field, so the text is filed as a memory, not knowledge.
- Compare:
hydradb query "x" --kind knowlegde exits 1 with --kind must be one of: knowledge, memory. Got 'knowlegde'.
CLI Output
$ hydradb ingest --kind knowledge --text "quarterly notes"
✓ Knowledge source uploaded to database db
"quarterly notes"
Source ID: src_1
$ echo $?
0
$ hydradb ingest --kind knowlegde --text "quarterly notes"
✓ Memory added (1 success, 0 failed)
"quarterly notes"
Source ID: src_1 (ok)
$ echo $?
0
$ hydradb query "x" --kind knowlegde
✗ Error: --kind must be one of: knowledge, memory. Got 'knowlegde'.
$ echo $?
1
(Captured with HYDRADB_BASE_URL pointed at a local stub of the ingest endpoint so the request body could be inspected; the src_1 id is the stub's. The CLI's branching is identical against the real API.)
Additional Context
The deprecated aliases (memories add, knowledge upload-text) are not affected; they pass a fixed kind into _impl directly.
Since this is a silent success rather than an error, a script that builds the --kind value and gets it slightly wrong will keep filing knowledge into the memory corpus with no signal until a later query --kind knowledge comes back empty.
I have a fix ready (one guard in ingest() reusing _impl.VALID_KINDS, plus tests) and will open a PR referencing this issue.
CLI Version
hydradb-cli 0.2.0 (installed from source,
mainat d7f263d)Python Version
Python 3.14.4
Operating System
EndeavourOS (Arch Linux), kernel 6.18
Bug Description
hydradb ingestdoes not validate--kind. The only value it checks for isknowledge; anything else falls through to the memory path. So a misspelled or wrongly-cased value (--kind knowlegde,--kind Knowledge) stores the text as a memory, prints✓ Memory added, and exits 0.Expected: the same rejection every other command gives.
query,list,delete,relationsandsubgraphall fail with--kind must be one of: knowledge, memoryfor the same input. The README also documents--kindforingestas exactlymemory(default) orknowledge.The cause is the branch in
src/hydradb_cli/commands/canonical.py,ingest():Nothing before it checks
kindagainst_impl.VALID_KINDS, anddo_ingest_memoryhard-codeskind="memory", so the bad value is never seen again.Steps to Reproduce
hydradb login --database <db>).hydradb ingest --kind knowlegde --text "quarterly notes".✓ Memory added, exit code 0. The request sent to/context/ingestcarriestype=memoryand amemoriesfield, so the text is filed as a memory, not knowledge.hydradb query "x" --kind knowlegdeexits 1 with--kind must be one of: knowledge, memory. Got 'knowlegde'.CLI Output
(Captured with
HYDRADB_BASE_URLpointed at a local stub of the ingest endpoint so the request body could be inspected; thesrc_1id is the stub's. The CLI's branching is identical against the real API.)Additional Context
The deprecated aliases (
memories add,knowledge upload-text) are not affected; they pass a fixedkindinto_impldirectly.Since this is a silent success rather than an error, a script that builds the
--kindvalue and gets it slightly wrong will keep filing knowledge into the memory corpus with no signal until a laterquery --kind knowledgecomes back empty.I have a fix ready (one guard in
ingest()reusing_impl.VALID_KINDS, plus tests) and will open a PR referencing this issue.