Skip to content

feat(integrations): enforce pre-compaction lifecycle contracts - #2180

Open
beatenevo wants to merge 9 commits into
oceanbase:masterfrom
beatenevo:feat/quality
Open

beatenevo wants to merge 9 commits into
oceanbase:masterfrom
beatenevo:feat/quality

Conversation

@beatenevo

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Closes #2068.

Rationale for this change

Agent Host integrations previously lacked a precise, enforceable definition of pre-compaction capture support. This made capability claims difficult to validate and allowed host adapters to expose lifecycle behavior without consistent acknowledgement, retry, identity, evidence, or failure semantics.

This change defines explicit lifecycle support modes and provides executable conformance coverage for integrations that claim pre-compaction capture support.

What changes are included in this PR?

  • Upgrade the integration manifest to schema v2 with explicit lifecycle modes:
    • unsupported
    • best_effort
    • required_capable
  • Validate lifecycle capability declarations, evidence files, tool surfaces, and required-mode opt-in configuration.
  • Declare lifecycle support modes for all maintained Agent Host integrations.
  • Implement best-effort pre-compaction capture for OpenClaw and Pi.
  • Bind flush acknowledgement to the exact captured Source position.
  • Preserve pending positions across failures and cancellation, clearing them only after durable acknowledgement.
  • Add canonical lifecycle event identities and duplicate-delivery handling.
  • Add bounded, priority-aware lifecycle flushing for OpenClaw closing hooks.
  • Add strict flush response validation and content-free, fail-safe diagnostics.
  • Add a shared data-driven conformance fixture executed from the native OpenClaw and Pi test suites.
  • Cover duplicate delivery, scope isolation, cancellation, malformed responses, extraction unavailability, shutdown behavior, and fail-open host behavior.
  • Generate and update English and Chinese integration capability documentation.

Are there any user-facing changes?

Yes.

Integration capability documentation now distinguishes unsupported, best-effort, and required-capable pre-compaction behavior. OpenClaw and Pi explicitly advertise best-effort lifecycle support.

There are no breaking changes to the PowerContext Server API. Integrations that later claim required_capable must provide focused implementation, documentation, tests, and an explicit opt-in mechanism.

How was this change tested?

  • PYTHONPATH=scripts uv run pytest tests/test_full_capability_docs.py tests/test_guidance_generation.py tests/integration_conformance tests/test_integration_manifest.py -q
    • 108 passed
  • uv run pytest tests/test_system_cli.py tests/test_release_version.py tests/test_integration_guidance_evaluation.py
    • 176 passed, 2 skipped
  • OpenClaw test suite with Node 24.15.0
    • 89 passed
  • Pi test suite
    • 120 passed
  • OpenClaw and Pi TypeScript type checks
    • passed
  • uv run prek run -a
    • passed
  • git diff --check
    • passed

AI usage statement

OpenAI Codex was used to assist with implementation, test development, documentation updates, and review-driven fixes. The resulting changes were validated with the repository checks and integration-specific test suites listed above.

@AlexStocks AlexStocks added the 1.4.1 v1.4.1 release tracking label Oct 21, 2026

@hidb4ai hidb4ai 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.

One P2 remains: lifecycle deadlines exclude queue waiting. Details and reproduction are inline.

Comment thread integrations/pi/plugins/powercontext/src/flush.ts Outdated

@hidb4ai hidb4ai 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.

The queue-wait deadline issue is fixed. One acknowledgement regression remains; details inline.

Comment thread integrations/pi/plugins/powercontext/src/flush.ts Outdated
# Conflicts:
#	docs/en/docs/integrations/capabilities.md
#	docs/zh/docs/integrations/capabilities.md
Comment thread integrations/openclaw/plugins/memory-powercontext/src/lifecycle.ts Outdated

@hidb4ai hidb4ai 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.

One acknowledgement issue remains under concurrent Source capture; details inline.

Comment thread integrations/pi/plugins/powercontext/src/flush.ts Outdated

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

1.4.1 v1.4.1 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(integrations): qualify pre-compaction checkpoint durability and failure semantics

4 participants