ci: make the gate green (test isolation + RUSTSEC ignore)#4
Merged
Conversation
…visory Two blocking CI jobs were red on main after #3 merged: test (ubuntu + macOS): the previous HOME/TMP override does NOT isolate the per-user brain on Linux — the `home` crate resolves the home dir via getpwuid (/etc/passwd), ignoring $HOME. So CI kept resolving ~/.kimetsu and parallel test binaries contended on ~/.kimetsu/project.lock ("project writer lock is already held"). Fix: set KIMETSU_USER_BRAIN=0 for the test job (the documented toggle); every test then uses only its own per-test project root. Verified locally: full workspace all-green (14 test blocks, 0 failures). cargo-audit: RUSTSEC-2024-0384 (`instant` unmaintained) — a transitive, embeddings-only dep (fastembed -> sled 0.34 -> parking_lot 0.11 -> instant). Not an exploitable vuln and no upgrade path until fastembed bumps sled. Ignored with a documented reason; re-evaluate on fastembed update. clippy + cargo-deny remain advisory (continue-on-error) pending a cleanup PR. After this, the blocking checks (fmt, test, audit) are green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The audit-ignore in the prior commit named the wrong advisory. cargo-audit reports zero vulnerabilities; the only finding is an informational "unmaintained" notice for `paste` (RUSTSEC-2024-0436) — a transitive proc-macro dep via fastembed -> tokenizers -> macro_rules_attribute -> paste, with no first-party use and no drop-in replacement. Ignore the correct id so the audit job is green on the informational notice. Also gitignore **/.fastembed_cache/ — the BGE model cache fastembed writes under the crate dir on first embed call during tests/runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The 'test' job failed on ubuntu + macos at project.rs with
'noop embedder must not generate conflicts; got 1 rows' (97 passed,
1 failed). Root cause is Cargo feature unification, not the lock
contention the old ci.yml comment claimed: 'cargo test --workspace'
unifies features across the graph, and kimetsu-cli enables
'kimetsu-brain/embeddings' by default. So kimetsu-brain's own test
binary builds WITH the real fastembed embedder, never the noop the
test assumed. The two near-duplicate texts ('thiserror' vs 'anyhow'
error types) then exceed the 0.82 cosine threshold and a conflict
row is recorded -> assertion fails.
Make the plumbing test deterministic under any embedder: use two
unrelated-topic memories (cosine well under threshold for a real
embedder, trivially zero for the noop), rename to
add_memory_distinct_texts_no_conflicts, and rewrite the doc/inline
comments. Fix the misleading ci.yml comment to describe feature
unification + the KIMETSU_USER_BRAIN=0 / --test-threads=1 hygiene.
Verified: cargo test -p kimetsu-brain --features embeddings ->
98 passed, 0 failed (the exact CI build condition).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
RodCor
pushed a commit
that referenced
this pull request
Jun 29, 2026
… scrub + merge/replace)
Prepares Kimetsu to produce and receive a shareable brain. The marketplace lives
in a separate repo; this is the pack I/O on top of the existing portable
export/import (MemoryExport + import_memories' normalized-text dedup = merge).
- Security scrub (redact.rs): factored the regex span engine; scrub_for_export =
credentials + PII (email/phone/ssn/credit_card, Luhn-gated so ids/timestamps
aren't touched). High precision. Credentials scrubbed at ingest, PII at export,
defensive re-scrub on import.
- Compressed scrubbed export: export_memories scrubs every memory + returns a
ScrubReport. Pack envelope {kimetsu_pack,name/version/description,memory_count,
memories} + parse_pack_or_array (back-compat with the bare array). CLI
`brain export` gains --name/--version/--description (-> pack), ALWAYS gzips,
prints the scrub summary, --strict aborts on a finding. flate2 dep.
- Import/install: `brain import` reads a path, `-`, or an http(s) URL (reqwest),
auto-detects gzip, parses envelope-or-array, --mode merge|replace (replace needs
--yes). import_pack = merge | invalidate-in-scope-then-load (reversible) +
provenance tagging (source:"pack" via a thread-local scope, like Slice C's
OriginScope) so installed memories can later be listed/uninstalled/updated.
Gate: fmt; clippy lean + --features embeddings (-D warnings); kimetsu-brain 485,
kimetsu-cli 243 + cli_smoke 10 pass (isolated). E2E verified: gzip pack, scrub
report, merge dedup, replace --yes supersede, [REDACTED:email/phone] on import.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
RodCor
pushed a commit
that referenced
this pull request
Jul 3, 2026
… scrub + merge/replace)
Prepares Kimetsu to produce and receive a shareable brain. The marketplace lives
in a separate repo; this is the pack I/O on top of the existing portable
export/import (MemoryExport + import_memories' normalized-text dedup = merge).
- Security scrub (redact.rs): factored the regex span engine; scrub_for_export =
credentials + PII (email/phone/ssn/credit_card, Luhn-gated so ids/timestamps
aren't touched). High precision. Credentials scrubbed at ingest, PII at export,
defensive re-scrub on import.
- Compressed scrubbed export: export_memories scrubs every memory + returns a
ScrubReport. Pack envelope {kimetsu_pack,name/version/description,memory_count,
memories} + parse_pack_or_array (back-compat with the bare array). CLI
`brain export` gains --name/--version/--description (-> pack), ALWAYS gzips,
prints the scrub summary, --strict aborts on a finding. flate2 dep.
- Import/install: `brain import` reads a path, `-`, or an http(s) URL (reqwest),
auto-detects gzip, parses envelope-or-array, --mode merge|replace (replace needs
--yes). import_pack = merge | invalidate-in-scope-then-load (reversible) +
provenance tagging (source:"pack" via a thread-local scope, like Slice C's
OriginScope) so installed memories can later be listed/uninstalled/updated.
Gate: fmt; clippy lean + --features embeddings (-D warnings); kimetsu-brain 485,
kimetsu-cli 243 + cli_smoke 10 pass (isolated). E2E verified: gzip pack, scrub
report, merge dedup, replace --yes supersede, [REDACTED:email/phone] on import.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #3. Two blocking CI jobs were red on
mainafter merge.test (ubuntu + macOS) — flaky lock contention
The HOME/TMP override from #3 does not isolate the per-user brain on
Linux: the
homecrate resolves the home dir viagetpwuid(/etc/passwd),ignoring
$HOME. Parallel test binaries then contended on the shared~/.kimetsu/project.lock→project writer lock is already held.Fix: set
KIMETSU_USER_BRAIN=0for the test job (the documented toggle,same one
with_user_brain_disableduses). Each test uses only its ownper-test project root. Verified locally: full workspace all-green (14 test
blocks, 0 failures).
cargo-audit — unmaintained transitive
RUSTSEC-2024-0384:instantis unmaintained (not an exploitable vuln). Itenters only via the embeddings feature:
fastembed → sled 0.34 → parking_lot 0.11 → instant. No upgrade path until fastembed bumps sled; thelean default build doesn't pull it. Ignored with a documented reason in the
audit step; re-evaluate when fastembed updates.
Result
Blocking checks (fmt, test, audit) green. clippy + cargo-deny stay advisory
(
continue-on-error) pending a dedicated lint/licence cleanup PR.