feat(cli, conversation): Support verbatim summaries in compaction - #932
Open
JeanMertz wants to merge 3 commits into
Open
feat(cli, conversation): Support verbatim summaries in compaction#932JeanMertz wants to merge 3 commits into
JeanMertz wants to merge 3 commits into
Conversation
`jp conversation compact --summary TEXT` now stores TEXT verbatim as
the summary and calls no model, instead of passing it as extra
context to the summarizer. Bare `--summary` still generates one.
Guidance for the generator moves to a new `--summary-context TEXT`
flag, which applies to whichever rules are active in the invocation
(configured or ad-hoc) rather than defining a rule of its own, e.g.:
jp conversation compact --summary-context "focus on the architecture"
jp conversation compact --summary "we settled on the layered loader"
The `--summarize` flag and DSL policy are renamed to `--summary` /
`s`/`summary` for consistency with the new verbatim behavior; the
`summarize` DSL spelling still parses so existing specs keep working.
Every stored summary now records whether its text was generated by a
model or authored by the user (`SummaryPolicy::source`). Generated
summaries can be re-derived over a wider range by asking the model
again; authored text cannot. When compaction would otherwise have to
grow a summary's range across authored text, either widening it or
overwriting it, JP now refuses and reports the exact range that would
resolve the overlap, e.g.:
Summary overlap
A summary cannot be nested inside or split across another one, so
your text for turns 1..4 would have to stand in for turns 1..6 as
well.
Re-run with `--from 1 --to 6` to cover the whole range, or
`jp conversation compact --reset` to drop the existing compactions
first.
Compactions written before this change have no `source` field and load
as `Generated`, so existing conversations are unaffected. The timeline
preview (`--dry-run`) and the real run now share the same overlap
check, so a preview never promises a compaction the run would refuse.
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
jp conversation compact --summary TEXTnow stores TEXT verbatim as the summary and calls no model, instead of passing it as extra context to the summarizer. Bare--summarystill generates one. Guidance for the generator moves to a new--summary-context TEXTflag, which applies to whichever rules are active in the invocation (configured or ad-hoc) rather than defining a rule of its own, e.g.:The
--summarizeflag and DSL policy are renamed to--summary/s/summaryfor consistency with the new verbatim behavior; thesummarizeDSL spelling still parses so existing specs keep working.Every stored summary now records whether its text was generated by a model or authored by the user (
SummaryPolicy::source). Generated summaries can be re-derived over a wider range by asking the model again; authored text cannot. When compaction would otherwise have to grow a summary's range across authored text, either widening it or overwriting it, JP now refuses and reports the exact range that would resolve the overlap, e.g.:Compactions written before this change have no
sourcefield and load asGenerated, so existing conversations are unaffected. The timeline preview (--dry-run) and the real run now share the same overlap check, so a preview never promises a compaction the run would refuse.