Skip to content

Flight recorder 4/5: retention + Sharingan.configure() (public knob) #52

Description

@mibrahimdev

Part of the flight-recorder persistence epic — design: docs/superpowers/specs/2026-08-21-flight-recorder-persistence-design.md, discussion #27. Sequenced after #51.

Deliverable

After this slice: old sessions auto-purge and the consumer can tune how many are kept. The one public method of the whole epic lands here.

Scope

  • Public Sharingan.configure(persistence: Boolean = true, maxSessions: Int = 50, persistBodies: Boolean = false). persistBodies is wired but its effect ships in slice 5.
  • maxSessions clamped to a runtime device/storage-derived ceiling.
  • On new-session creation, purge oldest sessions beyond the limit (cascade-delete events). This is what the closed Expose Sharingan.configure(capacity) for store capacity (HITL — public API decision) #18 capacity knob was deferred to become.
  • Noop obligation: mirror configure() as an empty no-op in sharingan-noop, run ./gradlew apiDump, commit all four .api/.klib.api dumps, confirm checkApiParity green (per docs/api-parity.md).

TDD / acceptance

  • RED→GREEN: creating session N+1 with maxSessions=N purges the oldest and its events (retention math).
  • maxSessions above the device ceiling is clamped, not honored verbatim.
  • checkApiParity green with the new public method mirrored in noop.
  • Intentionally diverging the noop (drop configure) is shown to fail the parity check.

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions