CLI: add a read command to inspect a single sentence by sentence-id (elephant show <id>) #9

Closed
opened 2026-07-16 01:55:58 +00:00 by hugooconnor · 0 comments
hugooconnor commented 2026-07-16 01:55:58 +00:00 (Migrated from codeberg.org)

Problem

There is no read command to inspect a single sentence by its sentence-id.
assert/define mint a sentence-id and retract / concede --re consume one,
but to actually look at that entry you must dump the whole journal
(elephant -t <th> --json log) and filter client-side:

elephant -t <th> --json log | jq '.[] | select(.sentence_id=="<id>")'

For an epistemics workflow where you hand agents sentence-ids (concede-to,
retract, "explain why you asserted X"), being unable to say
elephant show <id> is a sharp edge.

Note: the machinery already exists

An entry can already be located by id internally — sentence_id_of(&entry) plus
the by-id find at src/cli.rs:575 (used to validate retract/concede --re,
which errors no entry with sentence-id <id> in this theory). This is only about
exposing that lookup as a read.

Proposal

Add a read command, e.g. elephant -t <th> show <sentence-id>, that prints the
single entry: speech act, literal / SPL form, signer DID, HLC timestamp,
in-reply-to (if any), quarantine status, and — with the global --json flag —
the raw entry object. Reuse the existing by-id lookup and the same
no entry with sentence-id <id> error for a miss.

Related: anuna/elephant#8 (CLI discoverability — surfacing the active store).
Both are "make existing internal state observable from the CLI".

## Problem There is no read command to inspect a **single sentence by its sentence-id**. `assert`/`define` mint a sentence-id and `retract` / `concede --re` consume one, but to actually look at that entry you must dump the whole journal (`elephant -t <th> --json log`) and filter client-side: ``` elephant -t <th> --json log | jq '.[] | select(.sentence_id=="<id>")' ``` For an epistemics workflow where you hand agents sentence-ids (concede-to, retract, "explain why you asserted X"), being unable to say `elephant show <id>` is a sharp edge. ## Note: the machinery already exists An entry can already be located by id internally — `sentence_id_of(&entry)` plus the by-id find at src/cli.rs:575 (used to validate `retract`/`concede --re`, which errors `no entry with sentence-id <id> in this theory`). This is only about exposing that lookup as a read. ## Proposal Add a read command, e.g. `elephant -t <th> show <sentence-id>`, that prints the single entry: speech act, literal / SPL form, signer DID, HLC timestamp, in-reply-to (if any), quarantine status, and — with the global `--json` flag — the raw entry object. Reuse the existing by-id lookup and the same `no entry with sentence-id <id>` error for a miss. Related: anuna/elephant#8 (CLI discoverability — surfacing the active store). Both are "make existing internal state observable from the CLI".
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
anuna-research/elephant#9
No description provided.