Skip to content

fix: triage backlog — versions, SCRAM escaping, unload_lib, docs#3

Merged
jscott3201 merged 6 commits into
devfrom
chore/triage-backlog-fixes
Jul 1, 2026
Merged

fix: triage backlog — versions, SCRAM escaping, unload_lib, docs#3
jscott3201 merged 6 commits into
devfrom
chore/triage-backlog-fixes

Conversation

@jscott3201

Copy link
Copy Markdown
Owner

Resolves the triaged backlog items (identified during the 2026-07-01 codebase deep-dive). One focused commit per item.

# Item Commit
1 /api/about and Python __version__ hardcoded stale versions → env!("CARGO_PKG_VERSION") fix(server,python)
2 with_router() doc didn't mention the 2 MB body-limit bypass docs(server)
3 SCRAM username not RFC 5802-escaped; ScramHandshake had no Drop zeroize fix(auth)
4 unload_lib left stale taxonomy/tagOn/conjunct/choice index entries fix(ontology)
5 proptest declared but unused chore(core)
6 Doc drift: changelog cap (10k→50k), HDict "ordered"→unordered, README dep versions docs

Notable

  • Item 3 (auth): the server derives the username from the HELLO phase, not from the SCRAM n= field, and both sides build the client-first-bare via the same make_client_first_bare. So escaping is symmetric (signatures still match) and additionally hardens extract_client_nonce against r= injection in a username. 3 new tests, including a full handshake with the username od,al=ice.
  • Item 4 (ontology): unload_lib now rebuilds all derived indexes from the surviving defs; regression test asserts is_a no longer sees an unloaded lib.

Validation (local, Rust 1.95.0)

  • cargo fmt --all --check
  • cargo clippy --workspace --exclude rusty-haystack --all-targets -- -D warnings
  • cargo test --workspace --exclude rusty-haystack (827 core + 78 server + integration, incl. 4 new tests)

Deferred (not in this PR)

  • tower-http remains a declared-but-unused server dependency (removal candidate).
  • Benchmarks.md still records "Rust 1.93.1" (historical run record — left as-is).
  • Adding real proptest property tests (codec round-trips, unit conversion) is a good follow-up.

🤖 Generated with Claude Code

jscott3201 and others added 6 commits July 1, 2026 14:36
about.rs hardcoded serverVersion/moduleVersion="0.7.2" and the Python module hardcoded __version__="0.1.0" while the workspace is 0.8.1. Both now use env!("CARGO_PKG_VERSION") so they track the crate version automatically. (Triage item 1.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The with_router() doc comment warned about the auth-middleware bypass but not that custom routes also skip the 2 MB DefaultBodyLimit (both layers are applied before the merge). Documented, and noted with_authenticated_router() keeps the body limit. (Triage item 2.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
make_client_first_bare embedded the raw username, so a username containing ',' or '=' corrupted the client-first-message and could hijack extract_client_nonce's r= parsing. Now escaped per RFC 5802 (=->=3D, ,->=2C); both client and server escape identically so signatures still match. Also added a Drop impl that zeroizes ScramHandshake's stored_key and server_signature (previously it had no Drop, unlike ScramCredentials). Adds 3 tests. (Triage item 3.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
unload_lib removed defs/specs/libs but only cleared the mandatory cache, leaving stale TaxonomyTree edges, tag_on_index, conjuncts, and choice_index entries so is_a/fits could still see an unloaded lib. Now rebuilds all derived indexes from the remaining defs. Adds a regression test. (Triage item 4.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
proptest 1.10 was declared as a dev-dependency of haystack-core but had zero references in any source file. Removed it and its transitive dev-deps from the lockfile. (Triage item 5; adding real property tests can be a separate effort.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
architecture.md said the graph changelog is capped at 10,000 (actual DEFAULT_CHANGELOG_CAPACITY is 50,000); data/mod.rs called HDict an 'ordered map' though it is an unordered HashMap; README's dependency table listed pre-modernization versions (tower-http 0.6, tokio-tungstenite 0.28, roaring 0.10, pyo3 0.28). All corrected to match the code. (Triage item 6.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jscott3201
jscott3201 merged commit ad60965 into dev Jul 1, 2026
6 checks passed
@jscott3201
jscott3201 deleted the chore/triage-backlog-fixes branch July 1, 2026 18:39
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