Skip to content

feat: add T-I-F reliability helpers (TifScore, EvaluateTif)#106

Merged
ferhimedamine merged 3 commits into
mainfrom
feat/tif-reliability-helpers
Jun 13, 2026
Merged

feat: add T-I-F reliability helpers (TifScore, EvaluateTif)#106
ferhimedamine merged 3 commits into
mainfrom
feat/tif-reliability-helpers

Conversation

@ferhimedamine

@ferhimedamine ferhimedamine commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Part of T-I-F RFC Phase 3 — adds type-safe T-I-F reliability helpers.

Changes:

  • TifScore struct and TifClassification string constants in types.go
  • ComputeTifScore(*FeedbackHistoryResponse) TifScore function
  • TifScoreFromMetadata(map[string]interface{}) (TifScore, bool) function
  • EvaluateTif(ctx, memoryID) method on Client in client.go
  • 12 tests in tif_test.go

Go idioms: Uses string-typed TifClassification with named constants (TifConfidentReuse, etc.) following existing FeedbackSignal pattern in the codebase.

🤖 Generated with Claude Code


Reviewed-by: Jean-Sébastien Beaulieu (@SeCuReDmE-main-dev) — T-I-F contract parity review

Dakera CTO and others added 2 commits June 12, 2026 23:58
Implements Phase 3 of the T-I-F RFC (dakera-deploy#161).

- Add TifScore struct, TifClassification constants, ComputeTifScore() and
  TifScoreFromMetadata() helpers to types.go
- Add EvaluateTif() method to Client in client.go
- Add 12 unit tests in tif_test.go covering all edge cases

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Document TifScore struct, FromFeedbackHistory, FromMetadata, and EvaluateTif()
in CHANGELOG [Unreleased] and README feature list.

Part of T-I-F RFC Phase 3 (DAK-6562).
@SeCuReDmE-main-dev

Copy link
Copy Markdown

Phase 3 SDK review note from the RFC side.

The Go API direction is right: TifScore, TifClassification, ComputeTifScore, TifScoreFromMetadata, and EvaluateTif() match the helper pattern from the other SDKs.

I would keep this draft blocked for two reasons:

  1. PR state is currently CONFLICTING and there are no checks reported yet.
  2. The T-I-F math must be aligned with MCP and the other SDKs before merge/release. This implementation appears to use raw feedback proportions, while dakera-mcp#123 currently adds thin-evidence base indeterminacy for feedback_count < 3. No-feedback classification also needs to be identical everywhere.

Suggested acceptance gate: add shared golden vectors across Python/JS/Rust/Go/MCP and verify the exact same truth, indeterminacy, falsity, classification, and feedback_count for each vector.

Once the conflict is resolved, checks are green, and parity is locked, this should be a good Go-side Phase 3 helper.

@ferhimedamine ferhimedamine force-pushed the feat/tif-reliability-helpers branch from 919ea07 to 636c085 Compare June 13, 2026 00:08
…6566)

Aligns Go 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/JS/Rust
- Add 3 thin-evidence unit tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@SeCuReDmE-main-dev

Copy link
Copy Markdown

@ferhimedamine final Phase 3 review complete from my side for the Go SDK PR.

I rechecked the current PR state and the DAK-6566 parity fixes. The previous blockers are resolved:

  • CI is green.
  • PR is mergeable.
  • no-feedback now maps to ask_clarification.
  • thin-evidence base indeterminacy is present.
  • the 8 golden vectors are present and cover the canonical T-I-F v1 contract.
  • 3 downvote + 3 flag correctly prioritizes surface_contradiction.
  • metadata reliability parsing remains backward compatible with Phase 1 / Phase 2.

This is review-ready from my side. No further requested changes from me.

@ferhimedamine ferhimedamine marked this pull request as ready for review June 13, 2026 02:46
@ferhimedamine ferhimedamine added the auto-merge Auto-merge when CI passes label Jun 13, 2026
@ferhimedamine ferhimedamine merged commit 9bd4c54 into main Jun 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Auto-merge when CI passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants