Skip to content

feat(pi): add Memory Changes and Stats tools - #1633

Merged
Teingi merged 2 commits into
oceanbase:masterfrom
wutongyuonce:feat/pi-memory-changes-stats
Sep 17, 2026
Merged

Teingi merged 2 commits into
oceanbase:masterfrom
wutongyuonce:feat/pi-memory-changes-stats

Conversation

@wutongyuonce

Copy link
Copy Markdown
Contributor

Summary

Add two native read-only Pi tools to expose existing PowerContext operations:

  • pc_memory_changes → list_memory_changes, with an optional non-negative exclusive since_revision cursor.
  • pc_stats → get_stats, with an optional today, 7d, or 30d period (default 30d).

Design: plan and final implementation

The plan was to expose the existing generated operations without adding a second transport or state layer, while keeping Scope resolution authoritative in the shared Pi invoke path. The final implementation follows that plan:

  • TypeBox schemas are closed and aligned with the OpenAPI input limits.
  • list_memory_changes receives the resolved current Scope through scopeMode: current.
  • get_stats accepts only the period at the Pi boundary; its scopeMode: selection metadata causes the shared invoke layer to replace any selection with the resolved exact Scope. This keeps the native tool current-Scope-only and prevents caller-supplied cross-Scope selection.
  • Both tools are read-only: they are not in WRITE_OPERATIONS, require no confirmation, create no durable state, and do not alter profile capabilities.
  • Returned history and statistics remain untrusted observations. No response transformation or new caching was added.
  • Pi guidance, the project-context Skill, the capability manifest, and English/Chinese integration docs describe the same boundary.

Non-goals

  • No new slash command; /pc stats already exists.
  • No cross-Scope stats query from native Pi tools.
  • No profile promotion or changes to the server operations/OpenAPI.

Verification

  • Pi tests: 14 files, 98 tests passed.
  • TypeScript typecheck passed.
  • Integration manifest tests: 28 passed.
  • integration_manifest.py --check passed.
  • ty check passed.
  • git diff --check passed.
  • GPT-5.6 Luna medium read-only review found no actionable issues.

Implementation and verification used Codex with GPT-5.6 Sol; the separate Luna review was read-only.

Refs #1338

@Teingi
Teingi merged commit 037dc2f into oceanbase:master Sep 17, 2026
22 checks passed
@wutongyuonce
wutongyuonce deleted the feat/pi-memory-changes-stats branch September 17, 2026 03:31
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