test(go): domain schema + errors — Python parity + UTC/customer_escalation divergence locks#94
Open
couragehong wants to merge 1 commit intofeat/go-migrationfrom
Open
Conversation
…_escalation divergence locks
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/domain/{schema,errors}_test.go신규. 테스트 only, production 코드 변경 없음.policy/{rerank,novelty})에 이은 follow-up —domain/{schema,errors}.go도 PR #90으로 들어왔으나 테스트 0건. silent regression 위험 closing.agents/tests/test_record_builder.py:L167-188단 1 case 포팅 +decision_record.py / errors.py / record_builder._parse_domain(Python 측 unit test 사실상 0건)에 first-time 커버리지.Python 대비
_parse_domain(record_builder.py:L621-655)customer_escalation→CustomerSuccess, Go→General)generate_record_id/generate_group_idvalidate_evidence_certainty(read-only)ensure_evidence_certainty_consistencyembedding_text_for_recordmake_errorPython ↔ Go divergence witness (Phase-A debt locked at test layer)
production 차원에서 align할지 추후 결정할 두 건을 테스트가 명시적으로 락:
TestParseDomain_CustomerEscalationDivergesFromPython: Pythonrecord_builder.py:L646이customer_escalation → CUSTOMER_SUCCESSalias 보유. Go 미보유 →DomainGeneralfallback. 테스트가 Go 동작 락 + TODO 주석 + fix recipe.TestGenerateRecordID_NonUTCTimestamp_DivergesFromPython+_UTCBoundaryShiftsDate_DivergesFromPython: Pythondecision_record.py:L247이timestamp.strftime(LOCAL TZ); Go schema.go:L266이ts.UTC().Format(강제 UTC). KST 00:30 → Python "2026-04-29" / Go "2026-04-28". 테스트가 Go의 UTC normalization 락 + TODO + production 임팩트 코멘트 (cross-team recall 모호성).errors.As-기반 wrap unwrap (TestMakeError_WrappedRuneErrorUnwrapsViaErrorsAs_GoSpecific)은 Go 전용 enhancement — Pythonisinstance비공개 unwrap 안 함. 이름·코멘트로 명시.강화 포인트 (Python 미가드)
_AllNineteenEnumsRoundTrip(탑 레벨 락) + paired-swap 가드는 별도_WireValues위임 (자체 코멘트로 명시)ops_security→ security,data_design→ design)결정_사항_검토),email@foo.com(전체 단어 drop),my_var(underscore variant 유지),___(all-underscores → 빈 strip → drop)_ "time/tzdata"임포트로 alpine/scratch에서도 LoadLocation 안전Validation
go test -count=1 -race ./internal/domain/→ ok 1.4s, 33 함수 / 129 subtestgofmt -l(이 PR 신규 파일) → cleango vet ./...→ clean_ "time/tzdata"/ nil 테스트 삭제 등) + LOW 3.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
customer_escalationalias + UTC normalization 두 divergence는 Go 동작을 lock. Python parity 원하면 별도 production-fix PR —schema.go::domainList에{"customer_escalation", DomainCustomerSuccess}(customer_success 앞) 추가 /GenerateRecordID의.UTC()호출 제거. 두 건 모두 cross-team 결정이 필요한 사안 (UTC normalization은 cross-team recall 일관성 vs Python parity trade-off).recovery_hint비-replicated): Go 의Err*predefined vars는 Code+Retryable만 보유 (Message/RecoveryHint는 빈 placeholder). Python errors.py L38-89의 rich hint 텍스트는 caller가 채우는 형태로 위임. 이 PR은 그 design choice 자체를 락하지는 않음 — 별도 결정 필요 시_CodeAndRetryableMatchPython에 hint 검증 추가.lifecycle/shutdown_test.go(InflightTracker concurrency + ZeroizeDEK dead-store 가드 + GracefulShutdown timeout). 이후adapters/vault/endpoint_test.go(URL parsing edge case 보강).🤖 Generated with Claude Code