Skip to content

D155 slice 4: activate corpus folders with delete, forget and restore - #610

Merged
fazpu merged 8 commits into
mainfrom
feat/corpus-activate
Nov 13, 2026
Merged

fazpu merged 8 commits into
mainfrom
feat/corpus-activate

Conversation

@fazpu

@fazpu fazpu commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Activates D155's live corpus publisher together with normal deletion, hard-forget and restore replay. Originals and reader derivatives are copied into document folders; ordinary work updates only recorded folders and affected navigation. Snapshot generation and the local snapshot-mount materializer are removed.

  • Publication and digest-verifying reconcile run through the existing unlaned work ledger, self-host class claims and D147 pushed tasks. Verification defaults to 24 hours (REMEMBERSTACK_SELFHOST_CORPUS_VERIFY_INTERVAL_S); no scheduler or coordination tables are added.
  • Normal API deletion waits for folder removal/navigation repair. Failures report failure and retain a transactional retry event.
  • Forget unions recorded paths with mandatory suffix discovery, including upload-only and delete-marked retained objects, erases only that document, purges source-bearing index history, regenerates navigation from scrubbed authority, and clears friendly paths. Survivor originals/media receive no delete/replacement requests.
  • Controlled sessions acknowledge quiescence and cache erasure. Startup re-arms every portable manifest, including complete ones, before replay; errors keep admission closed. Publication holds the existing D74 admission fence and publication lock on independent sessions, so loss of either session still makes forget wait for already-issued IO to return. Complete database-session loss retains D74's external-write quiescence requirement.
  • Readiness checks each requested served version's nullable digest marker; global snapshot timestamps are null. No converter, chunking, Selection, Claimify, embedding or text-origin reuse identities change.

Verification

  • Full unit suite: 3,517 passed, 11 skipped. Seven skips require PostgreSQL and passed in the database run; four require unavailable LibreOffice.
  • Affected database suites and real MinIO matrix, run sequentially in one process on the requested PostgreSQL database: 385 passed, 2 expected failures. Covers lifecycle/reuse/text origin, processing/work ledger/migrations, both profiles, public API deletion/readiness, forget catalog, E0–E3, storage/publication/lock loss, and forget/restore. The two expected failures name the existing D122 cross-section Claimify-window gap; no reuse identity changes are introduced.
  • After the independent-session drain refinement, the full publisher/readiness/MinIO rerun passed 109 tests. A final targeted rerun after resource-cleanup edits passed 15 tests. These overlap the broader suite rather than adding to its count.
  • Real-store cases include bucket-only, DB-only and combined restores, retained versions/delete markers, failed deletes/multipart abort/quiescence/cache acknowledgements/index repair/verification, delayed work, either-session loss during issued IO, and zero survivor object mutations. Mountable multipart listing still records provider_managed on HTTP 501.
  • Ruff check and format passed (752 files); Pyright reported 0 errors/warnings; 5 import contracts kept. Test inventory: 176 unit / 94 integration / 270 discovered files.
  • Generated-artifact freshness passed using generators only: OpenAPI, TypeScript contracts/parity/client, documentation diagrams and llms exports, plus documentation truth checks. The D143 operations fixture was regenerated through its capture generator.

Deviations and scope

The requested MinIO startup script verified its pinned download but found an already-running container with its expected name. Tests reused that healthy local MinIO instance at 127.0.0.1:59000; no alternate storage implementation or test skips were used. There are no implementation-scope deviations. Public docs ship in this PR; consumer path/tooling and benchmark attestation remain slice 5, and managed mount CLI/tickets and credentialed endpoint qualification remain slice 6.

Managed companion integration

No changes are made to writeitai/ultimate-memory-cloud. Before managed activation it must:

  1. Qualify the new engine pin for reconcile_corpus and hard-forget delivery. runtime/src/umc_runtime/cloud_tasks.py::task_class_of already routes every non-convert stage to llm, and CloudTasksAnnouncer already preserves future not_before as scheduleTime; no class-map rewrite or scheduler is needed. runtime/src/umc_runtime/setup.py::run_setup currently builds the profile without a task queue, so wire the existing EngineAnnounce into bootstrap/policy seeding for immediate initial announcements (the existing sweeper.py janitor still recovers lost due delivery). Carry configurable corpus_verify_interval_s through tenant settings when overriding the inherited daily default.
  2. In the context construction path (runtime/src/umc_runtime/tenants.py::build_context / runtime.py's context-cache builder, plus shared API composition), run profile.hard_forget().ensure_ready() before exposing a restored context or mount, including locally complete manifests. Supply the new corpus_caches capability to stop sessions, drain external writes, purge document caches and verify acknowledgement. Keep sessions closed until the whole batch replays. Compose k_git and knowledge_rebuilder capabilities when K history is configured.
  3. Update the native storage-capture contract consumed by runtime/src/umc_runtime/storage_capture_profile.py::managed_capture_profile. Its engine helpers (rememberstack/spine/storage_capture_catalog.py, profiles/storage_capture_profile.py, profiles/managed_storage_capture.py) still classify P3 via projection_snapshots.gcs_uri / corpus.unpublished_snapshot. A separately reviewed capture follow-up must use live documents.corpus_paths, publication/input identity and physical keys, distinguish hot document copies/navigation from incomplete or orphan copies, count corpus originals separately from canonical raw originals, and regenerate schema/classification/native-profile digests and qualification fixtures. Until then capture must fail closed; managed rollout must not claim the snapshot-only classifier supports the new tree. Mountable's unsupported multipart listing retains provider_managed coverage.

These are companion integration requirements, not hidden correctness mechanisms or changes to the cloud repository. The cloud implementation was inspected read-only to distinguish existing support from work actually needed.

Contributor agreement

Signing on behalf of a legal entity (leave blank if accepting individually):

@fazpu
fazpu marked this pull request as ready for review November 13, 2026 18:35
@fazpu
fazpu merged commit e3065f1 into main Nov 13, 2026
19 checks passed
@fazpu fazpu mentioned this pull request Nov 14, 2026
1 task done
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