@henkaku-center/jsonl-reduce
v0.2.0
Published
Generic JSONL session-log reduction engine (Pi v3 dialect first)
Readme
jsonl-reduce
Generic JSONL session-log reduction engine for Chi Commons and future session-log dialects.
The MVP implements portable Pi v3 JSONL first, while keeping the API ready for additional dialect adapters later. This package is intentionally not Chi- or Pi-UI-specific: it owns reduction contracts, deterministic field algebra, model text compression boundaries, lineage, fixtures, and tests.
A canonical title is produced by a separate bounded model call over the reduced semantic summary, normalized to one line, and clamped at a 60-character word boundary without ellipses. A runtime may project that title into its active source session using an adjacent session_info plus chi.commons.projected_title marker. The Pi-v3 adapter mechanically excludes that marked pair from semantic hashes, source coverage, and counts so a generated title never feeds back into its next reduction.
Chi mention markers (chi.messaging.mentions) use an explicit deterministic field reducer. Reduced metadata contains a sparse, content-free mentions index with exact actor, recipient, timestamp, session, and entry references; message text remains only at z=0. Mixed reductions deduplicate by source coordinate and recipient and reject conflicting evidence.
assembleSelection(slices) is the overlap-safe composition boundary for raw and reduced inputs. It validates explicit causal entry order, re-mints placement IDs into a fresh machine-neutral Pi session, provides a synthetic-ID → source refMap, inherits exact raw coverage from reduced artifacts, and refuses intersecting coverage before reduction. Passing the assembled value to jsonlReduce imports a prior artifact's exact aggregate once while using its summary plus uncovered raw entries as semantic input.
See MVP_PLAN.md.
