Repository navigation
Conversation
Co-Authored-By: Claude Code <noreply@anthropic.com>
… (PRD-04 DEP-5) Co-Authored-By: Claude Code <noreply@anthropic.com>
…re pin boost (PRD-04 DEP-5) Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
…04 DEP-5) Co-Authored-By: Claude Code <noreply@anthropic.com>
…er (PRD-04 DEP-5) Co-Authored-By: Claude Code <noreply@anthropic.com>
…RD-04 G2) Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
…s (DEP-5)
relay.query_subgraph returns the parsed body for any HTTP 2xx, so a
GraphQL error body ({"errors": [...]}) carries no "data" key; the lenient
.get chain collapsed it to None, get_fact_pin_status returned False, and
the pin guard let an LLM UPDATE/DELETE tombstone a pinned fact during a
subgraph hiccup.
_fetch_fact_by_id gains a keyword-only strict mode, used only by
get_fact_pin_status: a non-empty "errors" key, or a body whose "data" is
not a dict carrying "fact", raises RuntimeError (pin state unknown ->
guard fails closed). False is returned only for an explicit
data.fact is None. Other callers keep the lenient shape unchanged.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Conflicts: SKILL.md (kept main's Hermes-memory forget hint and the DEP-5 pin wording), operations.py (pin-boost constant + ids-first query comment), core CHANGELOG (Unreleased above 2.6.1). Moved the DEP-5 Python CHANGELOG entry out of the released 2.5.3 section into [Unreleased]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bd3G1BkVMFSXkcdAQ7nFax
RRF scores sit on a 1/(60 + rank) floor, so 1.5x on the fused score lifted any candidate ranked <= 31 on both signals above rank 1. In a pool of 31 or fewer candidates every pinned fact ranked first, even one with no lexical and no semantic match (new core test reproduces: a 15-candidate pool put an unrelated pin at #1). The boost now multiplies a pinned candidate's BM25 and cosine scores before ranking. A pin moves up only past candidates whose relevance is within 1.5x of its own, which is the signed-off "about 50% above unpinned". Reported bm25/cosine scores and intent weights use the raw values. No-boost path is still bit-identical; no parity fixture changes. Spec, changelogs and binding docs updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bd3G1BkVMFSXkcdAQ7nFax
…th (DEP-5) Runs auto_extract three times against a fake subgraph holding AES-GCM-encrypted blobs. Pin state is read the production way: search_facts (ids-first search, decrypt, is_pinned_claim) for the contradiction resolver, get_fact_pin_status (strict fact-by-id) for the pin guard. Each round asserts which mechanism stopped it. Controls show the same rounds replace an unpinned fact; a GraphQL error body on the pin read never tombstones. Mutation-checked: disabling the guard or the search pin flag turns it red. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bd3G1BkVMFSXkcdAQ7nFax
Review + refresh (2026-11-03)Verdict: code-ready, merge held for the core audit. Main is merged in, one real bug in the boost is fixed, and a deeper end-to-end test is added. 1. Merged 2. Bug: the 1.5× pin boost put unrelated pins first in small candidate pools ( 3. New test Pin-safety by path: auto-extract UPDATE/DELETE: guarded. Contradiction resolver: only Tests: core Overlap with #701 (DEP-3): it only conflicts textually, in the core CHANGELOG Still open: the core release ( refs totalreclaw-internal#538 🤖 Generated with Claude Code |
|
Pedro approved the pin boost fix (e2d56ed: boost BM25 and cosine before fusion instead of multiplying the fused RRF score) on 2026-11-03. Merge is still held for the core audit. |
Summary
PRD-04 F1 / DEP-5 (track
kg, L2). Part A of 2 (Part B = MCP, after a core RC).RerankerConfig.pin_boost: Option<f64>(JSONpin_boost),Candidate.pinned(JSONpinned),DEFAULT_PIN_BOOST = 1.5; PyO3rerank_with_config(..., pin_boost=None)+default_pin_boost(); WASMrerankWithConfig(..., pin_boost?)+defaultPinBoost(). Default is a no-op: every existing ranking is bit-for-bit identical (tests assertto_bitsequality); no parity fixture changed.agent/pin_guard.pydrops LLM UPDATE/DELETE whose target is pinned; unknown pin state fails closed (DELETE dropped, UPDATE → ADD). The contradiction resolver now receives entity refs +st:"p". It was dormant before: no entities were passed, so core never compared claims. It acts onexisting_pinnedonly. Recall passes core's pin boost (feature-detected; no-op on core 2.6.x).memory-taxonomy-v1.md§Pin semantics items 6–8;retrieval-v2.md§Pin boost; CLAUDE.md matrix + 3 Known Gaps; CHANGELOGs.Decisions (see plan)
SkipNew{ExistingPinned}and the MCP/plugin contradiction path. Logs carry the category only; no decision-log row.PinConfig::default().hard_boost. No boost without a query embedding: lexical-only ties would lift every pin to the top. Hermes auto-recall gets the boost with DEP-8.existing_pinnedstay log-only until DEP-12.Candidate.pinnedis a new public field: Rust struct-literal callers must add it. In-tree callers are fixed. Coordinator: confirm minor vs major for the core release.Sequencing
Touches
_auto_extract_innerinpython/src/totalreclaw/agent/lifecycle.py: one import line plus one block after the contradiction try/except. DEP-3 edits the top of the same function. No fixed merge order with DEP-3: whichever merges second rebases.Open items (New Feature Checklist)
python/tests/test_staging_pin_contract.py, run by the coordinator with a throwaway staging vault in the environment; it asserts the staging DataEdge.python/src/totalreclaw/crystals/recrystallize.pyrewrites and tombstones facts without preservingpin_status.Test evidence
cargo test(core),cargo test --features python --lib python::tests,cargo check --tests(totalreclaw-memory), the CI Python suite,scripts/check-pyfunction-parity.py,scripts/check-docs.sh,scripts/check-phrase-safety.sh, and the WASM smoke (a,b,c/p,a,b/1.5), all green locally.🤖 Generated with Claude Code