Skip to content

fix: report processor-off and prune removed markdown - #67

Merged
hmbanan666 merged 1 commit into
mainfrom
fix/processor-visibility-import-prune
Nov 17, 2026
Merged

hmbanan666 merged 1 commit into
mainfrom
fix/processor-visibility-import-prune

Conversation

@hmbanan666

Copy link
Copy Markdown
Owner

Summary

  • /health includes processor: "off", "openai", or "codex". The body has no model name and no key. When distillation is off, startup writes one stderr JSON line that this is a supported mode, including a curated instance. There is no context status command, so none was added.
  • context import markdown --prune retires markdown sources for the same area, project, and import directory whose relative path is gone. The summary field is removed. The source row stays in the database. Search, timeline, and read skip it. Importing the file again makes it visible.
  • context doc remove <doc:project:type:key or source id> is an owner CLI command. A document id, or a source id that belongs to a document, retires every revision of that document. MCP stays search, remember, read, and timeline.

Tests

pnpm run check (lint, typecheck, and pnpm test): 54 files, 277 tests passed.

Friction

  1. The slow part was finding every query that still returns a source. Search is not one function: store.search, packageCandidates, selectMemory, embedding #chunkFrom, the document current/stale SQL, and distill each read sources on their own. A retire flag that misses one of those leaves the page searchable, and findMaterial throws Missing source candidate if the SQL and the read path disagree. That was reading time, not a wait. Node install, pnpm install, and the full suite were about 4s, 4s, and 26s.
  2. The processor notice is console.warn on stderr, not a second stdout line. test/backup-cli.test.ts does JSON.parse(output.trim()) on the whole stdout, and test/restart.test.ts parses the first stdout chunk as one JSON object. A normal info line on stdout fails those tests. The import root is stored in markdown_import_roots, outside the import fingerprint, because putting it in provenance metadata would mark every unchanged file updated. Sources imported before this change have no root, so the first --prune in that area and project treats them as part of the folder. Retirement is a source_retirements row, not the spec's hard-delete journal. That journal is still unbuilt, and wiping text plus derived items was more than this slice.
  3. test/backup-cli.test.ts treats every stderr JSON event that is not backup as exactly embeddings_unavailable, so the startup line had to be allow-listed. test/restart.test.ts waitForPort assumes one JSON document on stdout. There is no context status. docs/spec.md still describes hard delete as unbuilt; this path keeps the source text and only hides it from search and read.
  4. One active-source SQL fragment, already used by search, timeline, embeddings, and document-current queries, would make the same visibility change one edit. Tests should read logs line by line (event === "listening") instead of JSON.parse of the whole stdout buffer, and stderr assertions should ignore unknown events. A short list in docs/architecture.md of the queries that define "searchable" would have cut the tracing.

Merge and deploy still need a separate owner approval.

Open in Web Open in Cursor 

Report the processor kind on /health and log once at startup when distillation
is off. Add opt-in markdown --prune and context doc remove so dropped files
leave search and read without a new MCP tool.

Co-authored-by: Nick Kosarev <nick@kosarev.space>
@hmbanan666
hmbanan666 merged commit d5108e1 into main Nov 17, 2026
2 checks passed
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.

2 participants