Conversation
Moves the provider-neutral judgement contract out of fingers/judge so fingers keeps only fingerprint claims: - Claim / Option / Outcome / Ruling, Claim.Resolve, ValidateClaims and ValidateRulings: a Provider picks one finite option per claim with a confidence; Resolve is the only interpretation of that pick. - Provider interface and jev.Judge, which validates a batch, freezes the evidence as JSON once and validates the complete answer. - Cached: exact LRU over whole batches with coalescing of identical concurrent requests; failures are never cached. - Client: the TypeSafe Jev (System One) HTTP provider, with retry on 429/529 and DefaultMinConfidence 0.3 calibrated for jev-1.13.0. go 1.17, standard library only. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
背景
fingers 的判定层(chainreactors/fingers#35)里有一套与指纹无关的通用机制:Claim 合约、校验、缓存和 Jev HTTP 客户端。这些不应该作为新抽象留在 fingers 中,因此下沉为 utils 的独立模块
github.com/chainreactors/utils/jev,fingers 只保留指纹相关的断言。内容
Claim/Option/Outcome(holds / refuted / insufficient)/Ruling。每个 Claim 必须显式提供insufficient弃权选项。Claim.Resolve(ruling, minConfidence)是唯一的语义解释入口,低置信度解析为 Insufficient,但保留原始选项。ValidateClaims、ValidateRulings。非法或缺失的回答算错误,不算证据不足。Provider接口和jev.Judge(ctx, p, state, claims)。它校验输入,把证据冻结为 JSON,并校验完整回答。Cached(p, capacity)对完整批次做精确 LRU,并合并并发的相同请求;失败的批次不缓存。Client/NewClient对接 TypeSafe Jev(System One),遇到 429/529 按指数退避重试。DefaultMinConfidence = 0.3是针对 jev-1.13.0 在 69 页验收集上标定的值。模块为 go 1.17,只依赖标准库。说明见
jev/README.md。测试
go vet、go test通过go test -race通过测试内容覆盖合约校验、弃权、缓存(淘汰、失败不缓存、并发合并与取消),以及 HTTP 线上格式和 confidence 必填。
关联
Framework.Judge字段🤖 Generated with Claude Code