Skip to content

[MM-06] Make semantic compact validation fail closed #785

Closed

Description

@bug-superman

MM-06: Make semantic compact validation fail closed

Parent

#771

Checkpoint

MC-1B Compact safety

What to build

Reject malformed, source-free, structurally invalid, or economically negative semantic compact output before it can replace original messages.

Acceptance criteria

  • Invalid summaries retain original messages.
  • A compact result must preserve required source references and provider message structure.
  • Compaction must meet the configured minimum savings.
  • Failure returns typed diagnostics and cannot report replaced.
  • Current user and required tool pairs remain intact.

Required tests

  • Malformed summary
  • missing source refs
  • negative/zero savings
  • tool/thinking pair validation
  • summarizer timeout

Benchmark

Replay semantic-compact fixtures and the continuity compact subset; candidate must have zero invalid replacements.

Operator-owned benchmark evidence remains pending and is not a product dependency.

Blocked by

Rollout and rollback

Disable semantic compact and retain deterministic/history compact paths.

Activity

  1. bug-superman commented on Jul 13, 2026

    @bug-superman
    Author

    MM-06 code contract is complete in commit 16c9a81e.

    Implemented:

    • malformed, private-verifier, source-invalid, provider-shape-invalid, and economically negative compact output now returns failedOpen and retains the original messages
    • typed maka.semantic_compact_failure diagnostics with stable stage/reason/retryability
    • exact source-ref, coverage, session, hash, archive, and duplicate validation
    • current-user preservation plus tool-call/result and signed-thinking structure checks
    • real timeout enforcement even when a summarizer ignores abort
    • semantic selection can compact around, but never replace, the current user message
    • zero/negative provider or net savings are rejected even when configured thresholds are zero

    Validation:

    • focused semantic compact suite: 13 passed, 0 failed
    • focused semantic compact + AI SDK backend files: passed
    • runtime suite under Node 24: 1335 passed, 0 failed, 2 skipped
    • full workspace npm test under Node 24: passed; desktop 2364/2364
    • full workspace npm run typecheck: passed
    • post-review focused tests and runtime typecheck: passed
    • git diff --check: passed
    • Standards review: PASS
    • Spec review against [MM-06] Make semantic compact validation fail closed #785: PASS

    The continuity compact benchmark remains operator-pending and will be recorded separately.

  2. Astro-Han commented on Aug 2, 2026

    @Astro-Han
    Contributor

    Superseded by #1615 (automatic long-term memory lifecycle, SQLite-based; accepted by maintainers 2026-07-30, PR ① #1770 merged). This MM-06 work item never landed outside draft PR #820 and is replaced by the #1615 design and its LongMemEval/MSC evaluation plan.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions