Skip to content

feat(cli, conversation): Support verbatim summaries in compaction - #932

Open
JeanMertz wants to merge 3 commits into
mainfrom
compact-summary-value
Open

feat(cli, conversation): Support verbatim summaries in compaction#932
JeanMertz wants to merge 3 commits into
mainfrom
compact-summary-value

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

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.

`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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant