feat: add T-I-F reliability helpers (TifScore, evaluateTif)#145
Conversation
Implements Phase 3 of the T-I-F RFC (dakera-deploy#161). - Add TifScore interface, TifClassification type, computeTifScore() and tifScoreFromMetadata() helpers to types.ts - Add evaluateTif() method to DakeraClient - Export new types/functions from index.ts - Add 15 unit tests covering computation, classification, and metadata parsing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix TS1361: split computeTifScore out of `import type` into a regular value import — it is a function, not a type alias - Update CHANGELOG.md and README.md with TifScore / evaluateTif documentation Part of T-I-F RFC Phase 3 (DAK-6562).
Co-Authored-By: Paperclip <noreply@paperclip.ing>
feb5888 to
21032d3
Compare
|
Phase 3 SDK review note from the RFC side. The TypeScript surface looks good: typed Before this leaves draft, I would align it with the canonical Phase 3 T-I-F math across MCP and the other SDKs. Current risk: this implementation appears to use raw feedback proportions only, while Suggested gate: add or reference shared golden vectors so Python/JS/Rust/Go/MCP all return the same Once parity is locked, this looks like the right JS/TS API shape. |
…6566) Aligns JS/TS SDK with MCP canonical T-I-F v1 contract: - Inject base indeterminacy when feedback_count < 3 to prevent false confidence from sparse signals - Normalise T+I+F to 1.0 after adding base indeterminacy - Add 8 golden vector tests matching MCP/Python/Rust/Go - Add 3 thin-evidence unit tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@ferhimedamine final Phase 3 review complete from my side for the JS SDK PR. I rechecked the current PR state and the DAK-6566 parity fixes. The previous blockers are resolved:
This is review-ready from my side. No further requested changes from me. |
Summary
Part of T-I-F RFC Phase 3 — adds type-safe T-I-F reliability helpers so developers don't have to hand-roll
metadata.reliabilityparsing.Changes:
TifScoreinterface andTifClassificationtype intypes.tscomputeTifScore(history)andtifScoreFromMetadata(data)pure functionsevaluateTif(memoryId)method onDakeraClientindex.tssrc/tif.test.tsT-I-F computation: upvote/positive→truth, downvote/negative→falsity, flag→indeterminacy. Classification: falsity≥0.5→surface_contradiction, indeterminacy≥0.5→ask_clarification, truth≥0.7→confident_reuse, else→verify_before_use.
Related PRs (all 4 SDKs batch)
🤖 Generated with Claude Code
Reviewed-by: Jean-Sébastien Beaulieu (@SeCuReDmE-main-dev) — T-I-F contract parity review