Commit 30044ab
Extend conformance validation and robot event contract for speculation events
Conformance and robot module changes to support speculative pipeline
event contracts and strengthen segment validation:
conformance.rs:
- Add NaN/Infinity rejection for start_sec and end_sec timestamps
using is_finite() checks before existing start > end validation,
preventing nonsensical segments from passing conformance gates
- Add negative timestamp rejection for start_sec and end_sec,
catching segments with physically impossible negative time values
- Simplify compare_shadow_run passes_gate logic: gate now depends
solely on segment_comparison.within_tolerance() since text and
timestamp violations are already captured by that method. Previous
redundant checks for text_mismatches and timestamp_violations
were removed.
- Update compare_shadow_run docstring to clarify replay envelope
comparison is informational only (different engines naturally
produce different output hashes)
- Add tests: NaN start/end rejection, Infinity start/end rejection,
negative start/end rejection
- Add IEEE 754 negative zero (-0.0) acceptance test documenting
that -0.0 == 0.0 passes the negativity check
- Add NativeEngineRolloutStage parse whitespace/mixed-case test
- Add compare_shadow_run replay-pass-but-segment-fail gate test
- Add None end_sec overlap-check non-regression test (seg with
end_sec=None should not reset previous_end tracker)
- Add compare_segments speaker mismatch ignored when not required test
robot.rs:
- Add TRANSCRIPT_CONFIRM_REQUIRED_FIELDS constant defining the
required fields for transcript.confirm events (event, schema_version,
run_id, seq, window_id, quality_model_id, drift, latency_ms, ts)
- Add confirmations_emitted to SPECULATION_STATS_REQUIRED_FIELDS
- Add transcript_confirm_value() and emit_transcript_confirm()
functions for constructing and emitting confirm event payloads
- Add confirmations_emitted field to speculation_stats_value() payload
- Extend robot_schema_value() with full schema documentation for
transcript.confirm, transcript.retract, transcript.correct, and
transcript.speculation_stats event types including required fields
and example payloads
- Update schema event count from 7 to 11 in schema_has_expected_event_types test
- Update test imports for new required-field constants
- Add transcript_confirm_value required fields and drift test
- Add transcript_retract_value required fields and reason test
- Add transcript_correct_value required fields and segments test
- Add speculation_stats_value required fields test
- Add snapshot_resources memory field non-swap assertion test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 847658d commit 30044ab
2 files changed
Lines changed: 502 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
98 | 130 | | |
99 | 131 | | |
100 | 132 | | |
| |||
332 | 364 | | |
333 | 365 | | |
334 | 366 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
339 | 372 | | |
340 | 373 | | |
341 | 374 | | |
| |||
350 | 383 | | |
351 | 384 | | |
352 | 385 | | |
353 | | - | |
354 | | - | |
355 | | - | |
| 386 | + | |
356 | 387 | | |
357 | 388 | | |
358 | 389 | | |
| |||
806 | 837 | | |
807 | 838 | | |
808 | 839 | | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
809 | 882 | | |
810 | 883 | | |
811 | 884 | | |
| |||
1344 | 1417 | | |
1345 | 1418 | | |
1346 | 1419 | | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
1347 | 1556 | | |
0 commit comments