Skip to content

A ledger-folded payload gets an omitted-count on top of folds that already account for all of it, and a [Partial signal] banner over a complete answer #775

Description

@fajarhide

Bug Description

On a payload the ledger has folded, the trailing banner block makes two false claims about
completeness. Both fire on the same command, and both are the "false claim" class from
CONTRIBUTING.md rather than lost signal: nothing is missing, the output says otherwise.

1. The omitted-count is added on top of folds that already account for the whole input.
The ledger markers plus the surviving lines sum to the entire payload, and then a further
[OMNI: N ... omitted, ... for full output] line claims more was cut. Summing what the
output states gives more lines than the command produced.

2. [Partial signal] on an output where nothing was lost. Same shape as #335, which
fixed it for the grep restructure. The guard at src/hooks/post_tool.rs:945 is
distilled_lines <= content.lines().count(), which a ledger fold passes trivially,
because folding always lowers the line count.

Steps to Reproduce

git log --oneline -40 in this repo is 40 lines, 3,238 bytes. Run it twice so the ledger
has something to fold.

Through the post-hook, second run:

[OMNI: 25 lines identical to an earlier run, omni retrieve 809993a8233d63f7]
f06a101 test(bench): resolve headroom from the command, and fail when a named arm is silent (#730)
[OMNI: 14 lines identical to an earlier run, omni retrieve c7c1d5a32e077257]
[OMNI: 1 bytes omitted, omni retrieve 6e784bc201bed9c1 for full output]

25 + 1 + 14 = 40, the whole input, before the fourth line claims anything. (1 bytes
also disagrees with itself on plural.)

Through omni exec, isolated OMNI_DB_PATH, second run:

b12235d test(hooks): say what the Codex arm does not prove
...
f06a101 test(bench): resolve headroom from the command, and fail when a named arm is silent (#730)
[OMNI: 14 lines not shown here, omni retrieve c7c1d5a32e077257]
[Partial signal]

26 printed + 14 folded = 40. Nothing was omitted, and the banner says the signal is partial.

The count also moves between runs of byte-identical input. Twice through the installed
post-hook in one session, the same 40 lines, with the ledger markers summing to 40 both
times:

run 1: [OMNI: 27 lines omitted, omni retrieve 9de61c2903b1d433 for full output]
run 2: [OMNI: 36 lines omitted, omni retrieve 9de61c2903b1d433 for full output]

Handles resolve correctly in every case, so #388 has not regressed. 9de61c2903b1d433
returns all 40 lines and 3.2 KB.

Expected Behavior

The line numbers a reader can sum should not exceed the input, and a payload that lost
nothing should carry no [Partial signal].

Context

omni 0.7.9 (homebrew), macOS 15 / darwin 25.5.0, Claude Code. Evidence is this repo's own
git log, so nothing is redacted.

Relevant Logs

rewind_marker (src/hooks/post_tool.rs:172) computes
omitted_lines = input_lines - kept_lines, and its doc comment at :166 says kept_lines
describes what the distiller produced. The ledger runs after distillation and rewrites the
output, so the banner's figures and the ledger's markers measure two different stages of the
same payload and land in one blob with nothing telling them apart.

What I did not trace: why the count reads 27 then 36 for byte-identical input. A figure taken
from the distiller alone should be stable across both runs, so on that path something is
reading the count after the ledger. That variance is the part to chase, and I would not fix
this from the doc comment's intent alone.

Why it matters

An agent reading the git log output sums the markers and concludes 67 or 76 lines existed
where 40 did, and [Partial signal] tells it to retrieve or re-run a command that already
returned everything. Both cost a round trip on a complete answer.

How this differs from #767

#767 is about what a fold marker says, the wording a reader stops on, and it is blocked on
#766. This is the arithmetic: the numbers are wrong and mutually inconsistent whatever wording
carries them. Fixing #767's sentence would leave both claims here false.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugBehaves differently from what it documents or intendspriority: mediumNarrower lost signal / accounting layerstage: nowDesign is settled and it fits one PR

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions