test(go): policy rerank + novelty — formula / sort / Python parity gates#92
Open
couragehong wants to merge 1 commit intofeat/go-migrationfrom
Open
test(go): policy rerank + novelty — formula / sort / Python parity gates#92couragehong wants to merge 1 commit intofeat/go-migrationfrom
couragehong wants to merge 1 commit intofeat/go-migrationfrom
Conversation
Open
4 tasks
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
internal/policy/{novelty,rerank}_test.go신규. 테스트 only, production 코드 변경 없음.policy/{novelty,rerank}.goproduction을 들고 왔으나 테스트 0건. PR yg/phase a6 policy query tests #91 (query_*.go)에 이은 follow-up — silent regression 위험을 closing.agents/tests/test_novelty_check.py5 케이스 포팅 +searcher.py:L273-300, L523-559(Python 측 unit test 0건)에 first-time 커버리지.Python 대비
test_novelty_check.py(5 cases)searcher.py::_apply_recency_weightingsearcher.py::_filter_by_timeHALF_LIFE_DAYS / SIM_W / REC_W / STATUS_MULTIPLIER / TimeRanges강화 포인트 (Python 미가드)
Score=0.5+decay=1.0(bracket=0.65) → weight swap(0.3raw + 0.7decay)회귀 잡음 (기존엔 1.0×statusMul로 swap이 통과해버림)math.Floorage 1.5d → 1d (Pythontimedelta.daysint truncation parity)AdjustedScore정렬: raw≠adjusted 구별 (old_top_raw 0.99/900dvsfresh_top_raw 0.99/0d— sort-by-raw mutation은 stable tie 입력순으로 다른 결과)time.RFC3339Nano(nanosecond 경계 정확 — 기존RFC3339은 sub-second 잘려서 1초 경계로 둔갑)Python ↔ Go divergence witness
production
rerank.go/novelty.go의 Phase-A debt 두 건을 테스트 차원에서 명시 lock:banker_round_diverges_from_python(sim=0.12355): Pythonroundbanker's → 0.8764 / Gomath.Roundaway-from-zero → 0.8765 (Go semantics lock, TODO 주석)int_timestamp_90d_diverges_from_python(90d-oldintts): Pythonfloat(int)coerce → adj=0.85 / Go type-switch skip → adj=1.0 (Go semantics lock, JSON 와이어는 float64라 production unreachable; raw int caller만 영향)Validation
go test -count=1 -race ./internal/policy/→ ok 1.5s, 19 함수 / 77 subtestgofmt -l(이 PR 신규 파일) → cleango vet ./...→ cleanone_ns_older1초 → ns / FormulaGate Score≠1.0 / Status bracket≠1.0 / int divergence) + MED 5 (Future 30d / Sort raw≠adjusted / WireValues paired-swap / wrong_type symmetry / Mutates 2 hits) + parity 3 (banker /+00:00/ empty string). citation 1건은 auditor 오류 (mcp/server/server.py위치 정확) 검증 후 기각.Cross-Agent Invariants
테스트 파일 2개만 추가. scripts/bootstrap-mcp.sh, agent 스크립트, Codex/Claude/Gemini/OpenAI 지시서, SKILL.md, commands/rune/*.toml, AGENT_INTEGRATION.md 모두 미수정 → 모든 invariant trivially 만족.
Notes for Reviewers
int_timestamp_90d_diverges_from_python+banker_round_diverges_from_python두 건은 현재 Go 동작을 lock-in. Python parity 원하면 별도 production-fix PR (rerank.gotype switch에case int:추가 /novelty.gomath.Round → banker's helper). 두 건 모두 production wire (JSON-decoded float64 / D11 thresholds 0.3/0.7/0.95)에서는 unreachable.one_ns_older정정): 기존 self-review 단계엔time.RFC3339로 작성되어 sub-second 잘림 → 실제로 1초 차였음.RFC3339Nano로 수정하면서 nanosecond 경계 정확 검증.domain/schema_test.go(ParseDomain customer_escalation alias divergence + 한글 GenerateRecordID + EnsureEvidenceCertaintyConsistency 3 path) ·lifecycle/shutdown_test.go(InflightTracker concurrency + ZeroizeDEK dead-store 가드).🤖 Generated with Claude Code