Repository navigation
Description
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
sarthakagrawal927 commentedon Sep 7, 2026
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.
sarthakagrawal927 commentedon Sep 7, 2026
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.sqlleaves 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
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.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.tsandsrc/d1-repository.tsfor owned document cleanup and visibility.End-to-end slice: route files
catalog.ts/ingest.ts,runtime.ts, ingestion ID creation/helper iningest.ts, query/cache visibility inquery.ts/cache.tsand structured metadata queries. Queue/workflow entrypoints inindex.tsmust 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
Provider references checked on2026-09-07: D1 transactions, R2 consistency, Vectorize asynchronous mutations.
sarthakagrawal927 commentedon Sep 9, 2026
Fresh bounded guest/access/provenance audit — 9 September 2026.
4562c71d80e9bc8861e525bb0f0f442d7455675f; clean checkout. Exact-source CI 34221819695 and docs 34221819621 passed. No source changes or deployment in this audit.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.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.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.
sarthakagrawal927 commentedon Sep 9, 2026
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
Tasks
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.
sarthakagrawal927 commentedon Sep 9, 2026
Implemented the reviewed offline provenance preparation slice in
5263f6e, followed by the separate existing-dependency repair ine6b4a348b89a612031f8cfdf67eb27ef88a04722.readRegularchecks actual file size before allocation. Multi-file output is not atomic; verified partial outputs may remain for idempotent retry, as documented.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.mdanddocs/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/.sarthakagrawal927 commentedon Sep 9, 2026
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 areprepared; every supported owned R2 raw/parse, D1 document and Vectorize producer conditionally recordsstartedbefore its first write. Cancellation and dispatch serialize through the existing D1 ledger. No new service, dependency or provider operation is introduced.Requirements
Tasks
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.
sarthakagrawal927 commentedon Sep 18, 2026
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:
backfillLegacyFileinsrc/owned-storage.tsadopts a legacy storage_version-1 file into the ownership ledger (newadoptLegacy), claims acopyoperation, 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 returnpending.Task 33 — operational reconciliation:
reconcileOperationsonD1FileOwnershipclassifies each running operation structurally —settleableonly when every artifact is still prepared+intent (the same guardcancelPreparedenforces),pendingwhen 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 +
cancelPrepareddivergence).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
feat(worker): legacy copy/backfill and operation reconciliation (#48 …
sarthakagrawal927 commentedon Sep 18, 2026
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 +backfillLegacyFilecopy path with hash/length verification, andreconcileOperationsstructural 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.sarthakagrawal927 commentedon Sep 19, 2026
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.