Commit cfee628
committed
feat(dataplane): wrap read_program return in Sourced provenance (LocalValue)
Sourced[T, S] + the six aliases (LocalValue, CachedValue, ReplayedValue,
GossipedValue, ExternalValue, SanitizedValue) were exported with zero
production consumers — the provenance vocabulary was dead code that
the doc §3.4 says should distinguish local-fresh-read vs cached-stale-
read at every call site.
dp.read_program now returns Result[LocalValue[Versioned[ProgramSnapshot]]
| None, DataPlaneError]. The phantom-type wrapper makes the read's
provenance explicit at the type level. Future replay paths would
return ReplayedValue[Versioned[...]]; future cache reads would return
CachedValue[Versioned[...]]; mypy then enforces that a function
demanding LocalValue[Program] cannot accept a CachedValue[Program]
by mistake (bug class #13 closed at the type system level).
Production caller updated: gigaevo/runner/dag_runner.py
_timeout_read_is_fresh unwraps the LocalValue via .value.value to
reach the underlying Versioned.
5 tests updated to unwrap the LocalValue wrapper; 1 new test pins
the phantom-wrapper shape returned by read_program.
This is the foothold: a follow-up provenance audit can
rg "LocalValue\|CachedValue\|ReplayedValue" gigaevo/ and find the
first real consumer; subsequent reads (crdt_read, lwwr_get) can
adopt the same pattern.1 parent 32239c6 commit cfee628
3 files changed
Lines changed: 35 additions & 9 deletions
File tree
- gigaevo
- dataplane/tests
- runner
- tests/database
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
341 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
| |||
351 | 353 | | |
352 | 354 | | |
353 | 355 | | |
354 | | - | |
| 356 | + | |
355 | 357 | | |
356 | 358 | | |
357 | 359 | | |
358 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
359 | 379 | | |
360 | 380 | | |
361 | 381 | | |
| |||
547 | 567 | | |
548 | 568 | | |
549 | 569 | | |
550 | | - | |
| 570 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
288 | 293 | | |
289 | 294 | | |
290 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
655 | | - | |
| 655 | + | |
| 656 | + | |
656 | 657 | | |
657 | 658 | | |
658 | 659 | | |
| |||
684 | 685 | | |
685 | 686 | | |
686 | 687 | | |
687 | | - | |
| 688 | + | |
688 | 689 | | |
689 | 690 | | |
690 | 691 | | |
| |||
741 | 742 | | |
742 | 743 | | |
743 | 744 | | |
744 | | - | |
| 745 | + | |
745 | 746 | | |
746 | 747 | | |
747 | 748 | | |
| |||
0 commit comments