Skip to content

fix: freeze denominator-aligned unit field contract - #24

Merged
kamjcx merged 3 commits into
mainfrom
codex/unit-field-contract-v1
Sep 5, 2026
Merged

kamjcx merged 3 commits into
mainfrom
codex/unit-field-contract-v1

Conversation

@kamjcx

@kamjcx kamjcx commented Sep 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • define resolved_activity_value/unit as the authoritative factor-denominator-aligned application quantity
  • correct resolved_quantity_kg to mean kilograms only and keep it null for non-mass activity
  • normalize gCO2e/kgCO2e/tCO2e preview numerators to kgCO2e
  • fail closed on denominator mismatch, inconsistent mass kilograms (including tiny values and legacy missing dimensions), and non-finite recomputed totals
  • align evidence-backed reference-flow mass to /g, /kg, or /t before approval and locking
  • preserve historical locked snapshots and the PR-A production response allowlist

Scope

This is an independent stacked PR based on PR #23 at 2f6b52c9effda67a73862b9dca1d3d88487cd8a7. It does not change retrieval, ranking, aliases, qualification, factor values, candidate IDs, frozen answers, or approval decisions. It does not merge PR #23.

Verification

  • exact head: 24cf05884cc29358ceb57eeece42ed4585eb466a
  • 572 tests passed; 87.16% branch coverage
  • focused independent adversarial QA: 118 passed; P0/P1/P2 = 0
  • Harness: 13 passed; 43.35% branch coverage
  • evaluator critical path: 6 passed; 84.18% branch coverage
  • Ruff, mypy, compileall: PASS
  • FactorBench V1/V2/V3: completed
  • Frozen Unit Regression: 28/28
  • Sealed Unit v2: 32/32
  • Sealed Unit v4: 21/21
  • Portfolio and Autonomous quality gates: PASS
  • public delivery scan and package build/archive isolation: PASS
  • exact-head remote CI: 8/8 successful, including independent Linux container build, health and scan gate

QA history

The first independent QA pass found one reference-flow alignment issue, an inconsistent-kg lock gap, and a finite-input overflow gap. The second pass found tiny-value tolerance, missing-dimension and legacy-fallback variants. These failures remain preserved in review history. The third exact-head re-review at 24cf0588 passed with no P0/P1/P2 or residual P3 findings.

@kamjcx
kamjcx changed the base branch from codex/api-safety-contract-v1 to main September 5, 2026 05:43
@kamjcx
kamjcx merged commit f6a7c40 into main Sep 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant