feat(readiness): bridge knowledge index to agent-eval#1
Merged
Conversation
initKnowledgeBase writes knowledge/index.md and knowledge/log.md as human-navigation scaffolds, but loadKnowledgePages was returning them as content pages. That inflated index.pages.length, polluted search hits, and forced downstream consumers to delete or special-case them post-init. Centralize the scaffold predicate as isScaffoldPath / SCAFFOLD_PAGE_BASENAMES in store.ts and filter scaffolds at page-load time. lint, validate, and viz already skipped these paths via local predicates; this makes the rule authoritative and applies it at the source. Subdirectory scaffolds (<dir>/index.md, <dir>/log.md) are treated the same way. Add a regression test pinning post-init pageCount = 0 and confirming search results never surface scaffold paths.
Raw RRF scores from searchKnowledge are mathematically meaningful for ordering but read as "no relevance" to humans (typical absolute values ~0.016). Downstream consumers compared them to natural [0, 1] thresholds and got false negatives. Add two new fields to KnowledgeSearchResult, non-breaking: - `rrfScore` — alias of `score`, the raw reciprocal-rank-fusion value. - `normalizedScore` — `score / topScore` for the result set, so the top hit is always 1 and lower-ranked hits scale linearly into [0, 1]. `score` keeps its existing meaning (raw RRF) for backward compatibility. The normalization is explicitly within-set, not a cross-query absolute confidence — documented in the type, README, and a test that pins score === rrfScore, top.normalizedScore === 1, and the linear relationship.
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.
Summary
Verification
Published: @tangle-network/agent-knowledge@1.1.0