[PR #6138] [MERGED] feat(environment): spell a written clock as each view spells it #7154

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6138
Author: @earakely-scale
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @gensokyo-dev

Base: main ← Head: feat/environment-view-clock-spelling


📝 Commits (10+)

  • ad439bd feat(environment): extract the initial state a capture's reads observed
  • 7a668b7 Merge main into feat/environment-state-view
  • f2c9a2e fix(environment): bound state at redacted writes; infer identity only from items
  • 2999128 fix(environment): keep first sightings, one list pointer and linear field unions
  • a5c7b92 fix(environment): keep post-write values and partial lists out of the initial state
  • 4e93547 docs(environment): scope item-shaped and deleted written paths out of documents
  • aba9cb1 fix(environment): count writes in flight when a value changes between reads
  • 856c8c0 Merge main into feat/environment-state-view
  • 55480bd chore: merge main (5fa4defc) into environment state view
  • 9fee36d fix(environment): catch cross-tool changes across writes; read only item totals

📊 Changes

16 files changed (+619 additions, -44 deletions)

View changed files

📝 docs/agent-environments.md (+5 -0)
📝 docs/specs/agent-environments/state-view/spec.md (+9 -0)
➕ docs/specs/agent-environments/view-clock-spelling/plan.md (+8 -0)
➕ docs/specs/agent-environments/view-clock-spelling/spec.md (+37 -0)
➕ docs/specs/agent-environments/view-clock-spelling/tasks.md (+9 -0)
➕ docs/specs/agent-environments/view-clock-spelling/verification.md (+44 -0)
📝 src/application/environment/environmentStateWriteAnswer.test.ts (+15 -0)
➕ src/domain/analysisView/environmentStateGate.test.ts (+118 -0)
📝 src/domain/analysisView/environmentStateGate.ts (+114 -15)
📝 src/domain/analysisView/environmentStateRules.ts (+18 -2)
📝 src/domain/analysisView/environmentStateView.test.ts (+17 -0)
📝 src/domain/analysisView/environmentStateView.ts (+15 -9)
📝 src/domain/analysisView/environmentStateWriteValues.test.ts (+56 -7)
📝 src/domain/analysisView/environmentStateWriteValues.ts (+64 -11)
📝 src/domain/analysisView/environmentStateWrites.test.ts (+65 -0)
📝 tests/fixtures/environmentStateWrites.ts (+25 -0)

📄 Description

Summary

Refs #4933. Preserve each view's recorded clock spelling for newly written local state. Item/list analysis and serving use the same renderer; existing recorded per-view values are unchanged. Adds optional clock_formats with at most nine fraction digits. No target execution or remote application writes.

Initially integrated onto main 7ec9b6e56; refreshed onto 5bda0a7dc, preserving the author's concurrent heap-floor fix, preserving the merged list-query, whole-proof, omission and projection behavior. Fixed all three existing review findings at their owners: the clock parser retains exact sub-millisecond facts; one per-field learner replaces growing format histories with a single format/mixed marker; and retained maps, keys, formats and returned members are charged before retention. Preliminary query probes do not learn clock state. Rendering reuses parsed precision instead of reparsing source text. No speculative cache or second adapter implementation.

Executed validation

  • 755 related source tests passed, including exact micro/nanosecond inequality, equivalent offsets/trailing zeros, learner/output tight-budget checks and constant retained state at 4 versus 1024 incompatible formats. The original precision and budget guards failed before the fixes; positive controls passed.
  • 67 real compiled CLI/MCP boundary tests passed: serving/export/compare, retained Evidence, named advertised output contracts, JSON Schema validity and compact schemas.
  • check:fast (typecheck/lint), formatting, metadata and architecture guards passed. An initial full check stopped on a duplicate export also reproduced on unmodified main 7ec9b6e56. Main subsequently fixed it independently; after syncing, the complete full check passed (all six tasks plus architecture guards), as did ten latest-main focused serving/gate tests. Docs check and discovery of all 2053 tests passed. One push hook accidentally used system Node 20; rerun with pinned Node 24 is recorded separately, not counted as a code failure.
  • Independent local Codex CLI source review found no definite new defects in the integrated/fixed boundaries. This is automated review, not a human attestation.
  • Five pinned public capture Evidence datasets (Directus/Homebox/Mealie/Keycloak/Shlink) ran through compiled CLI and stdio MCP with named output schema validation, exact adapter fact/Evidence-ID parity and source-byte SHA-256 checks. Only Mealie's state changes versus main: its recipe list learns three +00:00 clock formats; every served-write verdict is unchanged. No live applications were executed.
  • Complete fresh-process five-capture task under concurrent host load: main 48.10 s wall / 70.53 s CPU / 1158 MiB sampled process-family RSS; candidate 47.11 s / 69.33 s / 1151 MiB, no surviving child processes. One pair, 500 ms RSS sampling, filesystem caches not cleared: no exact-peak, cold-cache, speedup or model-token reduction claim. The format learner's retained state is bounded per field, not per distinct format.

Limitations

Public captures qualify retained-data analysis, not live application persistence, the author's full historical 50-capture census, or real native-provider/Windows behavior. Full author experiments remain in docs/specs/agent-environments/view-clock-spelling/verification.md and were not independently rerun in full. Existing epoch rendering semantics remain unchanged; exact ISO fraction preservation is verified through nanoseconds.

Author readiness

Human owner: @earakely-scale

  • 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.

🔄 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/6138 **Author:** [@earakely-scale](https://github.com/earakely-scale) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `feat/environment-view-clock-spelling` --- ### 📝 Commits (10+) - [`ad439bd`](https://github.com/morluto/rea/commit/ad439bd2f26c61b442dcf758c2bb149e49657929) feat(environment): extract the initial state a capture's reads observed - [`7a668b7`](https://github.com/morluto/rea/commit/7a668b73f4783b42eb0e8ce1eeff079f86d53e22) Merge main into feat/environment-state-view - [`f2c9a2e`](https://github.com/morluto/rea/commit/f2c9a2e4462a7162224bec209f21dfa2622abe39) fix(environment): bound state at redacted writes; infer identity only from items - [`2999128`](https://github.com/morluto/rea/commit/2999128baedceabc738e9a5aa69bfcfec39a55f1) fix(environment): keep first sightings, one list pointer and linear field unions - [`a5c7b92`](https://github.com/morluto/rea/commit/a5c7b9236c48094bc4af24ae055e8d67e3968477) fix(environment): keep post-write values and partial lists out of the initial state - [`4e93547`](https://github.com/morluto/rea/commit/4e93547c846444e891e2a2267425c316e6ee5218) docs(environment): scope item-shaped and deleted written paths out of documents - [`aba9cb1`](https://github.com/morluto/rea/commit/aba9cb15c8836b7592a51743d79bceab4dfd99af) fix(environment): count writes in flight when a value changes between reads - [`856c8c0`](https://github.com/morluto/rea/commit/856c8c0b50ec11e4ba96cb6172b7cfe01ef6829f) Merge main into feat/environment-state-view - [`55480bd`](https://github.com/morluto/rea/commit/55480bdf7e3275e3be8903e53baabe28be81a9a9) chore: merge main (5fa4defc) into environment state view - [`9fee36d`](https://github.com/morluto/rea/commit/9fee36d3155145fa8e568b34713e0e68c7675216) fix(environment): catch cross-tool changes across writes; read only item totals ### 📊 Changes **16 files changed** (+619 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `docs/agent-environments.md` (+5 -0) 📝 `docs/specs/agent-environments/state-view/spec.md` (+9 -0) ➕ `docs/specs/agent-environments/view-clock-spelling/plan.md` (+8 -0) ➕ `docs/specs/agent-environments/view-clock-spelling/spec.md` (+37 -0) ➕ `docs/specs/agent-environments/view-clock-spelling/tasks.md` (+9 -0) ➕ `docs/specs/agent-environments/view-clock-spelling/verification.md` (+44 -0) 📝 `src/application/environment/environmentStateWriteAnswer.test.ts` (+15 -0) ➕ `src/domain/analysisView/environmentStateGate.test.ts` (+118 -0) 📝 `src/domain/analysisView/environmentStateGate.ts` (+114 -15) 📝 `src/domain/analysisView/environmentStateRules.ts` (+18 -2) 📝 `src/domain/analysisView/environmentStateView.test.ts` (+17 -0) 📝 `src/domain/analysisView/environmentStateView.ts` (+15 -9) 📝 `src/domain/analysisView/environmentStateWriteValues.test.ts` (+56 -7) 📝 `src/domain/analysisView/environmentStateWriteValues.ts` (+64 -11) 📝 `src/domain/analysisView/environmentStateWrites.test.ts` (+65 -0) 📝 `tests/fixtures/environmentStateWrites.ts` (+25 -0) </details> ### 📄 Description ## Summary Refs #4933. Preserve each view's recorded clock spelling for newly written local state. Item/list analysis and serving use the same renderer; existing recorded per-view values are unchanged. Adds optional clock_formats with at most nine fraction digits. No target execution or remote application writes. Initially integrated onto main 7ec9b6e56; refreshed onto 5bda0a7dc, preserving the author's concurrent heap-floor fix, preserving the merged list-query, whole-proof, omission and projection behavior. Fixed all three existing review findings at their owners: the clock parser retains exact sub-millisecond facts; one per-field learner replaces growing format histories with a single format/mixed marker; and retained maps, keys, formats and returned members are charged before retention. Preliminary query probes do not learn clock state. Rendering reuses parsed precision instead of reparsing source text. No speculative cache or second adapter implementation. ## Executed validation - 755 related source tests passed, including exact micro/nanosecond inequality, equivalent offsets/trailing zeros, learner/output tight-budget checks and constant retained state at 4 versus 1024 incompatible formats. The original precision and budget guards failed before the fixes; positive controls passed. - 67 real compiled CLI/MCP boundary tests passed: serving/export/compare, retained Evidence, named advertised output contracts, JSON Schema validity and compact schemas. - check:fast (typecheck/lint), formatting, metadata and architecture guards passed. An initial full check stopped on a duplicate export also reproduced on unmodified main 7ec9b6e56. Main subsequently fixed it independently; after syncing, the complete full check passed (all six tasks plus architecture guards), as did ten latest-main focused serving/gate tests. Docs check and discovery of all 2053 tests passed. One push hook accidentally used system Node 20; rerun with pinned Node 24 is recorded separately, not counted as a code failure. - Independent local Codex CLI source review found no definite new defects in the integrated/fixed boundaries. This is automated review, not a human attestation. - Five pinned public capture Evidence datasets (Directus/Homebox/Mealie/Keycloak/Shlink) ran through compiled CLI and stdio MCP with named output schema validation, exact adapter fact/Evidence-ID parity and source-byte SHA-256 checks. Only Mealie's state changes versus main: its recipe list learns three +00:00 clock formats; every served-write verdict is unchanged. No live applications were executed. - Complete fresh-process five-capture task under concurrent host load: main 48.10 s wall / 70.53 s CPU / 1158 MiB sampled process-family RSS; candidate 47.11 s / 69.33 s / 1151 MiB, no surviving child processes. One pair, 500 ms RSS sampling, filesystem caches not cleared: no exact-peak, cold-cache, speedup or model-token reduction claim. The format learner's retained state is bounded per field, not per distinct format. ## Limitations Public captures qualify retained-data analysis, not live application persistence, the author's full historical 50-capture census, or real native-provider/Windows behavior. Full author experiments remain in docs/specs/agent-environments/view-clock-spelling/verification.md and were not independently rerun in full. Existing epoch rendering semantics remain unchanged; exact ISO fraction preservation is verified through nanoseconds. ## Author readiness Human owner: @earakely-scale - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer 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:45:46 +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#7154
No description provided.