Skip to content
Cockpit0.29.0
A snapshot: read at commit 707a04c7ce8 on 2026-10-18T00:06:01Z by majordomus 0.29.0. Nothing on this page is read again. See it live

I0811

Read-only knowledge lookup with an ordering that can be explained

Where it stands

devtask.issue
Readiness
complete completion is recorded and every required evidence token is present
Status
DONE
Can start
not now
Milestone
Milestone status
ACTIVE
Wave
4
Waiting on
none
Holds back
Behind it in all
5
Evidence
2 of 2
A move writes the repository: it stamps one field of this issue's record and appends one event to the ledger, and a commit will carry both.
The same moves from a terminal

majordomus plan start I0811

majordomus plan verify I0811

majordomus plan done I0811

What it is

Objective
Implement `knowledge search`, `knowledge show` and `knowledge related`: deterministic lookup over the generated index with a documented, tested match order, JSON output that names the field each result matched on, and no write of any kind.
Why
A query that rebuilds the index mutates the repository as a side effect of asking a question, which makes a read-only command a write and breaks every reproduce line that follows it. And a relevance order nobody can explain is one nobody can debug; the order has to be a rule, not a score.
Now
`majordomus search` is a literal grep over the six operational record kinds and must keep that contract unchanged. Nothing searches the repository's canonical artifacts.
Wanted
`knowledge search` ranks by an explicit ladder — exact canonical id, exact title, title prefix, path, tag, then literal body match — and reports the matched field for every result. `knowledge show` prints one node with its source path and hash. `knowledge related` prints the edges into and out of one node with their provenance. A stale index is reported, never silently rebuilt.
Done when
unknown: the record declares no `completion`
Risk
Two commands now contain the word search with different corpora and different contracts. If the distinction is not stated where a worker reads it, the wrong one gets used and the answer looks like an absence.

Acceptance

  • The match ladder is documented and a case asserts the order for a query that matches at two levels
  • JSON output carries the id, kind, title, source and matched field of every result
  • Running every read-only knowledge command leaves git status byte-identical
  • A stale index is reported as stale by every read command, and none of them rebuilds it
  • The existing search command's output and exit codes are unchanged, proved by its own case still passing
Validation
bash test/run.sh 69_knowledge_querybash test/run.sh 24_prompt_search
Evidence required
query_explainablereadonly_proven
Evidence present
query_explainablereadonly_proven

Scope

Touches
lib/knowledge.shbin/majordomusdocs/CLI.mdtest/cases
Not
Any change to the existing search command's behaviourEmbeddings, similarity, or any opaque scoreRebuilding the index from a read
Depends on
Priority
p1
Profile
implementation
Parallel safe
false
Owner
unknown: the record declares no `owner`

The work so far

Branches
none
Merged
none
Commits
0
Trunk
master
Sessions
none
Created
2026-09-04
Updated
2026-10-14T20:18:28Z
Started
2026-10-14T20:17:07Z
Verified
2026-10-14T20:18:06Z
Completed
2026-10-14T20:18:28Z

Synchronisation

Adapter
scripts/github-sync
Repository
unknown: the derived plan's header carries no repository
External issue
unknown: a live GitHub state; this executable makes no network call, so only `scripts/github-sync --check` can answer it
State there
unknown: a live GitHub state; this executable makes no network call, so only `scripts/github-sync --check` can answer it

Findings

Nothing is wrong with these records.