[PR #6902] [CLOSED] fix(environment): preserve literal early ISO years #7434

Closed
opened 2026-11-01 21:47:49 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6902
Author: @harshitethic
Created: 10/23/2026
Status: ❌ Closed

Base: main ← Head: fix/environment-early-iso-years


📝 Commits (1)

  • f9977cc fix(environment): preserve literal early ISO years

📊 Changes

3 files changed (+64 additions, -6 deletions)

View changed files

📝 src/domain/analysisView/environmentStateWriteValues.test.ts (+19 -0)
📝 src/domain/analysisView/environmentStateWriteValues.ts (+5 -6)
📝 tests/boundary/cli/environmentCompareCli.test.ts (+40 -0)

📄 Description

Summary

Fixes #6835. Valid ISO timestamps in years 0000–0099 were rejected because Date.UTC remaps those numeric years into 1900–1999. Consequently respellClock returned the original text, and environment-compare classified spelling differences as ordinary value differences.

Set the literal UTC calendar year on the shared clock reader's Date object before setting the time. Retain the existing calendar round-trip validation, offset handling, and fractional precision. The public CLI now reports clock-format for the year-0001 regression.

Validation

Linux x64, pinned Node 24.22.1/npm 11.16.0, locked dependencies; based on upstream 34563fcc9bd92af30668820dcac5635e27181094.

  • Before the production fix, the two regression files reported 4 failures / 110 passes: three early-year readings returned undefined and the compiled public CLI returned value instead of clock-format.
  • After the fix, 291 tests passed across 6 files, covering the reader, clock inference/gates, environment comparison, and compiled CLI.
  • New cases cover year 0000's leap day, year 0001, offset rollover from 0099 into 0100, nanosecond retention, and invalid early-year dates. Year 0100 remains a passing control.
  • npm run check, npm run verify:test-discovery, and git diff --check passed. Commit hooks left the tested tree unchanged.
  • Published tree e0b212a313268d6b1b0ad997dc8fc444abd8ec14 exactly matches the tested local tree.
Focused validation command
npm run test:focused -- src/domain/analysisView/environmentStateWriteValues.test.ts src/domain/analysisView/environmentStateWriteExplain.test.ts src/domain/analysisView/environmentStateGate.test.ts src/application/environment/environmentCompareDiff.test.ts src/application/environment/environmentCompare.test.ts tests/boundary/cli/environmentCompareCli.test.ts

No new target interaction, provider behavior, package metadata, or generated schema changes. Tests use synthetic capture Evidence and temporary files. Full deterministic CI, other platforms, installed-package/MCP replay, and generated-document checks were not run for this change; local results do not establish upstream CI success.

Author readiness

Human owner: @harshitethic

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

AI-assisted draft pending human review.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6902 **Author:** [@harshitethic](https://github.com/harshitethic) **Created:** 10/23/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/environment-early-iso-years` --- ### 📝 Commits (1) - [`f9977cc`](https://github.com/morluto/rea/commit/f9977cc42ef1f9fbc5d58b9c823f9cc7474dea3a) fix(environment): preserve literal early ISO years ### 📊 Changes **3 files changed** (+64 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/analysisView/environmentStateWriteValues.test.ts` (+19 -0) 📝 `src/domain/analysisView/environmentStateWriteValues.ts` (+5 -6) 📝 `tests/boundary/cli/environmentCompareCli.test.ts` (+40 -0) </details> ### 📄 Description ## Summary Fixes #6835. Valid ISO timestamps in years 0000–0099 were rejected because `Date.UTC` remaps those numeric years into 1900–1999. Consequently `respellClock` returned the original text, and `environment-compare` classified spelling differences as ordinary value differences. Set the literal UTC calendar year on the shared clock reader's Date object before setting the time. Retain the existing calendar round-trip validation, offset handling, and fractional precision. The public CLI now reports `clock-format` for the year-0001 regression. ## Validation Linux x64, pinned Node 24.22.1/npm 11.16.0, locked dependencies; based on upstream `34563fcc9bd92af30668820dcac5635e27181094`. - Before the production fix, the two regression files reported **4 failures / 110 passes**: three early-year readings returned undefined and the compiled public CLI returned `value` instead of `clock-format`. - After the fix, **291 tests passed across 6 files**, covering the reader, clock inference/gates, environment comparison, and compiled CLI. - New cases cover year 0000's leap day, year 0001, offset rollover from 0099 into 0100, nanosecond retention, and invalid early-year dates. Year 0100 remains a passing control. - `npm run check`, `npm run verify:test-discovery`, and `git diff --check` passed. Commit hooks left the tested tree unchanged. - Published tree `e0b212a313268d6b1b0ad997dc8fc444abd8ec14` exactly matches the tested local tree. <details><summary>Focused validation command</summary> ```sh npm run test:focused -- src/domain/analysisView/environmentStateWriteValues.test.ts src/domain/analysisView/environmentStateWriteExplain.test.ts src/domain/analysisView/environmentStateGate.test.ts src/application/environment/environmentCompareDiff.test.ts src/application/environment/environmentCompare.test.ts tests/boundary/cli/environmentCompareCli.test.ts ``` </details> No new target interaction, provider behavior, package metadata, or generated schema changes. Tests use synthetic capture Evidence and temporary files. Full deterministic CI, other platforms, installed-package/MCP replay, and generated-document checks were not run for this change; local results do not establish upstream CI success. ## Author readiness Human owner: @harshitethic - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. AI-assisted draft pending human review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:47:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7434
No description provided.