CLI: expose active/retracted journal counts and log filters #22

Closed
opened 2026-07-16 06:36:52 +00:00 by anuna-02 · 1 comment
anuna-02 commented 2026-07-16 06:36:52 +00:00 (Migrated from codeberg.org)

Summary

Expose active/retracted journal accounting in theory inspection and add first-class
filters to log.

Motivation from the grounded two-machine run

elephant theory list reported 53 entries, but the meaningful breakdown was:

  • 41 active assertions (three setup/member assertions plus 38 content assertions);
  • six retracted assertions;
  • six active retraction entries.

The single total was easy to misread as 53 active statements. Establishing the actual
state required dumping all of log --json and writing several jq predicates. The
same dump was needed to find six entries by signer, SID, performative, and status.

Issue #14 made retraction entries addressable; this proposal builds usable accounting
and query surfaces on top of that structure.

Proposed CLI

For example:

elephant theory inspect rootclaim-grounded --json
elephant log -t rootclaim-grounded --status active --performative assert
elephant log -t rootclaim-grounded --signer did:crdt:... --sid s-...

theory list could retain its compact total while theory inspect reports:

journal entries       53
active assertions     41
retracted assertions   6
retractions             6
active content         38

If active content requires a product-specific definition, omit it or expose the
meta/member count separately rather than guessing.

Acceptance criteria

  • Text and JSON distinguish journal totals, active assertions, retracted assertions,
    and retraction entries.
  • Counts are derived from the same status semantics as log and remain deterministic
    after merge/restart.
  • log filters support signer, status, performative, SID/entry ID, and retraction
    target; filters compose with AND semantics.
  • Empty matches are valid structured results, not parse errors.
  • Tests cover a mixed two-signer journal with multiple retractions.

Environment / evidence

Observed with Elephant 0.1.2. The 53-entry signed journal is retained here:
github.com/anuna-cooperative/flf-elephant-experiment@96ca63675e/runs/2026-07-16/grounded-machineB/log.json

### Summary Expose active/retracted journal accounting in theory inspection and add first-class filters to `log`. ### Motivation from the grounded two-machine run `elephant theory list` reported `53 entries`, but the meaningful breakdown was: - 41 active assertions (three setup/member assertions plus 38 content assertions); - six retracted assertions; - six active retraction entries. The single total was easy to misread as 53 active statements. Establishing the actual state required dumping all of `log --json` and writing several `jq` predicates. The same dump was needed to find six entries by signer, SID, performative, and status. Issue #14 made retraction entries addressable; this proposal builds usable accounting and query surfaces on top of that structure. ### Proposed CLI For example: ```console elephant theory inspect rootclaim-grounded --json elephant log -t rootclaim-grounded --status active --performative assert elephant log -t rootclaim-grounded --signer did:crdt:... --sid s-... ``` `theory list` could retain its compact total while `theory inspect` reports: ```text journal entries 53 active assertions 41 retracted assertions 6 retractions 6 active content 38 ``` If `active content` requires a product-specific definition, omit it or expose the meta/member count separately rather than guessing. ### Acceptance criteria - Text and JSON distinguish journal totals, active assertions, retracted assertions, and retraction entries. - Counts are derived from the same status semantics as `log` and remain deterministic after merge/restart. - `log` filters support signer, status, performative, SID/entry ID, and retraction target; filters compose with AND semantics. - Empty matches are valid structured results, not parse errors. - Tests cover a mixed two-signer journal with multiple retractions. ### Environment / evidence Observed with Elephant 0.1.2. The 53-entry signed journal is retained here: https://github.com/anuna-cooperative/flf-elephant-experiment/blob/96ca63675edd88cf4982449c5f78b9441c320a39/runs/2026-07-16/grounded-machineB/log.json
hugooconnor commented 2026-07-16 09:44:53 +00:00 (Migrated from codeberg.org)

Addressed in PR #28 (branch fix/cli-convergence-observability).

Addressed in PR #28 (branch `fix/cli-convergence-observability`).
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#22
No description provided.