[GH-ISSUE #5656] [Bug] Missing console API timestamps are reported as epoch zero #3424

Closed
opened 2026-10-31 00:40:15 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @morluto on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5656

[Bug] Missing console API timestamps are reported as epoch zero

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Process capture or runtime observation

Observed behavior

The inspect-web-page capture owner normalizes a same-origin Runtime.consoleAPICalled event with an absent or non-finite timestamp to timestamp: 0. The console completeness ledger records no invalid_protocol_value exclusion. A real producer value of zero produces the same Evidence, so consumers cannot distinguish missing time from an observed epoch timestamp.

Reproduction

Source-only against REA commit 1629266e3c08c90fed6bba5383528af7986a12b7, using Node.js 24.18.0 and installed playwright-core 1.58.2; no browser, target JavaScript, CLI build, or public CLI/MCP call was used. Instantiate CdpCaptureEvents with inspectWebPageInputSchema.parse({ cdp_endpoint: origin, allowed_origins: [origin], target_id: "page" }), then ingest Runtime.consoleAPICalled with type: "log", args: [], and a stack frame URL under that origin. Repeat once without a timestamp property and once with timestamp: 0.

The captured source-only output for both was timestamp: 0; both completeness snapshots had no console_events exclusion. The exact probe command and output are retained in .cache/codebase-audit/refresh59-cdp-neighbor-timestamps.md and .cache/codebase-audit/refresh59-console/source-red.log.

Expected behavior

Preserve a valid finite producer value exactly, including zero and negative values (the protocol defines a number of milliseconds since epoch). When the required value is absent or invalid, retain the console event with timestamp: null and record console_events as incomplete with invalid_protocol_value; do not synthesize a time.

The owning schema should represent the unknown explicitly. Runtime.consoleAPICalled.timestamp is a CDP Runtime.Timestamp in milliseconds since Unix epoch. It is a separate clock and unit from observe-web-session lifecycle/Network timestamps, which are monotonic seconds.

Impact and scope

The executed source-boundary controls produce a fabricated epoch time for malformed or incomplete console events without marking the section incomplete. Frequency on real browser/provider traffic is unknown; CDP defines the timestamp as required, so this probe does not establish how often a real provider omits it. No consumer behavior or data loss was observed.

REA version

Source commit 1629266e3c08c90fed6bba5383528af7986a12b7 (6.7.0 source line).

Runtime and platform

Node.js 24.18.0; macOS arm64 host. Pinned protocol dependency: playwright-core 1.58.2. No browser was launched.

Target and artifact context

A synthetic, same-origin CDP console event with stack frame URL http://127.0.0.1:43127/app.js; no executable target or external service.

Interface

Other: shared browser capture owner; public CLI/MCP behavior is source-derived, not exercised.

Earliest failure stage

Capture or observation

Relevant output or evidence

The direct producer-owner probe produced these selected fields (full snapshots retained locally):

{"input":"missing timestamp","normalized_timestamp":0,"excluded":[]}
{"input":"timestamp: 0","normalized_timestamp":0,"excluded":[]}

Source evidence: handleConsoleAPICalled used numberValue(params.timestamp) ?? 0; the result schema required z.number(). The pinned Playwright CDP protocol defines Runtime Timestamp as number and describes it as “Number of milliseconds since epoch.”

Typed outcome or recovery expected

A nullable timestamp at the Evidence boundary; valid finite values remain unchanged. Missing/non-finite timestamps add an invalid_protocol_value exclusion for console_events while preserving the rest of the console event.

Analysis or suspected cause

Source-derived: the console producer replaces any value rejected by numberValue with zero to satisfy its non-null schema. The owner already has a completeness ledger and invalid_protocol_value reason, so the boundary can preserve the event and represent the unknown without downstream repair.

Additional context

Issue #5609 and open PR #5639 concern pre-window lifecycle milestones in observe-web-session; PR #5639 changes CdpObservationSession.ts and timeline tests/docs, not inspect-web-page console capture or its schema. Read-only issue/PR searches for console timestamp, missing timestamp console, and consoleAPICalled found no console-specific report or PR. These searches are not guaranteed exhaustive. The issue is adjacent to the timestamp Evidence rule but a separate producer and output contract. A candidate focused fix and red/green source-only tests are retained under .cache/codebase-audit/refresh59-console/; no issue has been filed.

Originally created by @morluto on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5656 # [Bug] Missing console API timestamps are reported as epoch zero ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Process capture or runtime observation ### Observed behavior The `inspect-web-page` capture owner normalizes a same-origin `Runtime.consoleAPICalled` event with an absent or non-finite `timestamp` to `timestamp: 0`. The console completeness ledger records no `invalid_protocol_value` exclusion. A real producer value of zero produces the same Evidence, so consumers cannot distinguish missing time from an observed epoch timestamp. ### Reproduction Source-only against REA commit `1629266e3c08c90fed6bba5383528af7986a12b7`, using Node.js 24.18.0 and installed `playwright-core` 1.58.2; no browser, target JavaScript, CLI build, or public CLI/MCP call was used. Instantiate `CdpCaptureEvents` with `inspectWebPageInputSchema.parse({ cdp_endpoint: origin, allowed_origins: [origin], target_id: "page" })`, then ingest `Runtime.consoleAPICalled` with `type: "log"`, `args: []`, and a stack frame URL under that origin. Repeat once without a `timestamp` property and once with `timestamp: 0`. The captured source-only output for both was `timestamp: 0`; both completeness snapshots had no `console_events` exclusion. The exact probe command and output are retained in `.cache/codebase-audit/refresh59-cdp-neighbor-timestamps.md` and `.cache/codebase-audit/refresh59-console/source-red.log`. ### Expected behavior Preserve a valid finite producer value exactly, including zero and negative values (the protocol defines a number of milliseconds since epoch). When the required value is absent or invalid, retain the console event with `timestamp: null` and record `console_events` as incomplete with `invalid_protocol_value`; do not synthesize a time. The owning schema should represent the unknown explicitly. `Runtime.consoleAPICalled.timestamp` is a CDP `Runtime.Timestamp` in milliseconds since Unix epoch. It is a separate clock and unit from `observe-web-session` lifecycle/Network timestamps, which are monotonic seconds. ### Impact and scope The executed source-boundary controls produce a fabricated epoch time for malformed or incomplete console events without marking the section incomplete. Frequency on real browser/provider traffic is unknown; CDP defines the timestamp as required, so this probe does not establish how often a real provider omits it. No consumer behavior or data loss was observed. ### REA version Source commit `1629266e3c08c90fed6bba5383528af7986a12b7` (6.7.0 source line). ### Runtime and platform Node.js 24.18.0; macOS arm64 host. Pinned protocol dependency: `playwright-core` 1.58.2. No browser was launched. ### Target and artifact context A synthetic, same-origin CDP console event with stack frame URL `http://127.0.0.1:43127/app.js`; no executable target or external service. ### Interface Other: shared browser capture owner; public CLI/MCP behavior is source-derived, not exercised. ### Earliest failure stage Capture or observation ### Relevant output or evidence The direct producer-owner probe produced these selected fields (full snapshots retained locally): ```json {"input":"missing timestamp","normalized_timestamp":0,"excluded":[]} {"input":"timestamp: 0","normalized_timestamp":0,"excluded":[]} ``` Source evidence: `handleConsoleAPICalled` used `numberValue(params.timestamp) ?? 0`; the result schema required `z.number()`. The pinned Playwright CDP protocol defines Runtime `Timestamp` as number and describes it as “Number of milliseconds since epoch.” ### Typed outcome or recovery expected A nullable timestamp at the Evidence boundary; valid finite values remain unchanged. Missing/non-finite timestamps add an `invalid_protocol_value` exclusion for `console_events` while preserving the rest of the console event. ### Analysis or suspected cause Source-derived: the console producer replaces any value rejected by `numberValue` with zero to satisfy its non-null schema. The owner already has a completeness ledger and `invalid_protocol_value` reason, so the boundary can preserve the event and represent the unknown without downstream repair. ### Additional context Issue #5609 and open PR #5639 concern pre-window lifecycle milestones in `observe-web-session`; PR #5639 changes `CdpObservationSession.ts` and timeline tests/docs, not `inspect-web-page` console capture or its schema. Read-only issue/PR searches for `console timestamp`, `missing timestamp console`, and `consoleAPICalled` found no console-specific report or PR. These searches are not guaranteed exhaustive. The issue is adjacent to the timestamp Evidence rule but a separate producer and output contract. A candidate focused fix and red/green source-only tests are retained under `.cache/codebase-audit/refresh59-console/`; no issue has been filed.
bsakaguchi 2026-10-31 00:40:15 +00:00
  • closed this issue
  • added the
    bug
    triage
    labels
Author
Owner

@matbrgz commented on GitHub (Oct 20, 2026):

Cross-referencing with canonical issue #3377 ([Bug] Selected console text drops null primitive arguments). Both address data fidelity and normalization edge cases in console log event records (preserving absent timestamps as undefined/null rather than synthetic epoch zero). Cataloged under Cluster BV in consolidation tracker #4330.

<!-- gh-comment-id:6298908552 --> @matbrgz commented on GitHub (Oct 20, 2026): Cross-referencing with canonical issue #3377 (`[Bug] Selected console text drops null primitive arguments`). Both address data fidelity and normalization edge cases in console log event records (preserving absent timestamps as undefined/null rather than synthetic epoch zero). Cataloged under Cluster BV in consolidation tracker #4330.
Author
Owner

@morluto commented on GitHub (Oct 21, 2026):

Closing as already fixed on main.

Verified on 71b696582 with npm run test:local -- src/browser/CdpCaptureEvents.consoleTimestamp.test.ts (6 passed): missing/invalid console timestamps are null with an invalid_protocol_value exclusion; 0 and -1 are preserved. Fix commit 690fc5185.

<!-- gh-comment-id:6308572617 --> @morluto commented on GitHub (Oct 21, 2026): Closing as already fixed on main. Verified on `71b696582` with `npm run test:local -- src/browser/CdpCaptureEvents.consoleTimestamp.test.ts` (6 passed): missing/invalid console timestamps are `null` with an `invalid_protocol_value` exclusion; `0` and `-1` are preserved. Fix commit `690fc5185`.
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#3424
No description provided.