Skip to content

aegis-hxb: episode-scoped logical retraction endpoint (RECOVERED from obsidian)#33

Merged
scbrown merged 1 commit into
mainfrom
aegis-hxb-episode-retract
Jun 30, 2026
Merged

aegis-hxb: episode-scoped logical retraction endpoint (RECOVERED from obsidian)#33
scbrown merged 1 commit into
mainfrom
aegis-hxb-episode-retract

Conversation

@scbrown

@scbrown scbrown commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Recovered WIP from polecat obsidian, which died mid-task on aegis-hxb. Work was complete + committed (8853c84) on a self-named branch but UNPUSHED — preserved by mayor during a lifecycle-recovery check.

Implements POST /episode/retract per the aegis-hxb spec: logical (not physical) episode-scoped retraction via the bitemporal valid_to close, idempotent, shared-IRI-safe (source=episode:{name} tx tagging).

⚠️ REVIEW GATES before merge:

  • SECURITY (sentinel): touches http_auth::WRITE_ENDPOINTS + auth gating — same class as bo-oqny; needs sentinel sign-off on the auth path (commit notes it must require an authorized principal once hq-azs/hq-otm land).
  • TEST COVERAGE: aegis-hxb AC requires tests proving episode facts leave current queries while entities + other-episode facts + cord history survive — verify these exist/pass before merge.

Original obsidian polecat is dead (worktree lost .git); safe to nuke now that this is preserved.

Surface the bitemporal store's internal retraction path over HTTP, scoped
to a single episode. `POST /episode/retract` (MCP `quipu_retract_episode`)
retracts every currently-active fact an episode's ingest contributed —
activity node, generated entities, edges, and reified statements — by
closing their `valid_to` via `Op::Retract`. Logical, not physical: facts
stay in history and `/cord` time-travel still shows them.

The retraction unit is the episode's ingest transaction(s), identified by
their `source = "episode:{name}"` tag. Combined with idempotent assertion
(one owning tx per active fact), this is shared-IRI-safe: retracting an
episode only removes what that episode actually wrote; entities and other
episodes' facts about the same IRIs survive. Idempotent: re-retracting or
retracting an unknown episode is a no-op.

- Store::retract_episode -> (tx_id, Vec<Fact>)
- tool_retract_episode + lib export + /episode/retract route
- /episode/retract added to http_auth::WRITE_ENDPOINTS (read-only + bearer
  gated like other writes today; doc notes it must require an authorized
  principal once hq-azs scopes + hq-otm identity land)
- tests: scoped isolation, history preservation, idempotency, unknown
- docs: rest-api, mcp-tools, design note + first-use goldblum cleanup runbook

First production use (separate goldblum deploy step on kota) is to prune the
goldblum-{deploy,confidence,final}-verify-032 test episodes; runbook in
docs/design/episode-retraction.md. Live kota store not touched here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KVrn2WTprA5zbpPTP7nX3d
@scbrown
scbrown merged commit 804b750 into main Jun 30, 2026
10 checks passed
scbrown added a commit that referenced this pull request Jul 14, 2026
Louvain community detection (#31), live graph report + quipu_report tool (#32),
episode-scoped retraction (#33), and --base-ns/--timestamp CLI flags (#34).

Manual release: release-plz's release-pr step is blocked by the repo's
"Actions may not create PRs" setting (403); cutting the tag + GitHub release by
hand per the established fallback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VsuPDxSUjMYqHvQyPvSAPW
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