Skip to content

v0.11.0

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Sep 22:39
f0b9d75

Added

  • Claude Code hooks: file-triggered injection, JSONL guard, usage log (mulch-7164): ml setup claude now also installs a PreToolUse ml hook handler. On Read/Edit/Write/MultiEdit/NotebookEdit it returns the records anchored to that file as additionalContext (failures first, ~500-token budget, stale last, each record once per session; silent when nothing is anchored). Write/Edit and best-effort Bash writes to .mulch/expertise/*.jsonl are denied with a pointer to ml record / ml edit / ml delete. Each injection appends {ts, session, tool, files, ids} to .mulch/state/usage.jsonl (self-gitignored). Install is idempotent, keeps unrelated hooks, and refuses malformed settings; --remove strips only mulch handlers.

  • ml record --description works for every built-in type (mulch-7164): missing type-specific fields are filled from it (convention content, a derived pattern/reference/guide name, decision title + rationale). Explicit flags win; failures still need --resolution. Derived names end in a 6-char content hash (mulch-9f0f), so distinct records sharing their first six words no longer silently upsert-merge; explicit --name keeps upsert semantics.

  • Write-time quality gate on ml record (mulch-a378): near-duplicate detection (BM25 shortlist + token-set Jaccard, lower bar when file/dir anchors overlap) blocks records that restate an existing one and prints it with --supersedes <id> / ml edit / ml outcome / --force suggestions. Soft checks warn on conventions/patterns with no file/dir anchor or evidence (an auto-populated commit does not count) and on conventions that read like code restatement (the ml audit rule-signal heuristic). New quality.level config knob: warn (default), error (block unless --force), off.

  • Git-based staleness: ml stale + prime demotion (mulch-094a): ml stale [domains...] lists live records whose file/dir anchors changed in 5+ commits since the record's evidence commit, whose anchors no longer exist, or that are tactical/observational past shelf life with no confirmations (--json returns ids + structured reasons). ml prime ranks stale records last within their budget tier and marks them (stale?) in the index (; stale? in the why-surfaced suffix for --full / xml / plain). Two batched git calls cover all records (git log --name-only bounded at the oldest record), so the editor-hook path stays fast. Advisory only; nothing is deleted.

  • ml show <ids...> (mulch-bffe): prints full record bodies by ID (full id, bare hash, or unique prefix) across every domain; --json returns { domain, record } pairs.

  • ml prime --records-only (mulch-bffe): emits only the record lines (no project contract, quick reference, or session-close footer, and nothing at all when no record matches) for editor hooks such as ml prime --files <path> --budget 500 --records-only.

Changed

  • Prime staleness uses anchor evidence only (mulch-7164): ml prime demotes and marks (stale?) only for anchors_changed / anchors_missing. shelf_life (old, never confirmed) flagged most real corpora and is now reported by ml stale only.

  • BREAKING: ml prime defaults to a record index (mulch-bffe): the default (compact) output is one line per record (id, type, summary truncated to ~100 chars, up to 3 file/dir anchors, ★ score), grouped by domain, with a short quick reference; bodies, links, and why-surfaced suffixes moved behind ml show <id> / --full. Ranking is failures first, then confirmation score, classification, and recency; with --files / --context, failures anchored to those paths survive any --budget and other anchored records outrank unanchored ones. Records superseded by a live record's supersedes are hidden. The v0.10 size-based auto-flip to manifest is retired (the budget keeps large corpora small); prime.default_mode: manifest and --manifest still work. ml query / ml search --format compact share the index line. The per-type formatCompactLine registry hook is removed; formatIndexLine (src/utils/format.ts) renders every type and drives budget estimates.

  • Exact duplicates are hard-blocked (mulch-a378): dedup now compares normalized text (case, punctuation, whitespace folded), so trivially reworded copies no longer slip through, and content_hash custom types dedup on their normalized body instead of never matching. ml record exits 1 on an exact duplicate of a convention/failure (previously a successful "skipped"), and --force no longer re-creates one in any record path; named types still upsert.

  • Session-close and onboard prose (mulch-a378): the default session-close footer and the onboard snippet now say "record only what a future agent would get wrong without it", steer toward failure records (symptom -> root cause -> preventive check) and ml outcome confirmations, and drop the 🚨 banner from every preset. The package description is now plain: "Git-native expertise records for AI agents".

  • ml --version --json now emits 2-space-indented JSON (closes mulch-6d8a): the early-exit --version --json path in src/cli.ts previously emitted a single-line JSON.stringify(...) payload while every other --json-mode response in mulch is 2-space-indented via outputJson. The output is now formatted with JSON.stringify(..., null, 2) so machine consumers see one consistent JSON shape across the CLI. Fields (name, version, runtime, platform) and values are unchanged; consumers that JSON.parse the output are unaffected.

  • ml upgrade --json key canonicalized to up_to_date (closes mulch-4ca6): the upgrade JSON output previously emitted upToDate (camelCase) while ml onboard --json emitted the same concept as the snake_case action value up_to_date. The upgrade payload now uses up_to_date to match the rest of mulch's snake_case JSON convention (e.g. not_installed, default_mode, extracts_files). Consumers that read parsed.upToDate must switch to parsed.up_to_date; the boolean semantics are unchanged.