fix: bound recording timestamps before playback

Match upstream millisecond accumulation and bound native timer horizons.
Add deterministic rounding, overflow and non-progress regression casts,
with captured-player and WordPress playback/upload coverage.
This commit is contained in:
2026-10-15 11:30:31 +08:00
parent 487eedf0ba
commit e1cd87f87d
49 changed files with 1273 additions and 33 deletions
+16 -2
View File
@@ -127,6 +127,10 @@ can or should be avoided.
| v1 container allocation | `containers-v1-{at,over}` | 100,016 / 100,017 containers |
| JSONL scalar/key allocation | `line-tokens-v{2,3}-{at,over}` | 20,000 / 20,001 tokens |
| Nesting | `depth-v{1,2,3}-{at,over}` | 15 / 16 container levels |
| Recording timeline | `timeline-v{1,2,3}-{at,over}` | 2,147,483,647 / 2,147,483,648 milliseconds |
| Relative timeline sum | `interval-timeline-v{1,3}-{at,over}` | Millisecond-order accumulation at / over the horizon |
| Time metadata | `duration-v*-{zero,at,over}`, `idle-limit-v*-{zero,at,over}` | Zero remains valid; inclusive horizon applies |
| Floating-point regressions | `time-v{1,3}-ms-rounding-over`, `time-v{1,3}-ms-sum-overflow`, `time-v2-output-nonprogress` | Valid JSON with unsafe upstream millisecond arithmetic |
| Intentional bad syntax | `malformed-v1-json`, `malformed-v{2,3}-event` | Stable invalid-result controls |
The cells-over value is 40,200, not an assertion that every integer cell count
@@ -139,8 +143,18 @@ equivalence.
The corpus invariant suite independently parses tightly bounded test data to
measure structure, verify valid/malformed labels, pin exact boundary values,
and prove an unrelated limit is not masking the intended one. Only the six
`safePlayback` controls reach the real pinned player Core. Hostile/boundary
recordings first exercise the production loader guard or PHP upload validator.
`safePlayback` controls use ordinary real pinned player Core playback. Separate
tiny timestamp regressions use captured timers and bounded callbacks to verify
upstream numeric behavior without scheduling long waits or an unbounded loop.
Hostile/boundary recordings first exercise the production loader guard or PHP
upload validator.
The supported raw timeline is about 24.85 days. Browser playback conservatively
requires cumulative time divided by speed to fit the same signed timer ceiling;
at 0.01×, this permits about 5.97 hours of source time. Per-event gap checks alone
are insufficient because the player batches future output ahead of wall time.
The v1/v3 rounding witness specifically distinguishes summing milliseconds from
summing seconds before conversion; these two operations are not interchangeable.
Browser tests use the existing isolated WordPress setup and check visible errors
and recovery. Passing Node/PHP checks does not imply that a browser run occurred.
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"duration":2147483.647,"stdout":[[0,"x"]]}
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"duration":2147483.648,"stdout":[[0,"x"]]}
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"duration":0,"stdout":[[0,"x"]]}
+2
View File
@@ -0,0 +1,2 @@
{"version":2,"width":80,"height":24,"duration":2147483.647}
[0,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":2,"width":80,"height":24,"duration":2147483.648}
[0,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":2,"width":80,"height":24,"duration":0}
[0,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":3,"term":{"cols":80,"rows":24},"duration":2147483.647}
[0,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":3,"term":{"cols":80,"rows":24},"duration":2147483.648}
[0,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":3,"term":{"cols":80,"rows":24},"duration":0}
[0,"o","x"]
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"idle_time_limit":2147483.647,"stdout":[[0,"x"]]}
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"idle_time_limit":2147483.648,"stdout":[[0,"x"]]}
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"idle_time_limit":0,"stdout":[[0,"x"]]}
+2
View File
@@ -0,0 +1,2 @@
{"version":2,"width":80,"height":24,"idle_time_limit":2147483.647}
[0,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":2,"width":80,"height":24,"idle_time_limit":2147483.648}
[0,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":2,"width":80,"height":24,"idle_time_limit":0}
[0,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":3,"term":{"cols":80,"rows":24},"idle_time_limit":2147483.647}
[0,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":3,"term":{"cols":80,"rows":24},"idle_time_limit":2147483.648}
[0,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":3,"term":{"cols":80,"rows":24},"idle_time_limit":0}
[0,"o","x"]
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"stdout":[[1073741.823,"x"],[1073741.824,"end"]]}
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"stdout":[[1073741.823,"x"],[1073741.825,"end"]]}
+3
View File
@@ -0,0 +1,3 @@
{"version":3,"term":{"cols":80,"rows":24}}
[1073741.823,"o","x"]
[1073741.824,"o","end"]
@@ -0,0 +1,3 @@
{"version":3,"term":{"cols":80,"rows":24}}
[1073741.823,"o","x"]
[1073741.825,"o","end"]
+716 -1
View File
@@ -14,7 +14,8 @@
"depth": 15,
"containers": 100016,
"tokens": 400000,
"lineTokens": 20000
"lineTokens": 20000,
"timelineMs": 2147483647
},
"cases": [
{
@@ -840,6 +841,720 @@
"events": 100001
}
},
{
"id": "timeline-v1-at",
"format": 1,
"description": "One event isolates the inclusive 2^31 - 1 millisecond timeline horizon.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "timeline-v1-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 66,
"sha256": "5622319d9372013c48101ef2944cd5d079084b0df144a1fcc69140cd5b66d9f5",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "duration-v1-at",
"format": 1,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "duration-v1-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 79,
"sha256": "02b5c0e111adb26dfb6dd5c792ea48ebb853d0618cf1860fd2857d2d06f4980c",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "idle-limit-v1-at",
"format": 1,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "idle-limit-v1-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 86,
"sha256": "76038e9c90775dc12c299c3c2dd4f265bf4ee3b6e4cd2b66c95688b859becd43",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "timeline-v1-over",
"format": 1,
"description": "One event isolates the inclusive 2^31 - 1 millisecond timeline horizon.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "timeline-v1-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 66,
"sha256": "177d6d8d97d72f2a5416b7eb1b9e32c2cc2b620a20ae1c70d5494406befc17f9",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "duration-v1-over",
"format": 1,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "duration-v1-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 79,
"sha256": "32da9450dc0f53f8d044006c967296ac50d9311a7e8a86f4730aebff191d03f3",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "idle-limit-v1-over",
"format": 1,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "idle-limit-v1-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 86,
"sha256": "7ad90f6743ea0f90c4ed00a9c1dc361d5640b8abeaaf0c7cfd5dd9e190209398",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "duration-v1-zero",
"format": 1,
"description": "Zero remains valid for optional timing metadata.",
"category": "valid-control",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "duration-v1-zero.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 69,
"sha256": "14f1b40e1d57c7b00a6024c1e4e5a4d68723207eb447c91f721a6cfce0674d4e"
},
{
"id": "idle-limit-v1-zero",
"format": 1,
"description": "Zero remains valid for optional timing metadata.",
"category": "valid-control",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "idle-limit-v1-zero.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 76,
"sha256": "ba707de0f768ed2fe89ebd7d8751c4febc6c7eb4be4ac21b4be6e69324353c98"
},
{
"id": "timeline-v2-at",
"format": 2,
"description": "One event isolates the inclusive 2^31 - 1 millisecond timeline horizon.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "timeline-v2-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 59,
"sha256": "5dcb182b6e3ccf2573e58408f7ac44599fcc6ac92b3951f8fd3c2bb3138d1e4f",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "duration-v2-at",
"format": 2,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "duration-v2-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 72,
"sha256": "257b671345d8f515afa242242f313125fecbe58a92f7e690861d6b38e0b1ec36",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "idle-limit-v2-at",
"format": 2,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "idle-limit-v2-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 79,
"sha256": "e5f12262b1b1a76970785cbbe98126f0d8061dffce1b623aeaa150dac0f4ffea",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "timeline-v2-over",
"format": 2,
"description": "One event isolates the inclusive 2^31 - 1 millisecond timeline horizon.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "timeline-v2-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 59,
"sha256": "7717e9978f2767db79388c597a683e216445146c0f7fe2e639401cdafad94267",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "duration-v2-over",
"format": 2,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "duration-v2-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 72,
"sha256": "a7eaae002cebeec39c2c1ea0832a261ec66a8bab76dafaeaaa252e1e6ab641dd",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "idle-limit-v2-over",
"format": 2,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "idle-limit-v2-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 79,
"sha256": "c10e47c6405d2f2087ff4348584722bc5e89c9c7bb8d69648d446189d268ce01",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "duration-v2-zero",
"format": 2,
"description": "Zero remains valid for optional timing metadata.",
"category": "valid-control",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "duration-v2-zero.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 62,
"sha256": "f8ccb56b4dc1b3b8535af7ea4eaad3c6f0d6475563aa9c593ca0e4a4821943dd"
},
{
"id": "idle-limit-v2-zero",
"format": 2,
"description": "Zero remains valid for optional timing metadata.",
"category": "valid-control",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "idle-limit-v2-zero.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 69,
"sha256": "b34ea66b9bd4c165b55ca39523a5874f29d68cc9277eb3cca4de589691732d1a"
},
{
"id": "timeline-v3-at",
"format": 3,
"description": "One event isolates the inclusive 2^31 - 1 millisecond timeline horizon.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "timeline-v3-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 65,
"sha256": "1e234fb56af6cc042a6daf77a6b833db2f5ecab6aae35a1c7e3821051dce2ec5",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "duration-v3-at",
"format": 3,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "duration-v3-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 78,
"sha256": "b363b4bc5077858e30fa0e188cb49d5b50c9d40fe5f0f14ced04bf835b2e2d21",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "idle-limit-v3-at",
"format": 3,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "idle-limit-v3-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 85,
"sha256": "b787da8e6ba022bc3a2ac8780aa8073ea4ca82b92d018cccbf22655846122dd0",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "timeline-v3-over",
"format": 3,
"description": "One event isolates the inclusive 2^31 - 1 millisecond timeline horizon.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "timeline-v3-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 65,
"sha256": "aafb1fabc891df6843942f69ac945e13ea77865a2542cca1d02db6bb1c8080bf",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "duration-v3-over",
"format": 3,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "duration-v3-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 78,
"sha256": "5fcf1f75486d94f71463e6320886d0a51721f8fdbe1063593b5a1d14c14978d1",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "idle-limit-v3-over",
"format": 3,
"description": "Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "idle-limit-v3-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 85,
"sha256": "a3624e3fc0bd3c420dbfe91018b47b840b7fb09e10fba7365fee079e2615bef6",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "duration-v3-zero",
"format": 3,
"description": "Zero remains valid for optional timing metadata.",
"category": "valid-control",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "duration-v3-zero.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 68,
"sha256": "2d40499454b3b7a1589b91004115e2a9d53a18e7167ccefe9352eda66bbfb2d8"
},
{
"id": "idle-limit-v3-zero",
"format": 3,
"description": "Zero remains valid for optional timing metadata.",
"category": "valid-control",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "idle-limit-v3-zero.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 75,
"sha256": "bdc71879c2d7f3d8338d31038133d070b2d9dc6e398f6b133c45e90750509016"
},
{
"id": "interval-timeline-v1-at",
"format": 1,
"description": "Each interval is inside the horizon; only their upstream-order millisecond sum selects the boundary.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "interval-timeline-v1-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 86,
"sha256": "8e9c5b96b20566f12fe9a15e1c8269461d0dbc6ba6d1a06a83aff581f872d0fc",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "interval-timeline-v1-over",
"format": 1,
"description": "Each interval is inside the horizon; only their upstream-order millisecond sum selects the boundary.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "interval-timeline-v1-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 86,
"sha256": "7fec7732286f679ef8f0e71f4f3fae0f9078dab6684eda81f517bd1d5b39d3bf",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "time-v1-ms-rounding-over",
"format": 1,
"description": "Adding seconds before conversion rounds to the allowed cap, but summing each interval in milliseconds exceeds it.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "time-v1-ms-rounding-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 99,
"sha256": "06283761ce7b12acdc6352ebaa71b7691e723aa3be6592bd6b9eb3c4ad3a547c",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647.0000002
}
},
{
"id": "time-v1-ms-sum-overflow",
"format": 1,
"description": "Both converted intervals and the converted seconds sum are finite, but upstream interval-by-interval millisecond addition overflows.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "time-v1-ms-sum-overflow.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 109,
"sha256": "7ac8311d1533b23a5115195bd004804d7b0b1f1540a5782ff865af22dec295d7"
},
{
"id": "interval-timeline-v3-at",
"format": 3,
"description": "Each interval is inside the horizon; only their upstream-order millisecond sum selects the boundary.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "interval-timeline-v3-at.cast"
},
"expected": {
"accepted": true,
"jsError": null
},
"bytes": 89,
"sha256": "3f76fc28485f0670f5b62210fd580950c404a1809ede166e53ad75c0960cb8bc",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647
}
},
{
"id": "interval-timeline-v3-over",
"format": 3,
"description": "Each interval is inside the horizon; only their upstream-order millisecond sum selects the boundary.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "interval-timeline-v3-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 89,
"sha256": "9f311bc12ed12e6208d8821a593ab6e1ec17cf4c7d926ff00f83ca06741e1758",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483648
}
},
{
"id": "time-v3-ms-rounding-over",
"format": 3,
"description": "Adding seconds before conversion rounds to the allowed cap, but summing each interval in milliseconds exceeds it.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "time-v3-ms-rounding-over.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 102,
"sha256": "21bdf134dee3e29fce0166b4c71c2657d47796b3e7cb33667b82de08df3bcadf",
"boundary": {
"metric": "timelineMs",
"limit": 2147483647,
"value": 2147483647.0000002
}
},
{
"id": "time-v3-ms-sum-overflow",
"format": 3,
"description": "Both converted intervals and the converted seconds sum are finite, but upstream interval-by-interval millisecond addition overflows.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "time-v3-ms-sum-overflow.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 112,
"sha256": "4ce89449651ac5435e81a8635dda115b2022d325217871177079d41cd143be5a"
},
{
"id": "time-v2-output-nonprogress",
"format": 2,
"description": "A tiny finite timestamp makes the upstream output batching deadline equal its start, so callbacks repeat without consuming output.",
"category": "resource-boundary",
"provenance": "normalized-mutation",
"safePlayback": false,
"validity": "format-valid",
"source": {
"file": "time-v2-output-nonprogress.cast"
},
"expected": {
"accepted": false,
"jsError": "time"
},
"bytes": 69,
"sha256": "92abcf13adcfc3f65e61c7ab7d367f9e7cd41bb7bd38b4b11bef280b51fee536"
},
{
"id": "valid-v1-multiline-late-version",
"format": 1,
+31
View File
@@ -8,6 +8,7 @@ export const POLICY = Object.freeze( {
bytes: 33554432, v1Bytes: 2097152, lineBytes: 262144, events: 100000,
lines: 100000, markers: 1000, dimension: 1000, cells: 40000,
depth: 15, containers: 100016, tokens: 400000, lineTokens: 20000,
timelineMs: 2147483647,
} );
// This PRNG is part of the reproducibility contract, not a security primitive.
@@ -115,6 +116,36 @@ export function createRecipes( seed = FIXTURE_SEED ) {
}
}
// Tiny time witnesses use a pinned policy independent of production constants.
// Keep official captures untouched and never mark these as browser-playable.
const timedCast = ( version, timestamps, metadata = {} ) => {
const meta = { ...header( version ), ...metadata };
const frames = timestamps.map( ( time, index ) => [ time, ...( version === 1 ? [] : [ 'o' ] ), index ? 'end' : 'x' ] );
return ( version === 1 ? json( { ...meta, stdout: frames } ) : [ meta, ...frames ].map( json ).join( '\n' ) ) + '\n';
};
for ( const version of [ 1, 2, 3 ] ) {
for ( const over of [ false, true ] ) {
const suffix = over ? 'over' : 'at';
const seconds = over ? 2147483.648 : 2147483.647;
const options = { small: true, error: over ? 'time' : null, boundary: pair( 'timelineMs', 2147483647, over ? 2147483648 : 2147483647 ) };
add( `timeline-v${ version }-${ suffix }`, version, 'One event isolates the inclusive 2^31 - 1 millisecond timeline horizon.', [ segment( timedCast( version, [ seconds ] ) ) ], options );
for ( const [ id, key ] of [ [ 'duration', 'duration' ], [ 'idle-limit', 'idle_time_limit' ] ] ) {
add( `${ id }-v${ version }-${ suffix }`, version, 'Timing metadata uses the same finite nonnegative millisecond horizon even when upstream ignores that field.', [ segment( timedCast( version, [ 0 ], { [ key ]: seconds } ) ) ], options );
}
}
for ( const [ id, key ] of [ [ 'duration', 'duration' ], [ 'idle-limit', 'idle_time_limit' ] ] ) {
add( `${ id }-v${ version }-zero`, version, 'Zero remains valid for optional timing metadata.', [ segment( timedCast( version, [ 0 ], { [ key ]: 0 } ) ) ], { small: true, category: 'valid-control' } );
}
}
for ( const version of [ 1, 3 ] ) {
for ( const over of [ false, true ] ) {
add( `interval-timeline-v${ version }-${ over ? 'over' : 'at' }`, version, 'Each interval is inside the horizon; only their upstream-order millisecond sum selects the boundary.', [ segment( timedCast( version, [ 1073741.823, over ? 1073741.825 : 1073741.824 ] ) ) ], { small: true, error: over ? 'time' : null, boundary: pair( 'timelineMs', 2147483647, over ? 2147483648 : 2147483647 ) } );
}
add( `time-v${ version }-ms-rounding-over`, version, 'Adding seconds before conversion rounds to the allowed cap, but summing each interval in milliseconds exceeds it.', [ segment( timedCast( version, [ 307699.2378567164, 1839784.4091432837 ] ) ) ], { small: true, error: 'time', boundary: pair( 'timelineMs', 2147483647, 2147483647.0000002 ) } );
add( `time-v${ version }-ms-sum-overflow`, version, 'Both converted intervals and the converted seconds sum are finite, but upstream interval-by-interval millisecond addition overflows.', [ segment( timedCast( version, [ 2.996155224770526e303, 1.7677315826146105e305 ] ) ) ], { small: true, error: 'time' } );
}
add( 'time-v2-output-nonprogress', 2, 'A tiny finite timestamp makes the upstream output batching deadline equal its start, so callbacks repeat without consuming output.', [ segment( timedCast( 2, [ 1e20 ] ) ) ], { small: true, error: 'time' } );
add( 'valid-v1-multiline-late-version', 1, 'Pretty v1 document places its version after stdout and nested metadata.', [ segment( '{\n "stdout": [[0,"multiline v1\\r\\n"]],\n "metadata": {"version": 3},\n "width": 80,\n "height": 24,\n "version": 1\n}\n' ) ], { small: true, category: 'valid-control' } );
add( 'valid-v1-escaped-version', 1, 'Escaped top-level version key is still v1.', [ segment( '{"ver\\u0073ion":1,"width":80,"height":24,"stdout":[]}\n' ) ], { small: true, category: 'valid-control' } );
add( 'valid-v1-duplicate-version', 1, 'Last duplicate version wins under the bundled JSON parsers.', [ segment( '{"version":2,"version":1,"width":80,"height":24,"stdout":[]}\n' ) ], { small: true, category: 'upstream-compatibility' } );
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"stdout":[[307699.2378567164,"x"],[1839784.4091432837,"end"]]}
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"stdout":[[2.996155224770526e+303,"x"],[1.7677315826146105e+305,"end"]]}
@@ -0,0 +1,2 @@
{"version":2,"width":80,"height":24}
[100000000000000000000,"o","x"]
+3
View File
@@ -0,0 +1,3 @@
{"version":3,"term":{"cols":80,"rows":24}}
[307699.2378567164,"o","x"]
[1839784.4091432837,"o","end"]
+3
View File
@@ -0,0 +1,3 @@
{"version":3,"term":{"cols":80,"rows":24}}
[2.996155224770526e+303,"o","x"]
[1.7677315826146105e+305,"o","end"]
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"stdout":[[2147483.647,"x"]]}
+1
View File
@@ -0,0 +1 @@
{"version":1,"width":80,"height":24,"stdout":[[2147483.648,"x"]]}
+2
View File
@@ -0,0 +1,2 @@
{"version":2,"width":80,"height":24}
[2147483.647,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":2,"width":80,"height":24}
[2147483.648,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":3,"term":{"cols":80,"rows":24}}
[2147483.647,"o","x"]
+2
View File
@@ -0,0 +1,2 @@
{"version":3,"term":{"cols":80,"rows":24}}
[2147483.648,"o","x"]