De-slop redo: fix Emacs crash chain, core retrieval bugs, packaging #5

Closed
nsaspy wants to merge 0 commits from rage/deslop-emacs-crash into master
Owner

Full redo of LLM-era code on top of c82bd94, run as a RAGE iteration (evidence log: rage/deslop-emacs-crash.org).

Emacs crash chain (all reproduced, not guessed)

  • org-vector--query-sync sent -k 5 but the CLI had no -k option → gptel tool 100% broken (main.py: error: unrecognized arguments: -k 5)
  • exit-code was set to (point), not call-process's return → success always reported as failure
  • missing (require 'subr-x) → void-function when-let on the declared Emacs 27/28 → crash on first search
  • (require 'transient) added (declared dep, never required); byte-compile now clean
  • -k/--results added to the CLI; search modes no longer send --dir; dead-buffer sentinel guards

Core python bugs

  • query() embedded queries with the ingestion prefix (embeddings.py:529) — now uses query instructions
  • OrgNode.id defaulted to fresh uuid4() per parse, so the documented deterministic auto-<sha1> fallback IDs never ran (proven non-deterministic at start commit)
  • configure_logging() was a no-op after import-time get_logger() — CLI --log-level/--log-to-file now actually take effect
  • _load_model silently replaced injected encoders with a real model load — duck-typed injection now supported (also what makes the offline tests possible)
  • nomic-embed/e5 default instruction prefixes implemented (README promised them; _default_instructions returned the same strings for every model)

De-slop

  • dead deps cut from flake/setup: ollama, langchain-ollama, psycopg, pandas, adjusttext, matplotlib-inline, scikit-learn
  • deleted dead files: test.py, test_fixed.py (imported nonexistent module), debug_duplicate_ids.py, load_config.py, empty project_analysis.md
  • fixed broken setup.py console entry point (org_vector.main did not exist → org_vector.cli:run, main.py is a shim)
  • versions aligned 0.4/0.3.0/0.1.0 → 0.5.0; black-formatted; flake8 config added

Tests

  • new offline suite: tests/test_org_vector.py (16 unittest cases, fake model + fake chroma, no downloads) + tests/org-vector-test.el (9 ERT cases)
  • TDD red→green evidence in rage/deslop-emacs-crash.org

Gate (exact head 846e147)

Gate Result
py_compile PASS
pyright 0 errors (start-commit baseline: 10)
black --check / flake8 PASS
python test_context_fix.py 16/16
ERT batch 9/9
byte-compile 0 warnings
nix build .# PASS
real-DB smoke (query/-k, embed validation) PASS

CI runs the same gate on every PR/push to master.

Full redo of LLM-era code on top of c82bd94, run as a RAGE iteration (evidence log: rage/deslop-emacs-crash.org). ## Emacs crash chain (all reproduced, not guessed) - `org-vector--query-sync` sent `-k 5` but the CLI had no `-k` option → gptel tool 100% broken (`main.py: error: unrecognized arguments: -k 5`) - `exit-code` was set to `(point)`, not `call-process`'s return → success always reported as failure - missing `(require 'subr-x)` → `void-function when-let` on the declared Emacs 27/28 → crash on first search - `(require 'transient)` added (declared dep, never required); byte-compile now clean - `-k/--results` added to the CLI; search modes no longer send `--dir`; dead-buffer sentinel guards ## Core python bugs - `query()` embedded queries with the *ingestion* prefix (embeddings.py:529) — now uses query instructions - `OrgNode.id` defaulted to fresh `uuid4()` per parse, so the documented deterministic `auto-<sha1>` fallback IDs never ran (proven non-deterministic at start commit) - `configure_logging()` was a no-op after import-time `get_logger()` — CLI `--log-level`/`--log-to-file` now actually take effect - `_load_model` silently replaced injected encoders with a real model load — duck-typed injection now supported (also what makes the offline tests possible) - nomic-embed/e5 default instruction prefixes implemented (README promised them; `_default_instructions` returned the same strings for every model) ## De-slop - dead deps cut from flake/setup: ollama, langchain-ollama, psycopg, pandas, adjusttext, matplotlib-inline, scikit-learn - deleted dead files: test.py, test_fixed.py (imported nonexistent module), debug_duplicate_ids.py, load_config.py, empty project_analysis.md - fixed broken setup.py console entry point (`org_vector.main` did not exist → `org_vector.cli:run`, main.py is a shim) - versions aligned 0.4/0.3.0/0.1.0 → 0.5.0; black-formatted; flake8 config added ## Tests - new offline suite: tests/test_org_vector.py (16 unittest cases, fake model + fake chroma, no downloads) + tests/org-vector-test.el (9 ERT cases) - TDD red→green evidence in rage/deslop-emacs-crash.org ## Gate (exact head 846e147) | Gate | Result | |---|---| | py_compile | PASS | | pyright | 0 errors (start-commit baseline: 10) | | black --check / flake8 | PASS | | python test_context_fix.py | 16/16 | | ERT batch | 9/9 | | byte-compile | 0 warnings | | nix build .# | PASS | | real-DB smoke (query/-k, embed validation) | PASS | CI runs the same gate on every PR/push to master.
nsaspy closed this pull request 2026-09-04 21:00:34 +00:00
Some checks failed
CI / Lint, typecheck, and tests (pull_request) Failing after 7s
CI / Build and smoke checks (pull_request) Failing after 5s

Pull request closed

Sign in to join this conversation.
No description provided.