Skip to content

Finish tenant-owned document cleanup and live consumer qualification #48

Closed as not planned

Description

@sarthakagrawal927

Paused by owner — 12 September 2026

The owner chose to stop this readiness pass and continue this product later. Keep the unfinished requirements open; exclude this issue from the immediate queue.

Resume with: Authenticated live document qualification and separately controlled owned-storage migration/activation.

Remove the queue: excluded label and unarchive the project card when work resumes. Product lifecycle and deployment are unchanged.

Current queue disposition — 11 September 2026

The tested protected indexing/search core is accepted. Owned-file activation, tenant isolation and broader consumer rollout remain qualification gates.

This remains an open repository backlog issue. Its outstanding acceptance criteria are not marked complete. The owner-approved minimum-use review has moved it out of the immediate project queue; the original requirements below and existing README references are preserved. To resume, remove queue: excluded and unarchive the project card.

Private shared retrieval infrastructure; this is not an anonymous upload/search product.

Completed source/local proof (98181c0):

  • Default legacy-path guard rejects known shared raw/hash deletion before mutations; parse reads require tenant ownership. This guard remains non-atomic with concurrent legacy ingestion.
  • Additive file ownership/operation/artifact ledger and publication/visibility schema in migrations 0008/0009. Immutable owner/file raw keys; generation-scoped parse/document/vector identity; retained tombstones and conditional D1 publication.
  • Internally gated integration across upload, text, records, queue/reprocess, inferred upload, imported-file persistence, registration/copy and source-set deletion. Structured fields, provenance, relationship/backfill and citations derive from surviving evidence. Generic routes cannot overwrite/delete owned resources.
  • Actual SQLite migrations/transactions plus real Hono handlers: 23 synthetic ownership tests cover same-content tenants/domains, legacy read compatibility, raw/parse/vector interleavings, retries, uncertain writes, asynchronous vector visibility, independent physical cleanup, durable cross-handler cache invalidation, structured evidence restoration and retained-history source denial.
  • Full local pnpm quality: 387 Worker tests, six dashboard tests, builds/typechecks/docs and all configured code-health gates. No baseline increase or new dependency.

Remaining requirements:

  • Review rollout before enabling the internal protocol. Production still uses the legacy path; no production configuration switch was added. Shared legacy records do not yet support safe independent physical deletion.
  • Implement and locally prove explicit legacy inventory/copy/backfill: drain old writers, copy/verify bytes into owned keys, rebuild per-file indexed/parse provenance, and validate before publication. Retain shared legacy objects until a separate zero-reference garbage-collection review.
  • Implement operational reconciliation for abandoned/uncertain external writes. Running operations never expire or get stolen; elapsed time cannot establish settlement. Such deletion remains truthfully 202/pending.
  • Separately authorize production schema/backfill/activation and verify actual D1/R2/Vectorize binding convergence.
  • Authorized live synthetic consumer workflow: upload, cited query, reopen, tenant denial and cleanup. Signed-in operator dashboard remains unverified.

Deletion removes indexed file artifacts; saved conversations, query traces and coordination/shared identity metadata persist. Responses explain this in plain language. Historical citations cannot fetch deleted files/parse artifacts or republish removed evidence into new queries in the local tests.

Receipts and limitations: docs/development/document-workflow-qualification-2026-09-07.md. Provider bindings/embeddings are deterministic synthetic fixtures; no live retrieval-quality claim. No production migration, backfill, activation, deployment, hosted upload, credentials or provider/model calls were performed. Keep this issue open through the remaining migration/recovery/live gates.

Legacy inventory implementation — 8 September

Before copy/backfill, add an offline, read-only SQLite inventory command over an explicitly supplied complete D1 snapshot. It must retain tenant/file identity, identify shared raw/hash references across scopes, propose distinct owned raw keys, report existing lifecycle and unresolved writer state, and never infer ownership from a key prefix. No provider calls, schema changes, copy, publication or deletion are part of the inventory command. Snapshot metadata cannot prove writer drain, raw-byte integrity or provider convergence.

Scenarios: identical content across tenants/domains remains separate; v2-looking keys without a matching ledger remain blocked; queued/running/unknown ingest states and running operation intents remain unresolved regardless of age; absent ownership migrations remain explicit; unknown project input fails rather than producing a reassuring empty report. Test against the actual migrated SQLite schema and verify the CLI leaves the input file unchanged.

  • Add read-only scoped inventory with cross-scope reference counts and explicit limitations.
  • Prove inventory and unchanged input with real SQLite fixtures.
  • Run full repository quality and exact-source CI. Local quality passed at 3bff4e9: 391 Worker tests, six dashboard tests, builds/typechecks and unchanged code-health gates. Quality CI 34220990487 and docs CI 34220990555 passed. Checkout is clean on main; temporary branch and test fixtures are cleaned up.

This completes only inventory preparation. Byte-copy validation, provenance rebuild, durable backfill publication and external-write reconciliation remain required before activation.

Verified offline raw-copy staging

Continue inventory with an explicit local snapshot/object-export staging command. Verify recorded SHA-256 and byte count before copying; create separate immutable artifacts for each proposed owned R2 key; reread outputs and produce a deterministic manifest. Use hashed local filenames for R2 keys so dot segments, slashes or encoded identity cannot alias filesystem destinations. Reject escaping or non-file source paths, symlink destinations, hash/size mismatch, conflicting output and unresolved inventory state. Retain the complete source export. Retry identical output idempotently. No provider calls, database updates, provenance publication or legacy garbage collection.

  • Implement verified raw staging and manifest with exclusive output writes. Pushed as 4562c71.
  • Exercise distinct tenants, source corruption, unsafe paths, existing output conflicts and retry with actual temporary bytes, including the real CLI. Source bytes and SQLite remain unchanged; temporary fixtures are cleaned after tests.
  • Full local quality and exact-source CI. Local gate passed 395 Worker and 6 dashboard tests, builds/typechecks and unchanged code-health thresholds. Quality CI 34221819695 and docs CI 34221819621 passed. Checkout clean on main; temporary branch removed and validation artifacts archived.

Staging is a prerequisite, not migration completion. Live copy/verification, writer drain, parse/indexed provenance rebuilding and atomic publication remain necessary.

Live browser refresh — 8 September

Public landing visually inspected at measured 390px and 1440px widths with no horizontal overflow; illustrative citation disclosure works. Markdown brief returns 200. This verifies public presentation only. The operator workspace reaches Cloudflare Access; its Cloudflare sign-in enters a browser-verification challenge that repeats after a normal checkbox click. Owner sign-in is pending, so no live private query/upload/tenant-isolation pass is claimed. Site Health receipt: docs/qualification/knowledge-base-live-2026-09-08/README.md.

10 September — never-dispatched cleanup source fix

Commit 2143d4c847e534cc2186060a5670e340b6d1e426 completes cleanup for settled prepared artifact intents, without waiting for nonexistent vectors. Started and unknown writes still remain pending until provider convergence. Focused real-SQLite ownership suite: 43 passed. Full local quality passed: 428 Worker tests, 6 dashboard tests, builds/types/docs and existing quality baselines.

Public production readiness passed (D1/schema, R2, Vectorize health and unauthenticated index denial). This does not qualify private document operations. Source is pushed under owner approval; no production migration, backfill or ownership activation was performed. The existing rollout and live-account requirements above remain open.

September 10 — authenticated production CRUD receipt

Using the existing Infisical Fleet/prod service identity, the repository's bounded smoke-rag-crud.mjs passed on the deployed Worker: health, create temporary index (201), ingest one synthetic document (201, one chunk), retrieve the matching document (200, one result), and delete the temporary index (200). A subsequent authenticated inventory returned 200 and confirmed the test index absent.

This verifies the existing index/document API against live infrastructure. It does not qualify owned-file migration/backfill, tenant isolation, operator dashboard sign-in, or pending protocol activation. No existing corpus was changed. Local receipt: knowledge-base-live-2026-09-10/infisical-crud.json.

Activity

  1. sarthakagrawal927 commented on Sep 7, 2026

    @sarthakagrawal927
    MemberAuthor

    Local mitigation receipts (2026-09-07):

    This issue remains open for the tenant/file artifact ownership, legacy compatibility/backfill, durable concurrency protection and authorized live/operator qualification described above. No production migration, deployment, hosted upload, provider call or credential change was performed. The implementation outline and exact local limits are in docs/development/document-workflow-qualification-2026-09-07.md.

  2. sarthakagrawal927 commented on Sep 7, 2026

    @sarthakagrawal927
    MemberAuthor

    Proposed bounded implementation plan — 2026-09-07 (awaiting root review)

    Why and scope

    The guard in b2ae1c9 is temporary protection. Raw keys omit tenant/file ownership, global parse-artifact rows overwrite file-specific provenance, registration changes object keys on a dedupe conflict, and the ingest lease is a non-atomic read/check/write. Deletion also needs to remove the underlying RAG documents rather than only metadata and chunk IDs. All intake paths must participate: catalog upload, inference staging, URL import and object-key registration; direct text and records; queued/inline ingestion and reprocess.

    Goal: independently delete identical-content files in different tenant/domain scopes, with explicit logical removal and physical cleanup states. No production migration, copy/backfill, deployment, provider calls, new binding or dependency is included in this source task.

    Additive schema

    Proposed cloudflare/worker/migrations/0008_file_artifact_ownership.sql leaves existing tables readable and adds:

    • kb_file_lifecycle: (project,file_id) primary key, domain/content_hash, storage_version (legacy or owned), state (uploading/active/deleting/deleted), monotonically increasing generation, published_generation, active_operation_id, deletion_id and timestamps. Tombstones survive removal of kb_files; do not cascade them away.
    • kb_file_operations: operation_id primary key, project/file_id/generation, kind (upload/ingest/reprocess/copy/delete), state (running/settled/cleanup_pending/cleaned), error category and timestamps. No time-based lease stealing. Conditional SQL claims prevent competing file writers.
    • kb_file_artifacts: artifact_id primary key, project/file_id/generation/operation_id, kind (raw/parse/document/vector), object_or_resource_id, provider/profile, immutable ownership/version, write_state and cleanup_state, optional mutation receipt. Unique owned resource identity; indexes on owner/generation and pending cleanup. Record the intended identity BEFORE external writes so a crash cannot make a resource untraceable.
    • kb_file_parse_artifacts: (project,file_id,generation) primary key plus parser/version/page count/content hash/object key. The old global table remains legacy-only. A bounded tenant/hash lookup can return the unique owned match; multiple domains require explicit file_id (409 ambiguity), rather than arbitrarily selecting another file's provenance.

    File IDs remain random immutable IDs. New raw keys are raw/v2/<encoded-tenant>/<file-id>/<content-hash>, parse keys additionally include generation/operation. Encoding must be collision-free, not the current lossy safe-segment sanitizer. Preserve existing dedupe (project,domain,content_hash): atomically reserve the winning file before PUT; losing duplicate requests return its status and never change its raw key. A deleted file gets a new ID on re-import. External object-key registration must prove an existing owned artifact for this tenant; arbitrary bucket keys must not become a read/delete capability. Legacy registrations need a separately authorized import/copy path.

    Durable state and cross-store ordering

    1. Registration reserves file/lifecycle and upload operation in a D1 transaction. The operation records its raw intent, writes the immutable object, then conditionally settles/activates the file only if its generation is still current and not tombstoned.
    2. Ingest/reprocess uses a conditional D1 claim (state=active AND active_operation_id IS NULL). It stages all parse/document/vector identities under its operation/generation. D1 metadata publication checks the same live generation in the same SQL transaction; stale work cannot publish. Every writer, including failure/status updates and structured extraction, obeys this condition.
    3. Delete transaction changes lifecycle to deleting, increments generation, records deletion progress, and invalidates publication. Lists, file/artifact reads, lexical/semantic/structured retrieval and cached answers must enforce lifecycle visibility. Cached responses need a durable scope revision or citation revalidation; process cache clearing alone is insufficient. An already-running response may finish, but subsequent reads cannot expose tombstoned evidence.
    4. Cleanup waits for any previously claimed writer to settle, then removes only ledger-owned objects/documents/vectors, with retryable progress. Worker failures leave a visible pending operation, never a false completed deletion. Stale-generation writers can only finish their private artifacts and enqueue cleanup, never revive the file or affect a new import.
    5. DELETE returns 202 with deletion_id and logical_removed=true while writes/cleanup are pending; repeat DELETE/status lookup resumes/reports the same operation. A completed response distinguishes R2/D1 removal from Vectorize mutation acceptance/confirmed convergence. Never advertise physical completion from an accepted asynchronous mutation alone. Source-set deletion reports per-file states and preserves other files' resources.

    Cloudflare D1 batch is a transaction for SQL statements; it does not make R2 or Vectorize part of that transaction. R2 writes are strongly consistent, but a later PUT can recreate a deleted key. Vectorize upsert/delete are asynchronous. Thus a generation check immediately before a provider call is insufficient. The durable operation ledger, immutable operation resources, conditional publication, read filtering and waiting for writers to settle are all required. An abandoned operation remains cleanup-pending until recovery can establish writer termination and reconcile its receipts/resources; elapsed lease time is not proof. This availability limit must be explicit in the runbook and tests.

    D1 suffices for this slice because the needed coordination is a conditional claim/publication transaction plus persistent cleanup state in the existing database. A new Durable Object would add binding/routing/migration work, and still cannot transactionally commit R2/Vectorize or retract an issued provider write. It may later improve serialized scheduling/alarm recovery, but does not remove the external-write settlement requirement. Do not introduce one for a false atomicity guarantee.

    Legacy compatibility and authorized migration stages

    Deploy ordering, only when separately authorized: apply additive schema; deploy dual-read/new-owned-write source after old writers are drained; inventory legacy references; copy each file's raw bytes to its new key, verify hash/length and ownership, and regenerate parse provenance when the shared artifact contains another file's metadata. Conditionally publish new ownership without modifying the original key. A dry-run/inventory and resumable per-file copy manifest must exist before execution. Legacy file reads remain supported. Legacy physical deletion remains pending/protected until its copy is verified; no shared object is deleted by a per-file request. Garbage collection of zero-reference legacy objects is a separate, authorized operation after old writers are retired. Never backfill ownership by merely relabeling the existing global artifact.

    Files and first complete slice

    Schema/repository foundation: migration0008, src/kb-metadata-repository.ts, ownership helper/module, src/repository.ts and src/d1-repository.ts for owned document cleanup and visibility.

    End-to-end slice: route files catalog.ts/ingest.ts, runtime.ts, ingestion ID creation/helper in ingest.ts, query/cache visibility in query.ts/cache.ts and structured metadata queries. Queue/workflow entrypoints in index.ts must carry/revalidate operation identity. No production config changes. README/operator docs describe compatibility and pending states.

    The first complete behavioral slice is NEW owned plain-text multipart upload -> inline/queued ingest -> exact cited query -> concurrent delete -> independent physical cleanup, while retaining legacy read compatibility and protected legacy deletion. Before enabling owned writes in this slice, all alternate intake/reprocess paths must either use the same ownership protocol or explicitly reject the unsupported transition; they cannot silently write legacy shared keys. Records/structured graphs require subsequent complete ownership/provenance cleanup coverage before claiming all ingestion modes isolated.

    Required proof and tasks

    • Review schema/state machine and first slice before source edits.
    • Apply all migrations only to fresh synthetic SQLite/local D1; also apply0008 to a pre0008 fixture and prove legacy reads unchanged. Real SQL tests prove one winning claim, immutable duplicate registration, owner scope, tombstone persistence, stale publication rejection and transactional rollback.
    • Two independently created handlers/repositories sharing the same actual SQLite DB, with controlled R2/vector barriers: delete during raw PUT, parse PUT, vector upsert and just before publication; resume the older writer and verify no resurrection, no foreign deletion, truthful202 and eventual cleanup after settlement.
    • Identical bytes across tenants/domains: distinct raw/parse identities, correct per-file provenance, delete A, reopen/query B unchanged; repeat A delete and re-import A with new ID while old cleanup runs.
    • Crash/failure injection after each recorded intent, provider write, D1 publication and cleanup step; retry without erasing a newer generation. Expired timestamps alone must not complete deletion. Simulate accepted-but-delayed Vectorize mutations.
    • Verify raw/parse/document/chunk/vector and structured evidence cleanup, cache visibility across separate handler instances, external-key denial, source-set partial progress, legacy copy verification failure and protected original keys.
    • Smallest checks first, then full pnpm quality; checked source push and exact CI. Keep Finish tenant-owned document cleanup and live consumer qualification #48 open for remaining modes, legacy rollout and live consumer/operator qualification.

    Provider references checked on2026-09-07: D1 transactions, R2 consistency, Vectorize asynchronous mutations.

  3. sarthakagrawal927 commented on Sep 9, 2026

    @sarthakagrawal927
    MemberAuthor

    Fresh bounded guest/access/provenance audit — 9 September 2026.

    • Current main and origin/main are 4562c71d80e9bc8861e525bb0f0f442d7455675f; clean checkout. Exact-source CI 34221819695 and docs 34221819621 passed. No source changes or deployment in this audit.
    • Real hidden Chromium at 390×844: https://knowledgebase.sassmaker.com/ renders without horizontal overflow (390px client and scroll widths). The “Illustrative interface” disclosure is visible; opening Amendment.docx exposes its illustrative excerpt. This is presentation proof, not a retrieved private citation.
    • The visible operator-workspace link reaches the actual Cloudflare Access login for “Knowledgebase Internal Dashboard” at long-frog-c8a6.cloudflareaccess.com/cdn-cgi/access/login/search.sassmaker.com. No credentials, account creation, provider setting changes, authenticated corpus reads, uploads or document mutations occurred. Owner authentication and the private dashboard journey remain unverified; this audit did not retry the previously observed downstream browser challenge.
    • Fresh local pnpm exec vitest run tests/file-ownership.test.ts tests/legacy-raw-stage.test.ts: 31/31 pass. These existing synthetic SQLite/handler/file tests cover ownership, citation and deletion boundaries, unresolved writer state, immutable staging and corruption rejection. Provider bindings remain fixtures: this does not establish live D1/R2/Vectorize convergence.

    No new source defect reproduced in this bounded entry/provenance audit. Keep #48 open: an authorized operator must complete Access sign-in and the synthetic live upload → cited query → reopen → foreign-tenant denial → scoped cleanup journey. Before activation, legacy writer drain, verified provider copy, parse/indexed provenance rebuild, conditional publication and unresolved-write reconciliation still require the documented implementation/review and separately authorized rollout. Current offline staging is not a substitute for those gates. No speculative cosmetic or credential-setting changes were made.

  4. sarthakagrawal927 commented on Sep 9, 2026

    @sarthakagrawal927
    MemberAuthor

    Offline per-file parse provenance staging — approved implementation slice

    Why

    Verified raw staging currently stops at immutable byte copies. The shared legacy parse artifact may identify another file, so relabeling it cannot establish cited provenance.

    What / design

    Reparse verified staged bytes with the existing pure local parser and share the current runtime parse-artifact assembly. Match every record against one explicit SQLite snapshot by project/file/domain/hash/raw key/byte size; refuse changed identities, unresolved writers, unsafe or conflicting inputs. Emit deterministic per-file candidate parse artifacts and immutable manifest with readyForPublication=false. Snapshot and raw exports remain unchanged. Offline CLI may require Node24 for native TypeScript source loading; no production dependency or runtime change is added. No provider, OCR/model, SQL mutation, indexing, publication, activation or legacy cleanup.

    Specs

    • WHEN identical bytes belong to different tenant/file/domain scopes, THEN generated provenance and artifact identity SHALL remain distinct.
    • WHEN a legacy parse artifact contains another file identity, THEN it SHALL NOT supply provenance; reparse the verified raw bytes.
    • WHEN raw/manifest/snapshot identity differs, a path escapes, or output conflicts, THEN the command SHALL fail without modifying inputs or overwriting output.
    • WHEN local parsing requires unsupported/OCR/provider conversion, THEN the file SHALL be explicitly blocked and never presented as publication ready.
    • WHEN output already matches, THEN retry SHALL be idempotent.
    • Generated content SHALL retain the existing parser page/record metadata and correct file_id, project, domain and filename.

    Tasks

    • Factor shared parse artifact construction without changing hosted contracts.
    • Add offline input verification, deterministic staging and blocked outcomes.
    • Exercise actual formats, cross-tenant identity, mismatch/conflict/retry, original input preservation and CLI.
    • Run focused checks, full quality/docs, root diff review and checked source push.

    This is a prerequisite slice under #48. Indexed/structured provenance publication, writer drain and uncertain-operation settlement remain separate requirements; do not close the parent issue.

  5. sarthakagrawal927 commented on Sep 9, 2026

    @sarthakagrawal927
    MemberAuthor

    Implemented the reviewed offline provenance preparation slice in 5263f6e, followed by the separate existing-dependency repair in e6b4a348b89a612031f8cfdf67eb27ef88a04722.

    • Raw manifest v2 carries filename/MIME and is checked against the read-only snapshot and verified raw bytes. Per-file parse artifacts are deterministic, immutable, conflict-checked and reusable on identical retry. No legacy shared parse object is relabelled.
    • Existing local parsers cover text, CSV/JSON, DOCX/XLSX/PPTX. Offline-only pinned PDF.js provides page-tree ordered text/page/excerpt provenance; real PDF object-order, image/textless, encrypted and malformed cases are tested. Unsupported/OCR cases are explicitly blocked.
    • Limits: 64 MiB per raw file, 256 MiB aggregate before raw reads, 500 PDF pages, 8 MiB extracted PDF text. readRegular checks actual file size before allocation. Multi-file output is not atomic; verified partial outputs may remain for idempotent retry, as documented.
    • Full local quality passes on Node 24.20.0: 411 Worker tests, 6 dashboard tests, builds and maintenance gates. Twelve Sharp encoding/decoding checks pass. Landing visible text, 55 links and viewport fit match at 390/1440px; screenshot differences are confined to the animated footer strip. Worker dry-run source map has 501 sources and no PDF.js/offline PDF module.
    • Exact-head hosted quality CI and docs CI both passed.

    The separate maintenance patch removes resolved advisory exceptions and lowers ceilings; remaining accepted high debt is root 0, dashboard 8, Worker 4, landing 1, with zero critical. No exceptions were widened.

    Issue 48 remains open. Every staging manifest has readyForPublication: false; candidate identities are not ledger reservations. Live writer drain/revalidation, indexed/structured provenance backfill, unresolved-operation recovery, production schema/activation and owner-account acceptance remain unqualified. No provider calls, migration, upload, activation or deployment occurred. Source deletion still does not promise saved conversation/trace redaction.

    Owning receipts: docs/development/document-workflow-qualification-2026-09-07.md and docs/development/dependency-repair-2026-09-09.json. Checkout is clean and synced; all owned browser/server processes are stopped. Local screenshots/build evidence are retained under ignored .agent-logs/kb-dependency-parity-20260909/ and .agent-logs/kb-offline-parse-worker-bundle-20260909/.

  6. sarthakagrawal927 commented on Sep 9, 2026

    @sarthakagrawal927
    MemberAuthor

    Next approved slice: recover never-dispatched operations

    Why

    An operation with durable intents but no artifact write started currently remains indistinguishable from an uncertain provider write. That blocks safe deletion/retry and future controlled staged-copy publication.

    Design

    Add an artifact dispatch state in an additive migration: existing rows default to unknown; newly recorded intents are prepared; every supported owned R2 raw/parse, D1 document and Vectorize producer conditionally records started before its first write. Cancellation and dispatch serialize through the existing D1 ledger. No new service, dependency or provider operation is introduced.

    Requirements

    • Cancellation SHALL settle only a running operation with an empty artifact set or an entirely prepared, intent-only set. Its never-written artifacts are marked cleanup-confirmed; publication state is unchanged.
    • Legacy unknown, started, accepted or confirmed writes SHALL remain blocked from this recovery path regardless of age.
    • Dispatch SHALL require the same active owner/file/generation reservation and a prepared intent. A cancellation winner prevents later intent insertion and dispatch; a dispatch winner prevents cancellation.
    • Identical cancellation retry SHALL be safe. Tenant/operation mismatches SHALL have no effect.
    • Upload cancellation allows ordinary deletion/retry of the uncompleted file; it does not resume a raw write with a reused key. Existing published generations remain visible during cancelled reprocessing.
    • The authenticated tenant-scoped cancel-prepared route SHALL remain behind the existing ownership activation gate. Gate-off/unknown/foreign IDs return 404, started/unknown writes return 409, safe cancellation/retry returns 200 without publication/deletion claims. No timer, production migration/activation/publication or uncertain-write settlement is included.

    Tasks

    • Add conservative migration/state transitions and actual SQLite race tests.
    • Integrate all four producer entrypoints and prove no handler provider write after cancellation wins.
    • Verify negative legacy/started/accepted/confirmed/cross-owner/idempotence cases, full gates and source review before commit.

    Broader legacy ledger reservation/adoption, indexed/structured backfill, controlled publication and uncertain-operation recovery remain open in issue 48.

    Completion receipt (source only)

    Pushed reviewed source 33b0e338d965bd90256b29754a311921d777d811. Exact-head quality CI and docs CI both passed. Full local quality passed on Node 24.20.0: 424 Worker tests (40 ownership tests), 6 dashboard tests, builds and all maintenance gates. The source migration audit passed.

    The authenticated route is POST /v1/kb/files/:file_id/operations/:operation_id/cancel-prepared, gated by the existing internal ownership activation option. Unknown/foreign/file-mismatched/gate-off requests return 404; unauthorized requests return 401; started work returns 409; safe cancellation and retry return 200 without file deletion or publication claims. The actual upload handler test cancels through the route before dispatch, proves no R2 write, deletes the incomplete file, and successfully uploads again with a new identity.

    Negative tests cover both dispatch/cancel orderings, empty-set versus later intent insertion, legacy migration default unknown, started/accepted/confirmed rejection regardless of age, tenant/file/generation mismatch, dispatch replay, failed cancellation transaction rollback and preservation of previously published generations. Independent ledger instances share one real SQLite connection; this is not cross-process or live D1 concurrency qualification.

    No remote migration, provider write, production activation or deployment occurred. Issue 48 remains open for controlled legacy adoption/reservation, indexed/structured provenance backfill, publication, uncertain started-write recovery, physical convergence and owner-account acceptance. The new fast path does not resolve those gates. Checkout clean/synced; owned tests/processes finished.

  7. added
    queue: excluded
    on Sep 11, 2026
  8. sarthakagrawal927 commented on Sep 18, 2026

    @sarthakagrawal927
    MemberAuthor

    Local progress on tasks 32-33, committed on branch feat/legacy-backfill-reconcile (de2a7fa) — not pushed, per repo rules.

    Task 32 — explicit legacy copy/backfill: backfillLegacyFile in src/owned-storage.ts adopts a legacy storage_version-1 file into the ownership ledger (new adoptLegacy), claims a copy operation, verifies the shared object's bytes against the recorded hash/size, writes the owned raw key, rebuilds generation-scoped parse provenance, and publishes the file as storage_version 2. Shared legacy objects stay retained — zero-reference GC remains a separate review. Uncertain writes leave the operation running and return pending.

    Task 33 — operational reconciliation: reconcileOperations on D1FileOwnership classifies each running operation structurally — settleable only when every artifact is still prepared+intent (the same guard cancelPrepared enforces), pending when any write may have started. Elapsed time is never settlement evidence; pending operations stay truthfully 202.

    Local proof: 4 new real-SQLite tests (full copy path, hash-mismatch refusal, uncertain-write pending, reconcile classification + cancelPrepared divergence). pnpm run check: 432 tests + typecheck clean. No routes wired and no production schema/backfill/activation — tasks 31, 34, 35 remain owner-side.

    Generated with Devin

  9. sarthakagrawal927 commented on Sep 18, 2026

    @sarthakagrawal927
    MemberAuthor

    Tasks 32-33 implemented and validated locally on branch feat/legacy-backfill-reconcile (not pushed — repo rules require owner approval for push/PR): legacy adoption + backfillLegacyFile copy path with hash/length verification, and reconcileOperations structural settlement classification (settleable only when all artifacts remain prepared/intent; time never settles). 432 tests + typecheck green. Next: your approval to push + open the PR; tasks 31/34/35 remain provider-console/live-consumer qualification.

  10. sarthakagrawal927 commented on Sep 19, 2026

    @sarthakagrawal927
    MemberAuthor

    Cancelled by explicit owner direction on 2026-09-19. Closing this issue as not planned, not as completed. This cancels the remaining scope tracked here; it does not retire the project, remove existing code or data, authorize deployment or migration, or establish qualification of unfinished safety gates.

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

    queue: excluded

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions