Skip to content

Type LCM summary inputs and compression policy - #4351

Open
ScriptedAlchemy with Copilot wants to merge 11 commits into
masterfrom
copilot/simplify-lcm-replace-json-in-route-summary
Open

ScriptedAlchemy with Copilot wants to merge 11 commits into
masterfrom
copilot/simplify-lcm-replace-json-in-route-summary

Conversation

Copilot AI commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replace JSON encoded inside summary routes with typed route and extraction fields.
  • Unify LCM compression outcomes, authority, and policy overrides while preserving persisted metadata and flat request JSON.

Motivation

The route envelope supported two input grammars and could silently reinterpret malformed extraction data as a route. The coordinated LCM changes remove that ambiguity and consolidate related policy and authority paths.

Changes

  • Summary input: Provided carries a route and optional LcmExtractionResult directly; remove the envelope parser and migrate producers and fixtures.
  • Outcomes and authority: Use typed internal compression outcomes and registered-store authority; preserve public response fields and existing commit safeguards.
  • Overrides: Share one typed value across compression and preflight requests, flattened to retain the existing JSON keys.
LcmSummarizerMode::Provided {
    summary_text,
    route,
    extraction_result,
}

Test plan

  • The affected Bazel targets pass — blocked before test execution because Bazel could not resolve releases.bazel.build.
  • bazel build //... passes when the change crosses package boundaries
  • Tested manually (describe below if applicable)

Checklist

  • CHANGELOG.md updated (under [Unreleased] if no version bump)
  • No secrets, credentials, or .env files included
  • Breaking changes documented (if any)

@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e096648

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI linked an issue Oct 19, 2026 that may be closed by this pull request
5 tasks
Copilot AI changed the title [WIP] Simplify lcm by replacing JSON-in-route summary metadata with typed input Type LCM summary inputs and compression policy Oct 19, 2026
Copilot AI requested a review from ScriptedAlchemy October 19, 2026 04:26
@ScriptedAlchemy
ScriptedAlchemy force-pushed the copilot/simplify-lcm-replace-json-in-route-summary branch from abd3ded to 247a385 Compare October 20, 2026 22:42

@ScriptedAlchemy ScriptedAlchemy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-referenced #4296, #4297, #4298, #4300 and #4305. The typed input/policy migration has one concrete outcome-preservation regression: the existing forced-overflow producer emits a successful response that the new take_outcome rejects. This needs correction before merging; the precise producer and retained transaction path are described inline. This finding is from source/caller tracing, not a completed native test run.

reason: self.reason.clone(),
})
}
(false, None, None) => Ok(LcmCompressionOutcome::Complete),

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Preserve the valid critical-pressure completion outcome

This match rejects a response the existing compression producer intentionally emits: persist_and_replay_backlog_compression (compression.rs:948-960) returns status ok/best_effort, summary_request=None and retry_status=Some("critical_pressure_catch_up") after forced overflow recovery. take_outcome now treats that combination as invalid. lcm_compress_retained_page_guarded calls take_outcome before committing its transaction, so a retained request with forced-overflow pressure is refused/rolled back despite successful compression. The default convergence worker currently sets current_tokens=None, so this is specific to pressure-bearing requests. Represent the critical-pressure completed state explicitly or admit its existing retry marker while preserving wire fields, and add coverage for both ok and best_effort forced-overflow results through the typed conversion/retained entry point. This is part of #4298's requirement to preserve all existing outcomes.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in e5aae67. The typed conversion accepts the valid critical-pressure completion for both statuses and preserves all wire fields. Added a registered retained-pressure recovery test that reopens the store and checks the committed summaries, plus a full response round-trip assertion. Formatting passes; leaving this thread open until native CI validates the new coverage.

@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review October 21, 2026 00:46

@ScriptedAlchemy ScriptedAlchemy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed e5aae67 to address the pressure-recovery regression found in review. take_outcome() now accepts completed ok and best_effort responses carrying critical_pressure_catch_up, while malformed authoritative-summary states still fail. Added full wire-response round-trip coverage and a registered retained-pressure recovery regression that reopens the store and verifies summaries were durably committed for both statuses.

Pinned CI rustfmt and git diff --check pass. Native tests have not run locally because this environment exhausted memory on the repository's native dependency build; CI is the execution authority. Marked this PR ready for review because draft PRs explicitly skip the heavy native lane. Relevant coverage is in the LCM unit tests and session-runtime lcm_effects tests. This is an implementation update, not a merge or approval.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

This branch has not been deployed

No deployments
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.

simplify(lcm): replace JSON-in-route summary metadata with a typed input

2 participants