certflow 1.0.2__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. certflow-1.2.0/.gitignore +21 -0
  2. certflow-1.2.0/CHANGELOG.md +159 -0
  3. {certflow-1.0.2 → certflow-1.2.0}/CITATION.cff +14 -2
  4. {certflow-1.0.2 → certflow-1.2.0}/LICENSE +21 -21
  5. certflow-1.2.0/PKG-INFO +469 -0
  6. certflow-1.2.0/README.md +432 -0
  7. certflow-1.2.0/docs/README.md +54 -0
  8. {certflow-1.0.2 → certflow-1.2.0}/pyproject.toml +5 -3
  9. certflow-1.2.0/src/certflow/__init__.py +133 -0
  10. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/baselines.py +279 -279
  11. certflow-1.2.0/src/certflow/cert.py +2377 -0
  12. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/ch.py +8 -5
  13. certflow-1.2.0/src/certflow/conformal.py +1208 -0
  14. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/drift.py +472 -472
  15. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/egraph.py +371 -371
  16. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/episodes.py +21 -0
  17. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/fastgraph.py +83 -20
  18. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/graphcore.py +271 -271
  19. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/harness.py +27 -1
  20. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/movingai.py +673 -673
  21. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/oracle.py +222 -222
  22. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/realworld.py +382 -382
  23. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/roadnet.py +585 -585
  24. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/sensing.py +121 -121
  25. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/snapshot.py +50 -3
  26. certflow-1.2.0/src/certflow/team.py +122 -0
  27. {certflow-1.0.2 → certflow-1.2.0}/src/certflow/types.py +119 -119
  28. certflow-1.2.0/src/certflow/upgrades.py +966 -0
  29. certflow-1.2.0/src/certflow/witness.py +170 -0
  30. {certflow-1.0.2 → certflow-1.2.0}/tests/test_baselines.py +227 -227
  31. {certflow-1.0.2 → certflow-1.2.0}/tests/test_cert.py +69 -0
  32. {certflow-1.0.2 → certflow-1.2.0}/tests/test_ch.py +13 -1
  33. certflow-1.2.0/tests/test_cia.py +184 -0
  34. {certflow-1.0.2 → certflow-1.2.0}/tests/test_conformal.py +35 -0
  35. {certflow-1.0.2 → certflow-1.2.0}/tests/test_drift_oracle.py +431 -431
  36. {certflow-1.0.2 → certflow-1.2.0}/tests/test_egraph.py +99 -99
  37. {certflow-1.0.2 → certflow-1.2.0}/tests/test_episodes.py +39 -39
  38. {certflow-1.0.2 → certflow-1.2.0}/tests/test_fastgraph.py +286 -286
  39. {certflow-1.0.2 → certflow-1.2.0}/tests/test_graphcore.py +155 -155
  40. {certflow-1.0.2 → certflow-1.2.0}/tests/test_harness.py +570 -570
  41. certflow-1.2.0/tests/test_independent_protocol.py +30 -0
  42. certflow-1.2.0/tests/test_live_wiring.py +197 -0
  43. certflow-1.2.0/tests/test_lp_shift.py +151 -0
  44. {certflow-1.0.2 → certflow-1.2.0}/tests/test_movingai.py +406 -406
  45. {certflow-1.0.2 → certflow-1.2.0}/tests/test_movingai_experiment.py +213 -213
  46. certflow-1.2.0/tests/test_pasc_watch.py +280 -0
  47. {certflow-1.0.2 → certflow-1.2.0}/tests/test_realworld.py +86 -86
  48. {certflow-1.0.2 → certflow-1.2.0}/tests/test_roadnet.py +232 -232
  49. certflow-1.2.0/tests/test_sfogd.py +106 -0
  50. certflow-1.2.0/tests/test_shrink_license.py +173 -0
  51. {certflow-1.0.2 → certflow-1.2.0}/tests/test_snapshot.py +42 -1
  52. {certflow-1.0.2 → certflow-1.2.0}/tests/test_state_sync.py +169 -169
  53. certflow-1.2.0/tests/test_team.py +138 -0
  54. {certflow-1.0.2 → certflow-1.2.0}/tests/test_tier1_smoke.py +130 -130
  55. {certflow-1.0.2 → certflow-1.2.0}/tests/test_tier2_smoke.py +104 -104
  56. certflow-1.2.0/tests/test_upgrades.py +503 -0
  57. certflow-1.0.2/.gitignore +0 -13
  58. certflow-1.0.2/CHANGELOG.md +0 -76
  59. certflow-1.0.2/PKG-INFO +0 -202
  60. certflow-1.0.2/README.md +0 -169
  61. certflow-1.0.2/src/certflow/__init__.py +0 -40
  62. certflow-1.0.2/src/certflow/cert.py +0 -1186
  63. certflow-1.0.2/src/certflow/conformal.py +0 -275
@@ -0,0 +1,21 @@
1
+ /data/
2
+ cert_env/
3
+ .venv/
4
+ __pycache__/
5
+ *.egg-info/
6
+ .pytest_cache/
7
+ /results/
8
+ paper/*.pdf
9
+ paper/*.aux
10
+ paper/*.log
11
+ paper/*.out
12
+ venue.md
13
+ .claude/
14
+
15
+ # raw visualization renders (curated copies live in site/assets/)
16
+ viz_out/
17
+
18
+ # personal launch assets (not part of the published artifact)
19
+ linkedin.zip
20
+ reddit.zip
21
+ x.zip
@@ -0,0 +1,159 @@
1
+ # Changelog
2
+
3
+ All notable changes to CERT-FLOW are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
+ [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [1.2.0] - 2026-09-17
8
+
9
+ - Added exact search-backend selection for large structured grids: the
10
+ recommended `auto` profile uses fresh numba flat-Dijkstra queries when they
11
+ beat D* Lite queue repair, while generic graphs retain incremental D* Lite.
12
+ Warm-up calibration now uses deterministic round-robin repeats, avoiding
13
+ repeated full-graph age scans during multi-edge bursts. Full 3-seed scale
14
+ p95 at 60x60 is 22.28 ms with 85.3% validity.
15
+ - Added composition-safe CIA upper-bound pricing (`cia_ub=True`) with an
16
+ explicit LB/UB alpha split and the selected-path freshness gate.
17
+ - Added experimental age-conditioned edge pricing (`age_stratify=True`) with
18
+ an atomic pooled fallback when any path stratum lacks support.
19
+ - Added the opt-in CERT-FLOW v3 upgrade layer in `certflow.upgrades`:
20
+ selection-conditional audit certificates, decision-focused bounded-risk
21
+ control, trajectory-level conformal/reachable tubes, learned evidence-scale
22
+ calibration, budgeted UCB active sensing, joint fleet/congestion pricing,
23
+ and regime-aware calibration recovery. `CertPlanner` exposes hooks for all
24
+ seven through its config flags and helper methods; legacy defaults are
25
+ unchanged.
26
+ - Pinned the `realworld` extra to `pandas<3`: pandas 3 cannot read the legacy
27
+ DCRNN HDF5 stores (METR-LA 34272x207 + PEMS-BAY 52116x325 verified on
28
+ pandas 2.x, sensor-id overlap 207/207 and 325/325).
29
+ - Full suite green on real data: 337 passed, 0 skipped (NY road graph,
30
+ MovingAI maps/scenarios, METR-LA, PEMS-BAY all downloaded and
31
+ loader-verified; strict release gate re-run from fresh artifacts).
32
+
33
+ ## [1.1.0] - 2026-07-02
34
+
35
+ Multi-agent certificate + a 2026 conformal upgrade layer. All new behavior is
36
+ opt-in behind config flags / new classes; the default single-agent certificate
37
+ and its guarantees are unchanged.
38
+
39
+ ### Added
40
+ - **Additive multi-agent certificate** (`certflow.team`): `additive_certificate`
41
+ + `TeamCertificate` (`sum LB <= sum OPT <= sum UB`, union-bound confidence) —
42
+ the one TEAM-CERT survivor, ported over a shared conformal store.
43
+ - **LP-shift staleness** (`ConformalScorer(shift_model="lp", eps_lp, rho_lp)`,
44
+ arXiv 2502.14105): worst-case quantile `Quant(1-alpha+rho)+eps`. TV default.
45
+ - **CIA path-sum calibration** (`CIACalibrator`, `CertPlanner.cia_path_certificate`,
46
+ arXiv 2408.10939): group-sum path calibration with symmetric-calibration overlap
47
+ handling and the age-weighted drift retrofit. Bonferroni default.
48
+ - **SF-OGD ACI** (`ACITracker(mode="sf-ogd")`, arXiv 2302.07869): scale-free,
49
+ anytime step size. Fixed-gamma default.
50
+ - **PASC joint per-edge calibration** (`PASCCalibrator`, arXiv 2605.18812): one
51
+ `max`-score quantile prices all edges jointly at `>= 1-alpha`, replacing the
52
+ `alpha/L` per-edge Bonferroni correction.
53
+ - **Testability layer** — making the pinned-at-1.0 coverage observable:
54
+ `conformal_p_value` (WATCH Eq. 9), `ConformalTestMartingale` (WATCH, arXiv
55
+ 2505.04608; Ville alarm + tightness stress test), `conformal_e_value` /
56
+ `score_ratio_e_value` / `merge_e_values` (arXiv 2503.13050).
57
+ - **Drift diagnostics** (from DASC, arXiv 2606.15953, as observables only —
58
+ DASC's coverage bound is not distribution-free): `residual_drift_score`
59
+ (1-D Wasserstein `D_t`), `effective_sample_size` (Kish `n_eff`).
60
+ - **Live round-2 wiring** — the round-2 calibrators, previously standalone, are
61
+ now wired into the live `round()` loop behind `PlannerConfig` flags (all
62
+ default **OFF**; on/off produce a byte-identical `(lb, ub, confidence)`
63
+ stream):
64
+ - `watch_monitor=True` (+ `sr_threshold`): every new weighted conformal
65
+ p-value inside `ingest_observation` feeds `planner.watch`
66
+ (`ConformalTestMartingale`) **and** `planner.sr` (`ShiryaevRobertsDetector`);
67
+ `planner.diagnostics()` exposes the martingale value/alarm, SR peak/alarm,
68
+ the recent-vs-buffer residual drift score and the age-weights' effective
69
+ sample size. Purely observational — no certificate, no pricing change.
70
+ - `path_calibration="pasc"`: `_q()` prices edges with the PASC **joint** radius
71
+ live, falling back to Bonferroni during warm-up / while α-annealing pins the
72
+ level at 1. Uses the **signed** block-max, not `abs()`: the live buffer
73
+ already stores the drift-adjusted score `|obs−ĉ| − ρ·age`, so `abs()` (as the
74
+ standalone `pasc_edge_radius` applies to *raw* residuals) would double-count
75
+ the drift subtraction and inflate the radius.
76
+ - `scripts/run_live_wiring.py`, `tests/test_live_wiring.py`.
77
+ - **Real METR-LA benchmark of the wiring** (20 seeds × 288 rounds = one replay
78
+ day each; oracle = exact Dijkstra on the recording): **0.0000** coverage
79
+ violations in every mode; `watch_monitor` **quiet 20/20** on both detectors —
80
+ the pinned-at-1.0 coverage is now a live, alarming quantity at zero cost
81
+ (WATCH HOLDS on real data). PASC is an **honest negative**: **+25.1 %** wider
82
+ median width than Bonferroni on real traffic (8797 → 11007 s), the opposite of
83
+ its 4.5 % synthetic-grid win — long optimistic paths (L ≈ 14–18) starve the
84
+ length-L block quantile, while Bonferroni's full-pooled per-edge quantile stays
85
+ better-resolved. Bonferroni stays default; PASC keeps its experimental flag.
86
+ Full suite **250 passed**. (`docs/results/live-wiring-2026.md`)
87
+ - `docs/results/multiagent.md`, `docs/related-work-2026.md` (positioning vs
88
+ arXiv 2601.03629 + the adopted machinery).
89
+
90
+ ## [1.0.2] - 2026-06-10
91
+
92
+ Packaging and serialization fixes for the freshly published library.
93
+
94
+ ### Fixed
95
+ - `pytest` now discovers the `src/`-layout package on a fresh checkout: the
96
+ `[tool.pytest.ini_options]` `pythonpath` was `["."]` (repo root, no package
97
+ there), so `python -m pytest` failed with `ModuleNotFoundError: certflow`
98
+ unless `PYTHONPATH=src` was set or the package was installed. Set to
99
+ `["src"]`.
100
+ - `EpisodeResult.oracle_cost` is now serialized by `save_results` and restored
101
+ by `load_results`. It was dropped on save, so reloaded Tier-2 results came
102
+ back with `oracle_cost = nan` and any regret analysis silently reported NaN.
103
+ Legacy result files without the field still load (oracle_cost stays nan).
104
+
105
+ ### Added
106
+ - `realworld` optional extra (`pip install 'certflow[realworld]'`) declaring
107
+ the `pandas` and `tables` dependencies the METR-LA / PEMS-BAY traffic
108
+ adapter needs. The core install stays numpy/scipy only; `_load_traffic` now
109
+ raises a clear `ImportError` pointing at the extra when pandas is absent.
110
+
111
+ ## [1.0.1] - 2026-06-10
112
+
113
+ First PyPI release (`pip install certflow`).
114
+
115
+ ### Added
116
+ - Top-level package API: `from certflow import CertPlanner, PlannerConfig,
117
+ Certificate, ConformalScorer, ACITracker, EdgeBelief, World`, plus
118
+ `certflow.__version__` (previously `certflow/__init__.py` was empty and
119
+ everything had to be imported from submodules; the old submodule imports
120
+ still work).
121
+ - `CITATION.cff` (validated, concept DOI 10.5281/zenodo.20631475) and this
122
+ changelog.
123
+ - Full PyPI packaging metadata: readme, keywords, classifiers, project URLs.
124
+
125
+ ### Changed
126
+ - README: pip-based 30-second quickstart, static DOI badge pointing at the
127
+ concept DOI, link to the limitations ledger, Python badge corrected to
128
+ 3.10+ (matching `requires-python`).
129
+ - Package version aligned with the release tag (pyproject said 0.1.0 while
130
+ the repository was at v1.0.0).
131
+
132
+ ### Fixed
133
+ - Lint sweep over `src/`: removed unused imports and dead local assignments
134
+ (no behavior change; the full test suite passes bit-identically).
135
+
136
+ ## [1.0.0] - 2026-06-10
137
+
138
+ First public release, accompanying the preprint *CERT: Certified Route
139
+ Planning under Drifting Costs (Extended Version)*.
140
+
141
+ - Conformal route certificates (LB <= OPT <= UB) under drifting edge costs:
142
+ age-weighted non-exchangeable quantiles, staleness correction, honest
143
+ annealing.
144
+ - Certificate-directed sensing (route-critical, churn-aware) and dual
145
+ incremental search on a flat-array engine (numba kernels with pure-Python
146
+ fallback).
147
+ - Certificate-gated preprocessing: all-pairs snapshot oracle and certified
148
+ Contraction Hierarchies (ns-to-microsecond queries that expire under
149
+ drift).
150
+ - 200+ tests; 16 reproduction pipelines covering 17 synthetic regimes,
151
+ METR-LA / PEMS-BAY traffic replay, MovingAI maps, and DIMACS road
152
+ networks.
153
+ - Theory T1-T7 documented in `docs/` (coverage, certifiability threshold,
154
+ sum-aware certificate, impossibility of a tighter lower bound,
155
+ decision-uniform validity, churn floor).
156
+
157
+ [1.0.2]: https://github.com/Archerkattri/CERT-FLOW/releases/tag/v1.0.2
158
+ [1.0.1]: https://github.com/Archerkattri/CERT-FLOW/releases/tag/v1.0.1
159
+ [1.0.0]: https://github.com/Archerkattri/CERT-FLOW/releases/tag/v1.0.0
@@ -2,12 +2,13 @@ cff-version: 1.2.0
2
2
  message: "If you use CERT-FLOW in your research, please cite it as below."
3
3
  type: software
4
4
  title: "CERT-FLOW: Certified Route Planning under Drifting Costs"
5
- version: 1.0.2
5
+ version: 1.2.0
6
6
  authors:
7
7
  - family-names: Attri
8
8
  given-names: Krishi
9
9
  email: krishiattriwork@gmail.com
10
- affiliation: "Seoul National University"
10
+ orcid: https://orcid.org/0009-0005-4695-6467
11
+ date-released: 2026-09-17
11
12
  doi: 10.5281/zenodo.20631475
12
13
  url: "https://github.com/Archerkattri/CERT-FLOW"
13
14
  repository-code: "https://github.com/Archerkattri/CERT-FLOW"
@@ -28,3 +29,14 @@ abstract: >-
28
29
  preprocessing (all-pairs snapshot oracle, certified Contraction
29
30
  Hierarchies) behind the certificate so static-speed queries expire the
30
31
  instant drift exceeds tolerance.
32
+ preferred-citation:
33
+ type: article
34
+ title: "CERT-FLOW: Certified Route Planning under Drifting Costs"
35
+ authors:
36
+ - family-names: Attri
37
+ given-names: Krishi
38
+ orcid: https://orcid.org/0009-0005-4695-6467
39
+ year: 2026
40
+ doi: 10.31224/7306
41
+ url: "https://doi.org/10.31224/7306"
42
+ notes: "engrXiv preprint, version 2"
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Krishi Attri
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Krishi Attri
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.