fix(consult): pass birth-time accuracy instead of treating every chart as unrectified #49
Closed
jesse
wants to merge 0 commits from
codex/consultation-birth-accuracy-20260901 into staging
pull from: codex/consultation-birth-accuracy-20260901
merge into: root:staging
root:main
root:codex/report-writer-failure-20260902
root:staging
root:codex/rectification-question-in-message-20260902
root:codex/report-blocked-repairs-20260902
root:codex/fix-rectification-duplicate-collect-20260902
root:codex/rectification-ux-20260902
root:codex/unified-loading-20260902
root:codex/streaming-ux-20260901
root:codex/agent-voice-20260901
root:codex/rectification-tails-20260901
root:codex/rectification-provisional-adopt-20260901
root:codex/frontend-optimization-20260828
root:codex/diagnose-rectification-request-20260827
root:codex/staging-skill-style-present-20260820
root:codex/fix-sidebar-contract-ci-20260820
root:codex/rectification-p0-p1-20260820
root:codex/fix-report-scroll-product-admin-20260818
root:codex/fix-daily-starlanguage-guard-20260818
root:codex/ui-optimize-staging-20260817
root:codex/remove-admin-step-up-20260816
root:codex/fix-rectification-focus-baseline
root:codex/pr8-local-gate-closure
root:codex/pr8-evals-observability
root:codex/pr7-product-domain-registry
root:codex/pr6-report-document-v2
root:codex/pr5-report-evidence-bundle-v2
root:codex/pr4-rectification-event-contract-v2
root:codex/pr3-rectification-v10
root:codex/pr2-final-response
root:codex/pr1-skill-registry
root:codex/fix-rectification-home-new-session-20260812
root:codex/fix-rectification-turn-projection-20260812
root:codex/rectification-same-turn-confirm-20260812
root:codex/fix-rectification-current-turn-binding-20260812
root:codex/fix-rectification-history-hydration-20260812
root:codex/rectification-activity-birth-context-20260812
root:codex/fix-rectification-free-settlement-20260811
root:codex/fix-rectification-case-context-20260811
root:codex/fix-rectification-session-model-20260811
root:codex/fix-feature-flag-admin-runtime-policy-20260811
root:codex/staging-gate-repair-20260811
root:codex/admin-account-reset
root:codex/agentic-consultation-runtime
root:codex/production-selfhosted-migration
root:docs/correct-report-smoke
root:docs/close-staging-release-acceptance
root:fix/staging-admin-verification-host
root:fix/staging-public-verification-race
root:fix/staging-gate-build-timeout
root:fix/staging-gate-retry-and-admin-audit
root:fix/staging-gate-checkout-retry
root:docs/close-staging-controller-incident
root:fix/staging-gate-attested-controller
root:fix/staging-controller-fetch-timeout
root:docs/personal-report-staging-acceptance
root:fix/staging-ssh-secret-and-env-owner
root:docs/record-staging-env-owner-drift
root:docs/record-staging-host-key-rotation
root:feat/one-way-skill-personal-report
root:codex/fix-staging-artifact-resolution-20260805
root:codex/fix-vendored-artifact-inputs-20260805
root:codex/run-vendored-artifact-uploader-20260805
root:codex/fix-local-artifact-inputs-20260805
root:codex/internal-gitea-artifact-action-20260805
root:codex/use-gitea-artifact-action-20260805
root:codex/fix-gitea-artifact-upload-20260805
root:codex/fix-gitea-manifest-auth-20260805
root:codex/integrate-github-main-gitea-20260805
root:revert/staging-from-main
root:delivery/payment-package-epay
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "codex/consultation-birth-accuracy-20260901"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
declared_accuracy/time_sourcefrom profile truth instead of letting the engine default every chart tominute+family_clear→'5min'with a missing matrix row.rectification.boundaryfollows the engine gate (precision_ok/precision_annotated/not_auto_rectified) instead of hardcodingnot_auto_rectifiedon every natal consult.'5min'varga row and grades 5min/15min copy as precision annotation, not candidate-window interaction. Hospital/rectifiedstay precise.Fixes BUG-467. Task brief:
TASK-consultation-birth-accuracy-20260901.md. Baseline containedff97de5e; branch isorigin/staging@8b7eda9fplus this fix (56daf6be).Task 0 — before (red) evidence
Frontend
tsx --test tests/consultation-birth-accuracy.test.ts tests/consultation-birth-time-mode.test.ts:declared_accuracywasundefinedvs'rectified'/'minute'; mapper not exporteddeclared_birth_window/general_no_birth_timeskip natal mapper; existing birth-time-mode guard suite stayed green;output guards and window/general instruction seams stay byte-stablePython
pytest tests/test_consultation_birth_accuracy.py:.FF.→ 2 fail / 2 pass可读主盘,但高敏分盘需要降级;get_enabled_vargas('5min') == unknown(minute, hospital)andrectifiedengine pathsAfter — per-suite counts
Typecheck
cd frontend && ./node_modules/.bin/tsc --noEmit→ exit 0 (228s warm). Coldtsc --noEmit --incremental falsealso exit 0 (1045s). Notnpx tsc.Frontend (fail=0 for product paths)
tests/consult*.test.ts(this glob also matchesconsultation-*)tests/consultation-*.test.tstests/chat*.test.tstests/rectification-*.test.tsnon-DBtests/rectification-*-database.test.tsserial + retryOfficial combined glob (
consult*+consultation-*+chat*+rectification-*) is 1035 unique tests (3consult-*+ 222 + 70 + 740). Parallel run was 1028/7 because Docker only allows 2 compose networks; the 7 failures were fixture-slot / migrate flake under contention. Serial ingest+PR-4+v9 DB: 7/10 then the 3 remaining retried 3/3. Combined fail=0.Core accuracy+guards after the fix:
consultation-birth-accuracy+consultation-birth-time-mode+consultation-route-service+consultation-context= 34/34.Python (
.venv)pytest tests/test_consultation_birth_accuracy.py tests/test_consultation_consumer_context.py tests/test_rectification_*.py→ 168 passed, exit 0._expand_pytest_targetsnail:test_staging_quick_gate_runs_rectification_python_suitepass.Red line 1 —
'rectified'only for accepted/confirmed + active timeMapper
declaredBirthAccuracyFromProfile:birth_time_status ∈ {accepted, confirmed}andactive_birth_timerectifiedrectifiedhospital_record(not adopted)minutehospitalfamily_exactminutefamily_clear→ engine'5min'15minfamily_vagueProof tests in
frontend/tests/consultation-birth-accuracy.test.ts:accepted/confirmed+ active time →{ declaredAccuracy: "rectified", timeSource: "rectified" }accepted+ no active time → notrectifiedcandidatehospital + active time → notrectified(staysminute/hospital)reportedfamily_exact + active time → notrectifiedminute/hospitaland neverrectifiedWindow/general modes never call this mapper (
serverChartis null; theirtoolInputhas no accuracy fields).Red line 2 — guards and window/general two-tier behavior unchanged
git diff origin/staging -- frontend/src/lib/timing-output-guard.tsis empty.guardPreciseTimingOutputnot edited.createBirthTimeModeOutputGuardbody is unchanged:general_no_birth_time→guardGeneralNoBirthTimeOutput;declared_birth_windowor!canAnswerPreciseTiming→guardPreciseTimingOutput.generalNoMinuteInstruction/declaredWindowInstructionnot in the consult/route.ts diff (only an extrabirthTimeSourceargument toapplyBirthTimeModeToWorkflowContext).UNVERIFIED_BIRTH_TIME_NOTICEstring is unchanged; grading is a newunverifiedBirthTimeNotice()wrapper, not a guard change.rectification: { boundary: "not_auto_rectified" }inconsultation-tools.ts(declared-window path).consultation-birth-time-modetests green while the four natal-accuracy invariants were red. After: same byte-stable test still matches those instruction strings and guard branches.Before / after workflow consumption
Before (every natal consult): no
declared_accuracyontoolInput; engine default'5min'+ missing matrix; mastrarectification.boundary = "not_auto_rectified"; model instructed to treat that as final → “未校正 / 按时间范围交互”.After (engine
_compute_rectification_gate+_build_consumer_context):(minute, hospital)minute{}rectifiedrectified{}'5min'5minbirth_time_precision_boundaryonly'15min'15minbirth_time_precision_boundaryonly1hour1hourbirth_time_uncertainty_boundary+not_auto_rectifiedMastra natal boundary:
minute/rectified+ no lagna sensitivity →precision_ok;5min/15min+ no lagna →precision_annotated; else fail-closednot_auto_rectified.Why family_exact stays
'5min'(product check)ACCURACY_RULES[('minute', 'family_clear')] = '5min'is skill methodology: family memory is not a hospital record. This task does not promote family_exact to'minute'. D10 stays enabled on the new'5min'row so career consults are not crippled. Please confirm product still wants that one-step downgrade vs hospital.Honest verification gap
Not verified on a live staging/production consult. Recommend folding into the PR #47 nine-step probe, plus one extra check: a
hospital_recordexact-minute user must not be told the time is unrectified or to interact by range.Test plan
tsc --noEmitexit 0_expand_pytest_targetsnailaccepted/confirmed+ active time) is not told the time is unrectifiedPull request closed