cctally 1.117.2 → 1.118.0

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 (58) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +7 -3
  3. package/bin/_cctally_cache.py +2783 -175
  4. package/bin/_cctally_completion.py +106 -33
  5. package/bin/_cctally_core.py +69 -4
  6. package/bin/_cctally_dashboard.py +188 -13
  7. package/bin/_cctally_dashboard_conversation.py +5 -1
  8. package/bin/_cctally_dashboard_envelope.py +50 -19
  9. package/bin/_cctally_dashboard_sources.py +23 -1
  10. package/bin/_cctally_db.py +193 -153
  11. package/bin/_cctally_diagnosis_sources.py +63 -7
  12. package/bin/_cctally_doctor.py +865 -93
  13. package/bin/_cctally_five_hour.py +67 -50
  14. package/bin/_cctally_forecast.py +35 -13
  15. package/bin/_cctally_journal.py +186 -18
  16. package/bin/_cctally_milestone_history.py +859 -62
  17. package/bin/_cctally_oauth_samples.py +286 -15
  18. package/bin/_cctally_parser.py +2 -2
  19. package/bin/_cctally_quota.py +104 -12
  20. package/bin/_cctally_record.py +153 -29
  21. package/bin/_cctally_rederive.py +608 -68
  22. package/bin/_cctally_statusline.py +108 -81
  23. package/bin/_cctally_store.py +179 -38
  24. package/bin/_cctally_tui.py +892 -181
  25. package/bin/_cctally_update.py +32 -13
  26. package/bin/_lib_codex_conversation_query.py +52 -14
  27. package/bin/_lib_codex_drain_admission.py +224 -6
  28. package/bin/_lib_codex_metadata.py +39 -0
  29. package/bin/_lib_conversation_anon.py +15 -8
  30. package/bin/_lib_conversation_dispatch.py +7 -0
  31. package/bin/_lib_conversation_query.py +289 -70
  32. package/bin/_lib_dashboard_sources.py +37 -1
  33. package/bin/_lib_detector_access_registry.py +497 -26
  34. package/bin/_lib_doctor.py +85 -20
  35. package/bin/_lib_doctor_scan_index.py +321 -0
  36. package/bin/_lib_ingest_frontier.py +20 -1
  37. package/bin/_lib_oauth_samples.py +23 -7
  38. package/bin/_lib_pricing.py +146 -16
  39. package/bin/_lib_quota.py +19 -0
  40. package/bin/_lib_rederive.py +11 -6
  41. package/bin/_lib_retained_records.py +516 -0
  42. package/bin/_lib_snapshot_cache.py +10 -0
  43. package/bin/_lib_stale_proof.py +272 -43
  44. package/bin/_lib_stats_content_revision.py +831 -0
  45. package/bin/_lib_write_io.py +11 -4
  46. package/bin/cctally +4 -1
  47. package/dashboard/static/assets/ConversationsView-D4Iv4ku0.js +72 -0
  48. package/dashboard/static/assets/{DoctorModal-B0DnU9d9.js → DoctorModal-D4QSq6uz.js} +1 -1
  49. package/dashboard/static/assets/ModalRoot-C9F5dhZi.js +1 -0
  50. package/dashboard/static/assets/{ProjectsDrillPanel-DSxXQSa-.js → ProjectsDrillPanel-WxAdRDMt.js} +1 -1
  51. package/dashboard/static/assets/{SourceDetailModal-BleDpQqG.js → SourceDetailModal-NyyEfXmc.js} +1 -1
  52. package/dashboard/static/assets/{UpdateModal-CMqaAkSK.js → UpdateModal-CFLq9pT1.js} +1 -1
  53. package/dashboard/static/assets/{index-BjQV-0-D.js → index-BKTWH9JE.js} +2 -2
  54. package/dashboard/static/assets/{outlineNavigation-CO-VWBm7.js → outlineNavigation-BnGUwCS3.js} +3 -3
  55. package/dashboard/static/dashboard.html +1 -1
  56. package/package.json +4 -1
  57. package/dashboard/static/assets/ConversationsView-oqNsWzWV.js +0 -72
  58. package/dashboard/static/assets/ModalRoot-CYua2wP_.js +0 -1
@@ -34,8 +34,11 @@ only through this review:
34
34
 
35
35
  1. Print the before/after shape-line delta of every affected site with
36
36
  `bin/cctally-test-remote python3 tests/_detector_access_callgraph.py
37
- --base <rev>`, where `<rev>` is the tree the current pins were reviewed on
38
- (`HEAD` for an uncommitted sync; the merge base for a committed branch).
37
+ --base <rev>`, where `<rev>` is the full SHA of the commit the current
38
+ pins were reviewed on (the merge base for a committed branch, the
39
+ checkout's commit for an uncommitted change). Never pass `HEAD`: the runner
40
+ snapshots the working tree into its own commit, so its `HEAD` already
41
+ contains the change and the delta comes out empty.
39
42
  Read it beside the source diff (`git diff <rev> -- bin/`).
40
43
  2. Explain every added (`+`), removed (`-`) and changed (`~`) dependency.
41
44
  "Only additions" is not an explanation.
@@ -691,9 +694,23 @@ REGISTRY: "tuple[AccessContract, ...]" = (
691
694
  classes=('singleton',),
692
695
  inert_rule=MAINT,
693
696
  ),
697
+ # #1018 twin epoch 1024 (spec 5.1): the observation index gains its four
698
+ # enriched columns and the partial freshness index. Schema-only, MAINT.
694
699
  AccessContract(
695
700
  function='_cctally_core:open_db',
696
- sql_fingerprint='CREATE TABLE IF NOT EXISTS claude_weekly_observation_index ( observation_id TEXT PRIMARY KEY, account_key TEXT NOT NULL, captured_at_utc TEXT NOT NULL )',
701
+ sql_fingerprint='CREATE INDEX IF NOT EXISTS idx_claude_weekly_observation_index_freshness ON claude_weekly_observation_index (account_key, weekly_resets_at_utc, weekly_percent, captured_at_utc DESC) WHERE weekly_freshness_eligible = 1',
702
+ table='claude_weekly_observation_index',
703
+ keys=(),
704
+ predicate='',
705
+ ordering='',
706
+ selected=(),
707
+ effects='write',
708
+ classes=('singleton',),
709
+ inert_rule=MAINT,
710
+ ),
711
+ AccessContract(
712
+ function='_cctally_core:open_db',
713
+ sql_fingerprint='CREATE TABLE IF NOT EXISTS claude_weekly_observation_index ( observation_id TEXT PRIMARY KEY, account_key TEXT NOT NULL, captured_at_utc TEXT NOT NULL, weekly_percent REAL, weekly_resets_at_utc TEXT, weekly_reading_genuine INTEGER NOT NULL DEFAULT 0, weekly_freshness_eligible INTEGER NOT NULL DEFAULT 0 )',
697
714
  table='claude_weekly_observation_index',
698
715
  keys=(),
699
716
  predicate='',
@@ -1269,10 +1286,31 @@ REGISTRY: "tuple[AccessContract, ...]" = (
1269
1286
  # registered as their own MAINT contracts. No SQL, table selection,
1270
1287
  # predicate, ordering, selected column, execution condition or effect of
1271
1288
  # these sites changed, so each contract and its MAINT inert rule stand.
1289
+ # Reviewed re-pin (#1018 twin T1, base d94a83792), for open_db #1.
1290
+ # Changed: the binding `STATS_INDEX_EPOCH` 1023 -> 1024 (spec 5.1) and the
1291
+ # producer `open_db` itself, whose epoch-1024 schema block creates
1292
+ # `claude_weekly_observation_index` with the four enriched columns
1293
+ # (`weekly_percent`, `weekly_resets_at_utc`, `weekly_reading_genuine`,
1294
+ # `weekly_freshness_eligible`) and the partial index
1295
+ # `idx_claude_weekly_observation_index_freshness`; those are literal
1296
+ # statements, registered as their own MAINT contracts. No SQL, table
1297
+ # selection, predicate, ordering, selected column, execution condition or
1298
+ # effect of this site changed, so the contract and its MAINT inert rule
1299
+ # stand.
1300
+ # Reviewed re-pin (#1050 T2, base a858a87ab), for open_db #1. Changed:
1301
+ # only the producer `open_db` itself, which now calls the new helper
1302
+ # `_ensure_stats_content_revision` before both current-epoch `return
1303
+ # conn` paths and after the epoch stamp of the fresh, scratch and cutover
1304
+ # schema apply (spec 4.3). That helper installs the content-revision
1305
+ # kernel's tables, triggers and index; its statements are registered as
1306
+ # their own MAINT contracts under `_lib_stats_content_revision`. No SQL,
1307
+ # table selection, predicate, ordering, selected column, execution
1308
+ # condition or effect of this site changed, so the contract and its MAINT
1309
+ # inert rule stand.
1272
1310
  AccessContract(
1273
1311
  function='_cctally_core:open_db',
1274
1312
  sql_fingerprint='dynamic:_cctally_core:open_db#1',
1275
- sql_shape='sha256:61bf241458c1f433',
1313
+ sql_shape='sha256:89c6c21da1b99cc6',
1276
1314
  table='dynamic',
1277
1315
  keys=(),
1278
1316
  predicate='dynamic SQL',
@@ -1308,10 +1346,31 @@ REGISTRY: "tuple[AccessContract, ...]" = (
1308
1346
  # as their own MAINT contracts. No SQL, table selection, predicate,
1309
1347
  # ordering, selected column, execution condition or effect of this site
1310
1348
  # changed, so the contract and its MAINT inert rule stand.
1349
+ # Reviewed re-pin (#1018 twin T1, base d94a83792), for open_db #2.
1350
+ # Changed: the binding `STATS_INDEX_EPOCH` 1023 -> 1024 (spec 5.1) and the
1351
+ # producer `open_db` itself, whose epoch-1024 schema block creates
1352
+ # `claude_weekly_observation_index` with the four enriched columns
1353
+ # (`weekly_percent`, `weekly_resets_at_utc`, `weekly_reading_genuine`,
1354
+ # `weekly_freshness_eligible`) and the partial index
1355
+ # `idx_claude_weekly_observation_index_freshness`; those are literal
1356
+ # statements, registered as their own MAINT contracts. No SQL, table
1357
+ # selection, predicate, ordering, selected column, execution condition or
1358
+ # effect of this site changed, so the contract and its MAINT inert rule
1359
+ # stand.
1360
+ # Reviewed re-pin (#1050 T2, base a858a87ab), for open_db #2. Changed:
1361
+ # only the producer `open_db` itself, which now calls the new helper
1362
+ # `_ensure_stats_content_revision` before both current-epoch `return
1363
+ # conn` paths and after the epoch stamp of the fresh, scratch and cutover
1364
+ # schema apply (spec 4.3). That helper installs the content-revision
1365
+ # kernel's tables, triggers and index; its statements are registered as
1366
+ # their own MAINT contracts under `_lib_stats_content_revision`. No SQL,
1367
+ # table selection, predicate, ordering, selected column, execution
1368
+ # condition or effect of this site changed, so the contract and its MAINT
1369
+ # inert rule stand.
1311
1370
  AccessContract(
1312
1371
  function='_cctally_core:open_db',
1313
1372
  sql_fingerprint='dynamic:_cctally_core:open_db#2',
1314
- sql_shape='sha256:7d7365dfd8acf5d3',
1373
+ sql_shape='sha256:da7e324fa4e6c968',
1315
1374
  table='dynamic',
1316
1375
  keys=(),
1317
1376
  predicate='dynamic SQL',
@@ -1347,10 +1406,31 @@ REGISTRY: "tuple[AccessContract, ...]" = (
1347
1406
  # as their own MAINT contracts. No SQL, table selection, predicate,
1348
1407
  # ordering, selected column, execution condition or effect of this site
1349
1408
  # changed, so the contract and its MAINT inert rule stand.
1409
+ # Reviewed re-pin (#1018 twin T1, base d94a83792), for open_db #3.
1410
+ # Changed: the binding `STATS_INDEX_EPOCH` 1023 -> 1024 (spec 5.1) and the
1411
+ # producer `open_db` itself, whose epoch-1024 schema block creates
1412
+ # `claude_weekly_observation_index` with the four enriched columns
1413
+ # (`weekly_percent`, `weekly_resets_at_utc`, `weekly_reading_genuine`,
1414
+ # `weekly_freshness_eligible`) and the partial index
1415
+ # `idx_claude_weekly_observation_index_freshness`; those are literal
1416
+ # statements, registered as their own MAINT contracts. No SQL, table
1417
+ # selection, predicate, ordering, selected column, execution condition or
1418
+ # effect of this site changed, so the contract and its MAINT inert rule
1419
+ # stand.
1420
+ # Reviewed re-pin (#1050 T2, base a858a87ab), for open_db #3. Changed:
1421
+ # only the producer `open_db` itself, which now calls the new helper
1422
+ # `_ensure_stats_content_revision` before both current-epoch `return
1423
+ # conn` paths and after the epoch stamp of the fresh, scratch and cutover
1424
+ # schema apply (spec 4.3). That helper installs the content-revision
1425
+ # kernel's tables, triggers and index; its statements are registered as
1426
+ # their own MAINT contracts under `_lib_stats_content_revision`. No SQL,
1427
+ # table selection, predicate, ordering, selected column, execution
1428
+ # condition or effect of this site changed, so the contract and its MAINT
1429
+ # inert rule stand.
1350
1430
  AccessContract(
1351
1431
  function='_cctally_core:open_db',
1352
1432
  sql_fingerprint='dynamic:_cctally_core:open_db#3',
1353
- sql_shape='sha256:d3d6289b75b86c2f',
1433
+ sql_shape='sha256:c3f6f15f3c9914f7',
1354
1434
  table='dynamic',
1355
1435
  keys=(),
1356
1436
  predicate='dynamic SQL',
@@ -1387,7 +1467,12 @@ REGISTRY: "tuple[AccessContract, ...]" = (
1387
1467
  AccessContract(
1388
1468
  function='_cctally_forecast:_fetch_current_week_snapshots',
1389
1469
  sql_fingerprint='dynamic:_cctally_forecast:_fetch_current_week_snapshots#1',
1390
- sql_shape='sha256:bc82aa15fa1aa9ed',
1470
+ # Reviewed re-pin (#1018 twin T3, base 90dc7562c): the opt-in
1471
+ # `include_journal_id` binding appends `, journal_id` to the selected
1472
+ # columns (after the optional account, before the trailing row id).
1473
+ # Read-only; no predicate, ordering or account scope changed, and
1474
+ # every existing caller's selected columns are unchanged.
1475
+ sql_shape='sha256:9e126e751be4da6b',
1391
1476
  table='dynamic',
1392
1477
  keys=(),
1393
1478
  predicate='dynamic SQL',
@@ -1400,7 +1485,12 @@ REGISTRY: "tuple[AccessContract, ...]" = (
1400
1485
  AccessContract(
1401
1486
  function='_cctally_forecast:_fetch_current_week_snapshots',
1402
1487
  sql_fingerprint='dynamic:_cctally_forecast:_fetch_current_week_snapshots#2',
1403
- sql_shape='sha256:372400419fad0c9e',
1488
+ # Reviewed re-pin (#1018 twin T3, base 90dc7562c): the opt-in
1489
+ # `include_journal_id` binding appends `, journal_id` to the selected
1490
+ # columns (after the optional account, before the trailing row id).
1491
+ # Read-only; no predicate, ordering or account scope changed, and
1492
+ # every existing caller's selected columns are unchanged.
1493
+ sql_shape='sha256:144e218d4af90f27',
1404
1494
  table='dynamic',
1405
1495
  keys=(),
1406
1496
  predicate='dynamic SQL',
@@ -1413,7 +1503,12 @@ REGISTRY: "tuple[AccessContract, ...]" = (
1413
1503
  AccessContract(
1414
1504
  function='_cctally_forecast:_fetch_current_week_snapshots',
1415
1505
  sql_fingerprint='dynamic:_cctally_forecast:_fetch_current_week_snapshots#3',
1416
- sql_shape='sha256:4f8ce3420819f7e2',
1506
+ # Reviewed re-pin (#1018 twin T3, base 90dc7562c): the opt-in
1507
+ # `include_journal_id` binding appends `, journal_id` to the selected
1508
+ # columns (after the optional account, before the trailing row id).
1509
+ # Read-only; no predicate, ordering or account scope changed, and
1510
+ # every existing caller's selected columns are unchanged.
1511
+ sql_shape='sha256:210baccc777fcd1e',
1417
1512
  table='dynamic',
1418
1513
  keys=(),
1419
1514
  predicate='dynamic SQL',
@@ -1426,7 +1521,12 @@ REGISTRY: "tuple[AccessContract, ...]" = (
1426
1521
  AccessContract(
1427
1522
  function='_cctally_forecast:_fetch_current_week_snapshots',
1428
1523
  sql_fingerprint='dynamic:_cctally_forecast:_fetch_current_week_snapshots#4',
1429
- sql_shape='sha256:61d729e93a7eeffe',
1524
+ # Reviewed re-pin (#1018 twin T3, base 90dc7562c): the opt-in
1525
+ # `include_journal_id` binding appends `, journal_id` to the selected
1526
+ # columns (after the optional account, before the trailing row id).
1527
+ # Read-only; no predicate, ordering or account scope changed, and
1528
+ # every existing caller's selected columns are unchanged.
1529
+ sql_shape='sha256:fe11d3e5ad616f9f',
1430
1530
  table='dynamic',
1431
1531
  keys=(),
1432
1532
  predicate='dynamic SQL',
@@ -1461,10 +1561,24 @@ REGISTRY: "tuple[AccessContract, ...]" = (
1461
1561
  # covers keep their table selection, predicate, ordering, selected
1462
1562
  # columns, parameter construction, execution conditions and effects, so
1463
1563
  # the contract and its inert rule stand.
1564
+ #
1565
+ # Reviewed re-pin (#982 #975 T1, base 3d3e759da), for #1 and #2.
1566
+ # Changed (`~ producer`): only the producer's choice of reset-anchor
1567
+ # resolver. It gains an optional `anchors=` argument; when given, it is
1568
+ # used in place of the per-call `_codex_anchor_resolver(cache)` (the
1569
+ # history provenance drain passes a resolver seeded from copies of its
1570
+ # committed-evidence base), and it is ignored when the cache lacks the
1571
+ # anchor column, exactly as the per-call resolver was. Every other caller
1572
+ # omits it and is unchanged. The resolver only computes the
1573
+ # `canonical_resets_at_utc` value the INSERT/UPSERT binds, as before; the
1574
+ # natural-key read and the INSERT/UPSERT keep their table selection,
1575
+ # predicate, ordering, selected columns, parameter construction,
1576
+ # execution conditions and effects, so the contract and its inert rule
1577
+ # stand.
1464
1578
  AccessContract(
1465
1579
  function='_cctally_journal:_apply_quota_records',
1466
1580
  sql_fingerprint='dynamic:_cctally_journal:_apply_quota_records#1',
1467
- sql_shape='sha256:265c580d51dc9ea0',
1581
+ sql_shape='sha256:6163599100a812de',
1468
1582
  table='dynamic',
1469
1583
  keys=(),
1470
1584
  predicate='dynamic SQL',
@@ -1477,7 +1591,7 @@ REGISTRY: "tuple[AccessContract, ...]" = (
1477
1591
  AccessContract(
1478
1592
  function='_cctally_journal:_apply_quota_records',
1479
1593
  sql_fingerprint='dynamic:_cctally_journal:_apply_quota_records#2',
1480
- sql_shape='sha256:b1a8eedf9a7f98c9',
1594
+ sql_shape='sha256:c04f34a3783ade13',
1481
1595
  table='dynamic',
1482
1596
  keys=(),
1483
1597
  predicate='dynamic SQL',
@@ -2053,10 +2167,15 @@ REGISTRY: "tuple[AccessContract, ...]" = (
2053
2167
  # SQL, table selection, predicate, ordering, selected column, execution
2054
2168
  # condition or effect of these sites changed, so each contract and its
2055
2169
  # inert rule stand.
2170
+ # Reviewed re-pin (#1018 twin T1, base d94a83792), for _publish_generation_in_place #1. Changed:
2171
+ # only the binding `STATS_INDEX_EPOCH` 1023 -> 1024 (spec 5.1). No SQL,
2172
+ # table selection, predicate, ordering, selected column, execution
2173
+ # condition or effect of this site changed, so the contract and its
2174
+ # inert rule stand.
2056
2175
  AccessContract(
2057
2176
  function='_cctally_journal:_publish_generation_in_place',
2058
2177
  sql_fingerprint='dynamic:_cctally_journal:_publish_generation_in_place#1',
2059
- sql_shape='sha256:3dbfedf9486acbb9',
2178
+ sql_shape='sha256:dc539be3e0b79518',
2060
2179
  table='dynamic',
2061
2180
  keys=(),
2062
2181
  predicate='dynamic SQL',
@@ -2075,10 +2194,15 @@ REGISTRY: "tuple[AccessContract, ...]" = (
2075
2194
  # the binding `STATS_INDEX_EPOCH` 1021 -> 1022 (spec 5.1). No SQL, table
2076
2195
  # selection, predicate, ordering, selected column, execution condition or
2077
2196
  # effect of this site changed, so the contract and its inert rule stand.
2197
+ # Reviewed re-pin (#1018 twin T1, base d94a83792), for _publish_generation_in_place #2. Changed:
2198
+ # only the binding `STATS_INDEX_EPOCH` 1023 -> 1024 (spec 5.1). No SQL,
2199
+ # table selection, predicate, ordering, selected column, execution
2200
+ # condition or effect of this site changed, so the contract and its
2201
+ # inert rule stand.
2078
2202
  AccessContract(
2079
2203
  function='_cctally_journal:_publish_generation_in_place',
2080
2204
  sql_fingerprint='dynamic:_cctally_journal:_publish_generation_in_place#2',
2081
- sql_shape='sha256:cde6ffe8c29bd1a7',
2205
+ sql_shape='sha256:a997bd74615a0821',
2082
2206
  table='dynamic',
2083
2207
  keys=(),
2084
2208
  predicate='dynamic SQL',
@@ -2097,10 +2221,15 @@ REGISTRY: "tuple[AccessContract, ...]" = (
2097
2221
  # the binding `STATS_INDEX_EPOCH` 1021 -> 1022 (spec 5.1). No SQL, table
2098
2222
  # selection, predicate, ordering, selected column, execution condition or
2099
2223
  # effect of this site changed, so the contract and its inert rule stand.
2224
+ # Reviewed re-pin (#1018 twin T1, base d94a83792), for _publish_generation_in_place #3. Changed:
2225
+ # only the binding `STATS_INDEX_EPOCH` 1023 -> 1024 (spec 5.1). No SQL,
2226
+ # table selection, predicate, ordering, selected column, execution
2227
+ # condition or effect of this site changed, so the contract and its
2228
+ # inert rule stand.
2100
2229
  AccessContract(
2101
2230
  function='_cctally_journal:_publish_generation_in_place',
2102
2231
  sql_fingerprint='dynamic:_cctally_journal:_publish_generation_in_place#3',
2103
- sql_shape='sha256:cde6ffe8c29bd1a7',
2232
+ sql_shape='sha256:a997bd74615a0821',
2104
2233
  table='dynamic',
2105
2234
  keys=(),
2106
2235
  predicate='dynamic SQL',
@@ -2119,10 +2248,15 @@ REGISTRY: "tuple[AccessContract, ...]" = (
2119
2248
  # the binding `STATS_INDEX_EPOCH` 1021 -> 1022 (spec 5.1). No SQL, table
2120
2249
  # selection, predicate, ordering, selected column, execution condition or
2121
2250
  # effect of this site changed, so the contract and its inert rule stand.
2251
+ # Reviewed re-pin (#1018 twin T1, base d94a83792), for _publish_generation_in_place #4. Changed:
2252
+ # only the binding `STATS_INDEX_EPOCH` 1023 -> 1024 (spec 5.1). No SQL,
2253
+ # table selection, predicate, ordering, selected column, execution
2254
+ # condition or effect of this site changed, so the contract and its
2255
+ # inert rule stand.
2122
2256
  AccessContract(
2123
2257
  function='_cctally_journal:_publish_generation_in_place',
2124
2258
  sql_fingerprint='dynamic:_cctally_journal:_publish_generation_in_place#4',
2125
- sql_shape='sha256:e42670f9ea1e0bc2',
2259
+ sql_shape='sha256:e2a4af53267f96f7',
2126
2260
  table='dynamic',
2127
2261
  keys=(),
2128
2262
  predicate='dynamic SQL',
@@ -2141,10 +2275,15 @@ REGISTRY: "tuple[AccessContract, ...]" = (
2141
2275
  # the binding `STATS_INDEX_EPOCH` 1021 -> 1022 (spec 5.1). No SQL, table
2142
2276
  # selection, predicate, ordering, selected column, execution condition or
2143
2277
  # effect of this site changed, so the contract and its inert rule stand.
2278
+ # Reviewed re-pin (#1018 twin T1, base d94a83792), for _publish_generation_in_place #5. Changed:
2279
+ # only the binding `STATS_INDEX_EPOCH` 1023 -> 1024 (spec 5.1). No SQL,
2280
+ # table selection, predicate, ordering, selected column, execution
2281
+ # condition or effect of this site changed, so the contract and its
2282
+ # inert rule stand.
2144
2283
  AccessContract(
2145
2284
  function='_cctally_journal:_publish_generation_in_place',
2146
2285
  sql_fingerprint='dynamic:_cctally_journal:_publish_generation_in_place#5',
2147
- sql_shape='sha256:cde6ffe8c29bd1a7',
2286
+ sql_shape='sha256:a997bd74615a0821',
2148
2287
  table='dynamic',
2149
2288
  keys=(),
2150
2289
  predicate='dynamic SQL',
@@ -2388,10 +2527,127 @@ REGISTRY: "tuple[AccessContract, ...]" = (
2388
2527
  # `_REBUILD_COUNT_TABLES`, its table selection, predicate, ordering,
2389
2528
  # selected column, parameters, execution condition and read-only effect
2390
2529
  # are unchanged, so the contract and its MAINT inert rule stand.
2530
+ # Reviewed re-pin (#1003/#1004, base bfc595fe9), for
2531
+ # _rebuild_stats_index_locked #1. Added: `binding` and `assigned`
2532
+ # `_cctally_record._BLOCK_TOTALS_ENGINE` (#1003 D1's engine slot, which
2533
+ # `_compute_block_totals` consults; only `_scratch_read_adapters` sets it,
2534
+ # never this rebuild), `computed-by _cctally_record._block_totals_reprice`
2535
+ # (today's full re-price body, moved unchanged out of
2536
+ # `_compute_block_totals`) and `binding
2537
+ # _lib_retained_records.MATERIALIZE_FOR_TESTS` (#1004 D4's test switch).
2538
+ # Changed: `BlockTotals` (gains `add_priced`, the one per-entry fold step
2539
+ # `fold_block_totals` and the engine share), `_compute_block_totals` and
2540
+ # `fold_block_totals` (the seam and the shared step, same additions in the
2541
+ # same order), and the producer, whose read pass keeps its retained
2542
+ # records as a coordinate-backed `RetainedRecords` and installs the legacy
2543
+ # account normalization as a decode-time hook instead of an in-place loop.
2544
+ # All of it is Python state, never SQL: this site's `SELECT COUNT(*) FROM
2545
+ # {tbl}` over the unchanged `_REBUILD_COUNT_TABLES`, its table selection,
2546
+ # predicate, ordering, selected column, parameters, execution condition
2547
+ # and read-only effect are unchanged, so the contract and its MAINT inert
2548
+ # rule stand.
2549
+ # Reviewed re-pin (#916, base 6807e4052), for
2550
+ # _rebuild_stats_index_locked #1. The closure reaches
2551
+ # `_cctally_cache.sync_cache`. Added: `binding _cctally_cache._ingest_frontier`
2552
+ # (the module's existing frontier handle, which sync_cache now reads for
2553
+ # the `claude_ingest_walk_orphan_residual` key) and `computed-by
2554
+ # _cctally_cache._clear_claude_walk_verdicts` (the rebuild and truncation
2555
+ # wipes' single DELETE of the walk-complete marker and that token).
2556
+ # Changed: `sync_cache` (an orphan-only walk now ends residual-only and
2557
+ # writes the token instead of the marker, the re-walk UPSERT is chosen per
2558
+ # file from its own -1 cursor, and `finally` withdraws both verdicts),
2559
+ # `IngestStats` (gains `full_walk_residual_only` and
2560
+ # `orphan_residual_count`), and `assigned _LAST_WARNED_ORPHAN_SET`, whose
2561
+ # assigning body is sync_cache; the warning throttle itself is unchanged.
2562
+ # All of it is cache.db Python state, never SQL: this site's
2563
+ # `SELECT COUNT(*) FROM {tbl}` over the unchanged `_REBUILD_COUNT_TABLES`,
2564
+ # its table selection, predicate, ordering, selected column, parameters,
2565
+ # execution condition and read-only effect are unchanged, so the contract
2566
+ # and its MAINT inert rule stand.
2567
+ # Reviewed re-pin (#1018 twin T1, base d94a83792), for
2568
+ # _rebuild_stats_index_locked #1. Added: the bindings
2569
+ # `_cctally_oauth_samples._HOLD_ELIGIBILITY`, `_READ_ELIGIBILITY_FACTS`
2570
+ # and `_SET_ELIGIBILITY` and `_lib_oauth_samples._CANONICAL_FORMAT`, and
2571
+ # `computed-by` `_cctally_oauth_samples._maintain_freshness_eligibility`,
2572
+ # `_before_reset`, `_lib_oauth_samples.canonical_instant`, `_parse_aware`
2573
+ # and `format_request_started`. Changed: `STATS_INDEX_EPOCH` 1023 -> 1024,
2574
+ # the helper `open_db` (see the open_db re-pin) and the fold applier
2575
+ # `apply_weekly_observation_decision_op` (`~ computed-by`), which beside
2576
+ # its unchanged decision upsert and history insert now keeps the decided
2577
+ # observation's `claude_weekly_observation_index.weekly_freshness_eligible`
2578
+ # current by primary key: a `hold` clears it, an `accept` reads that row's
2579
+ # stored genuine flag, weekly value, reset and capture and recomputes it
2580
+ # with the parsed pre-reset test (spec 5.1). Those are keyed writes to a
2581
+ # projection no detector decision reads. This site's `SELECT COUNT(*)
2582
+ # FROM {tbl}` over the unchanged `_REBUILD_COUNT_TABLES`, its execution
2583
+ # condition and its read-only effect are unchanged, so the contract and
2584
+ # its MAINT inert rule stand.
2585
+ # Reviewed re-pin (#1050 T2, base a858a87ab), for
2586
+ # _rebuild_stats_index_locked #1. Added: `helper
2587
+ # _cctally_core:_ensure_stats_content_revision` and the
2588
+ # `_lib_stats_content_revision` installer it calls (`helper`
2589
+ # `ensure_stats_content_revision`, `classify`, `_inspect`, `_install`,
2590
+ # `_default_guard`, `_contention_errors`, `_is_busy`), with every binding
2591
+ # and `computed-by` they read: the kernel's table/index/trigger SQL
2592
+ # (`REVISION_TABLE_SQL`, `SCOPE_TABLE_SQL`, `USAGE_SNAPSHOT_INDEX_SQL`,
2593
+ # `TRIGGER_SQL` built by `_trigger_sql`/`_body`/`_upsert`/`_owner`/
2594
+ # `_render`/`_scope_selects` over `TRACKED_TABLES`), its names, states
2595
+ # and `_SCHEMA_READ`. Changed: the helper `open_db` (see the open_db
2596
+ # re-pin). The rebuild reaches them only through the scratch's
2597
+ # `open_db(_target_path=...)` schema apply, which now installs the
2598
+ # kernel objects into the scratch (spec 4.3); each installer statement
2599
+ # is registered as its own MAINT contract. This site's `SELECT COUNT(*)
2600
+ # FROM {tbl}` over the unchanged `_REBUILD_COUNT_TABLES`, its execution
2601
+ # condition and its read-only effect are unchanged, so the contract and
2602
+ # its MAINT inert rule stand.
2603
+ # Reviewed re-pin (#1050 T3, base 737379aab), for
2604
+ # _rebuild_stats_index_locked #1. Added: `computed-by
2605
+ # _lib_stats_content_revision.child_set_unchanged` with its helper
2606
+ # `_default_value` and bindings `CHILD_TABLES`, `_CHILD_SELECTS`,
2607
+ # `_CHILD_COLUMNS` and `_UNDECIDABLE`, and `computed-by
2608
+ # _cctally_five_hour._open_block_child_rows`. Changed: `computed-by
2609
+ # _cctally_five_hour.project_open_block_end`, reached through
2610
+ # `_refresh_every_open_block` in the scratch rebuild: it now builds its
2611
+ # model and project rows with `_open_block_child_rows` and skips its
2612
+ # unchanged DELETE and INSERT statements when
2613
+ # `child_set_unchanged` finds the stored set equal to them (an
2614
+ # exact-key read of the same window and account the DELETE names). The
2615
+ # rows the projection leaves are identical either way. This site's
2616
+ # `SELECT COUNT(*) FROM {tbl}` over the unchanged `_REBUILD_COUNT_TABLES`,
2617
+ # its execution condition and its read-only effect are unchanged, so the
2618
+ # contract and its MAINT inert rule stand.
2619
+ # Reviewed re-pin (#1050 T3 fix, base 7602973ef), for
2620
+ # _rebuild_stats_index_locked #1. Changed: only the binding
2621
+ # `_lib_stats_content_revision._CHILD_COLUMNS`, which drops its
2622
+ # `ORDER BY cid` (the column order only has to agree between the two
2623
+ # tuple sets built from that one read, and the sort cost a temp B-tree on
2624
+ # the live record path). The column set it returns is unchanged, so the
2625
+ # contract and its MAINT inert rule stand.
2626
+ # Reviewed re-pin (#1055, base a2b64a5fb; the same delta on a merge
2627
+ # candidate over d2da6cd94), for _rebuild_stats_index_locked #1, reached
2628
+ # through `sync_cache`. Added: `computed-by
2629
+ # _cctally_cache._wait_behind_drain_unit` and the
2630
+ # `_lib_codex_drain_admission` helpers it calls (`ClaudeWaiter`,
2631
+ # `_waiter_path`, `lock_busy`), their bindings
2632
+ # (`CLAUDE_HOOK_DRAIN_POLL_SECONDS`, `CLAUDE_WAITER_FILE_NAME`,
2633
+ # `CLAUDE_WAITER_HOLD_ALLOWANCE_SECONDS`, `GATE_FILE_NAME`,
2634
+ # `_WAITER_MAGIC`, `_WAITER_VERSION`, `_monotonic_ns`) and `assigned
2635
+ # _cctally_core.CACHE_LOCK_CODEX_PATH`, the lock the wait probes.
2636
+ # Changed: `sync_cache` (its `drain_wait_seconds` keyword, the bounded
2637
+ # wait after a refused first attempt, and the nested cleanup that
2638
+ # unlocks before it releases the waiter), `_acquire_cache_flock` (its
2639
+ # `poll` and absolute `deadline` keywords; a `timeout`-only call keeps
2640
+ # the old loop) and `assigned _LAST_WARNED_ORPHAN_SET`, whose assigning
2641
+ # body is sync_cache. All of it is lock-file and waiter-record Python
2642
+ # state, never SQL, and only the hook-tick Claude leg passes
2643
+ # `drain_wait_seconds`, so the wait never runs on the rebuild path. This
2644
+ # site's `SELECT COUNT(*) FROM {tbl}` over the unchanged
2645
+ # `_REBUILD_COUNT_TABLES`, its execution condition and its read-only
2646
+ # effect are unchanged, so the contract and its MAINT inert rule stand.
2391
2647
  AccessContract(
2392
2648
  function='_cctally_journal:_rebuild_stats_index_locked',
2393
2649
  sql_fingerprint='dynamic:_cctally_journal:_rebuild_stats_index_locked#1',
2394
- sql_shape='sha256:d9d1dae4e1f35d58',
2650
+ sql_shape='sha256:2c06127369fd4dad',
2395
2651
  table='dynamic',
2396
2652
  keys=(),
2397
2653
  predicate='dynamic SQL',
@@ -2485,10 +2741,18 @@ REGISTRY: "tuple[AccessContract, ...]" = (
2485
2741
  classes=('period-keyed',),
2486
2742
  inert_rule=JOURNAL,
2487
2743
  ),
2744
+ # Reviewed re-pin (#1003 D1, base bfc595fe9), for _joined_entries #1.
2745
+ # Changed: only the producer. The row-to-entry construction moved
2746
+ # unchanged into `_joined_entry_from_row`, which `BlockTotalsEngine`
2747
+ # shares so an engine entry equals a fresh query's field for field. The
2748
+ # SQL text, its cache.db `session_entries`/`session_files` tables,
2749
+ # predicate, ordering, selected columns, parameters and read-only effect
2750
+ # are unchanged, and it never reads stats.db, so the contract and its
2751
+ # MAINT inert rule stand.
2488
2752
  AccessContract(
2489
2753
  function='_cctally_rederive:_joined_entries',
2490
2754
  sql_fingerprint='dynamic:_cctally_rederive:_joined_entries#1',
2491
- sql_shape='sha256:2956a402028d910d',
2755
+ sql_shape='sha256:019898f4526da0c8',
2492
2756
  table='dynamic',
2493
2757
  keys=(),
2494
2758
  predicate='dynamic SQL over cache.db session entries only (the scratch derivation cost read); never stats.db',
@@ -2542,10 +2806,21 @@ REGISTRY: "tuple[AccessContract, ...]" = (
2542
2806
  classes=('cross-period',),
2543
2807
  inert_rule=MAINT,
2544
2808
  ),
2809
+ # Reviewed re-pin (#1050 T3, base 737379aab), for
2810
+ # _replace_block_children #1. Changed: only the producer itself. It
2811
+ # builds each child set's rows first and calls
2812
+ # `_lib_stats_content_revision.child_set_unchanged` (its own contract
2813
+ # below) with the same window and account as this DELETE's predicate,
2814
+ # skipping the DELETE and the strict INSERTs when the stored set equals
2815
+ # them. The `DELETE FROM {child_table} WHERE {predicate}` over the
2816
+ # unchanged `_BLOCK_CHILDREN`, its predicate and parameter construction
2817
+ # and its effect are unchanged; it now runs only when the set differs,
2818
+ # and the rows left behind are identical either way, so the contract and
2819
+ # its JOURNAL inert rule stand.
2545
2820
  AccessContract(
2546
2821
  function='_cctally_journal:_replace_block_children',
2547
2822
  sql_fingerprint='dynamic:_cctally_journal:_replace_block_children#1',
2548
- sql_shape='sha256:98c56d859553c085',
2823
+ sql_shape='sha256:d8dee0c16168bf40',
2549
2824
  table='dynamic',
2550
2825
  keys=(),
2551
2826
  predicate='dynamic SQL',
@@ -3148,10 +3423,15 @@ REGISTRY: "tuple[AccessContract, ...]" = (
3148
3423
  # name with the same statement shape. No SQL, table selection,
3149
3424
  # predicate, ordering, selected column, execution condition or effect of
3150
3425
  # this site changed, so the contract and its inert rule stand.
3426
+ # Reviewed re-pin (#1018 twin T1, base d94a83792), for stats_index_matches_journal_prefix #1. Changed:
3427
+ # only the binding `STATS_INDEX_EPOCH` 1023 -> 1024 (spec 5.1). No SQL,
3428
+ # table selection, predicate, ordering, selected column, execution
3429
+ # condition or effect of this site changed, so the contract and its
3430
+ # inert rule stand.
3151
3431
  AccessContract(
3152
3432
  function='_cctally_journal:stats_index_matches_journal_prefix',
3153
3433
  sql_fingerprint='dynamic:_cctally_journal:stats_index_matches_journal_prefix#1',
3154
- sql_shape='sha256:b27ac2227f9613cb',
3434
+ sql_shape='sha256:ee1cf10e54836826',
3155
3435
  table='dynamic',
3156
3436
  keys=(),
3157
3437
  predicate='dynamic SQL',
@@ -3323,6 +3603,12 @@ REGISTRY: "tuple[AccessContract, ...]" = (
3323
3603
  # completion step, else INSERT OR IGNORE) and its footprint. All are
3324
3604
  # keyed writes that a replay repeats to the same rows, and no detector
3325
3605
  # decision reads them.
3606
+ # #1018 twin (spec 5.1): the two index writes also carry the enriched
3607
+ # columns, and their freshness eligibility consults the effective
3608
+ # reviewed decision of the same observation id (a decision folded before
3609
+ # its observation still applies). The read is keyed and feeds only the
3610
+ # written eligibility, which the current-week freshness reader alone
3611
+ # consumes; no detector decision reads it.
3326
3612
  AccessContract(
3327
3613
  function='_cctally_journal:write_batch_lineage',
3328
3614
  sql_fingerprint='INSERT INTO correction_batch_lineage (batch_id, commit_segment, commit_offset) VALUES (?, ?, ?) ON CONFLICT(batch_id) DO UPDATE SET commit_segment = excluded.commit_segment, commit_offset = excluded.commit_offset',
@@ -3361,10 +3647,10 @@ REGISTRY: "tuple[AccessContract, ...]" = (
3361
3647
  ),
3362
3648
  AccessContract(
3363
3649
  function='_cctally_oauth_samples:attribute_staged_observations',
3364
- sql_fingerprint='INSERT OR IGNORE INTO claude_weekly_observation_index (observation_id, account_key, captured_at_utc) SELECT observation_id, ?, captured_at_utc FROM rebuild_weekly_observation_unstamped',
3650
+ sql_fingerprint="INSERT OR IGNORE INTO claude_weekly_observation_index (observation_id, account_key, captured_at_utc, weekly_percent, weekly_resets_at_utc, weekly_reading_genuine, weekly_freshness_eligible) SELECT s.observation_id, ?, s.captured_at_utc, s.weekly_percent, s.weekly_resets_at_utc, s.base_genuine AND (s.required_account IS NULL OR s.required_account = ?), s.base_genuine AND (s.required_account IS NULL OR s.required_account = ?) AND s.pre_reset AND NOT EXISTS (SELECT 1 FROM claude_weekly_observation_decisions AS d WHERE d.observation_id = s.observation_id AND d.disposition = 'hold') FROM rebuild_weekly_observation_unstamped AS s",
3365
3651
  table='claude_weekly_observation_index',
3366
3652
  keys=('observation_id',),
3367
- predicate='',
3653
+ predicate="eligibility reads claude_weekly_observation_decisions by observation_id (disposition = 'hold')",
3368
3654
  ordering='',
3369
3655
  selected=(),
3370
3656
  effects='write',
@@ -3373,10 +3659,10 @@ REGISTRY: "tuple[AccessContract, ...]" = (
3373
3659
  ),
3374
3660
  AccessContract(
3375
3661
  function='_cctally_oauth_samples:project_observation',
3376
- sql_fingerprint='INSERT OR IGNORE INTO claude_weekly_observation_index (observation_id, account_key, captured_at_utc) VALUES (?, ?, ?)',
3662
+ sql_fingerprint="INSERT OR IGNORE INTO claude_weekly_observation_index (observation_id, account_key, captured_at_utc, weekly_percent, weekly_resets_at_utc, weekly_reading_genuine, weekly_freshness_eligible) VALUES (?, ?, ?, ?, ?, ?, ? AND NOT EXISTS (SELECT 1 FROM claude_weekly_observation_decisions AS d WHERE d.observation_id = ? AND d.disposition = 'hold'))",
3377
3663
  table='claude_weekly_observation_index',
3378
3664
  keys=('observation_id',),
3379
- predicate='',
3665
+ predicate="eligibility reads claude_weekly_observation_decisions by observation_id (disposition = 'hold')",
3380
3666
  ordering='',
3381
3667
  selected=(),
3382
3668
  effects='write',
@@ -5109,10 +5395,32 @@ REGISTRY: "tuple[AccessContract, ...]" = (
5109
5395
  classes=('cross-period',),
5110
5396
  inert_rule=MAINT,
5111
5397
  ),
5398
+ # #1003 D2 (base bfc595fe9): the policy's own page-cache pragma,
5399
+ # `PRAGMA cache_size=-{DISPOSABLE_SCRATCH_CACHE_SIZE_KIB}` (64 MiB), is
5400
+ # now the first dynamic site, so the replay-index loop moved to #2 with
5401
+ # its contract and shape unchanged apart from the producer (and the
5402
+ # constant the producer now names). The pragma sets the private scratch
5403
+ # connection's cache, before its replay, beside the static
5404
+ # `journal_mode=MEMORY` and `synchronous=OFF` pragmas of the same policy;
5405
+ # it reads and writes no table and changes no result set, and it never
5406
+ # runs on a published index or inside a live automatic decision.
5112
5407
  AccessContract(
5113
5408
  function='_cctally_store:apply_disposable_scratch_policy',
5114
5409
  sql_fingerprint='dynamic:_cctally_store:apply_disposable_scratch_policy#1',
5115
- sql_shape='sha256:fe12cdb5583c26fc',
5410
+ sql_shape='sha256:2260b6be0f086524',
5411
+ table='dynamic',
5412
+ keys=(),
5413
+ predicate='dynamic PRAGMA cache_size on the disposable scratch connection; no table',
5414
+ ordering='',
5415
+ selected=(),
5416
+ effects='write',
5417
+ classes=('singleton',),
5418
+ inert_rule=MAINT,
5419
+ ),
5420
+ AccessContract(
5421
+ function='_cctally_store:apply_disposable_scratch_policy',
5422
+ sql_fingerprint='dynamic:_cctally_store:apply_disposable_scratch_policy#2',
5423
+ sql_shape='sha256:94c0a37bd46dce8c',
5116
5424
  table='dynamic',
5117
5425
  keys=(),
5118
5426
  predicate='dynamic SQL',
@@ -5196,6 +5504,169 @@ REGISTRY: "tuple[AccessContract, ...]" = (
5196
5504
  classes=('period-keyed',),
5197
5505
  inert_rule=None,
5198
5506
  ),
5507
+ # #1050 T2: the content-revision kernel's installer (spec 4.3), reached
5508
+ # from every `open_db` path. Each statement creates, seeds or repairs the
5509
+ # kernel's own objects under the open-time maintenance guard; none is read
5510
+ # by a detector decision.
5511
+ AccessContract(
5512
+ function='_lib_stats_content_revision:_inspect',
5513
+ sql_fingerprint='SELECT singleton, format_version, domain_generation, seq FROM stats_content_revision LIMIT 2',
5514
+ table='stats_content_revision',
5515
+ keys=('singleton',),
5516
+ predicate='',
5517
+ ordering='',
5518
+ selected=('singleton', 'format_version', 'domain_generation', 'seq'),
5519
+ effects='read',
5520
+ classes=('singleton',),
5521
+ inert_rule=MAINT,
5522
+ ),
5523
+ AccessContract(
5524
+ function='_lib_stats_content_revision:_install',
5525
+ sql_fingerprint='CREATE INDEX idx_five_hour_milestones_usage_snapshot_id ON five_hour_milestones(usage_snapshot_id)',
5526
+ table='five_hour_milestones',
5527
+ keys=(),
5528
+ predicate='',
5529
+ ordering='',
5530
+ selected=(),
5531
+ effects='write',
5532
+ classes=('singleton',),
5533
+ inert_rule=MAINT,
5534
+ ),
5535
+ AccessContract(
5536
+ function='_lib_stats_content_revision:_install',
5537
+ sql_fingerprint='CREATE TABLE stats_content_revision (singleton INTEGER PRIMARY KEY CHECK (singleton = 1), format_version INTEGER NOT NULL CHECK (format_version >= 1), domain_generation INTEGER NOT NULL DEFAULT 0 CHECK (domain_generation >= 0), seq INTEGER NOT NULL DEFAULT 0 CHECK (seq >= 0))',
5538
+ table='stats_content_revision',
5539
+ keys=(),
5540
+ predicate='',
5541
+ ordering='',
5542
+ selected=(),
5543
+ effects='write',
5544
+ classes=('singleton',),
5545
+ inert_rule=MAINT,
5546
+ ),
5547
+ AccessContract(
5548
+ function='_lib_stats_content_revision:_install',
5549
+ sql_fingerprint="CREATE TABLE stats_content_revision_scopes (kind TEXT NOT NULL CHECK (kind IN ('cohort', 'bucket', 'block', 'reset_point')), account_key TEXT NOT NULL, scope_key TEXT NOT NULL, start_epoch INTEGER, end_epoch INTEGER, revision INTEGER NOT NULL, PRIMARY KEY (kind, account_key, scope_key))",
5550
+ table='stats_content_revision_scopes',
5551
+ keys=(),
5552
+ predicate='',
5553
+ ordering='',
5554
+ selected=(),
5555
+ effects='write',
5556
+ classes=('singleton',),
5557
+ inert_rule=MAINT,
5558
+ ),
5559
+ AccessContract(
5560
+ function='_lib_stats_content_revision:_install',
5561
+ sql_fingerprint='INSERT INTO stats_content_revision (singleton, format_version, domain_generation, seq) VALUES (1, ?, 0, 0)',
5562
+ table='stats_content_revision',
5563
+ keys=(),
5564
+ predicate='',
5565
+ ordering='',
5566
+ selected=(),
5567
+ effects='write',
5568
+ classes=('singleton',),
5569
+ inert_rule=MAINT,
5570
+ ),
5571
+ AccessContract(
5572
+ function='_lib_stats_content_revision:_install',
5573
+ sql_fingerprint='UPDATE stats_content_revision SET format_version = ?, domain_generation = ?, seq = ? WHERE singleton = 1',
5574
+ table='stats_content_revision',
5575
+ keys=('singleton',),
5576
+ predicate='singleton = 1',
5577
+ ordering='',
5578
+ selected=(),
5579
+ effects='write',
5580
+ classes=('singleton',),
5581
+ inert_rule=MAINT,
5582
+ ),
5583
+ AccessContract(
5584
+ function='_lib_stats_content_revision:_install',
5585
+ sql_fingerprint='dynamic:_lib_stats_content_revision:_install#1',
5586
+ sql_shape='sha256:15b28df089bc0407',
5587
+ table='dynamic',
5588
+ keys=(),
5589
+ predicate='dynamic SQL',
5590
+ ordering='',
5591
+ selected=(),
5592
+ effects='read',
5593
+ classes=('cross-period',),
5594
+ inert_rule=MAINT,
5595
+ ),
5596
+ AccessContract(
5597
+ function='_lib_stats_content_revision:_install',
5598
+ sql_fingerprint='dynamic:_lib_stats_content_revision:_install#2',
5599
+ sql_shape='sha256:96968b8250f530b2',
5600
+ table='dynamic',
5601
+ keys=(),
5602
+ predicate='dynamic SQL',
5603
+ ordering='',
5604
+ selected=(),
5605
+ effects='read',
5606
+ classes=('cross-period',),
5607
+ inert_rule=MAINT,
5608
+ ),
5609
+ AccessContract(
5610
+ function='_lib_stats_content_revision:_install',
5611
+ sql_fingerprint='dynamic:_lib_stats_content_revision:_install#3',
5612
+ sql_shape='sha256:2e1fd5db25812db9',
5613
+ table='dynamic',
5614
+ keys=(),
5615
+ predicate='dynamic SQL',
5616
+ ordering='',
5617
+ selected=(),
5618
+ effects='read',
5619
+ classes=('cross-period',),
5620
+ inert_rule=MAINT,
5621
+ ),
5622
+ AccessContract(
5623
+ function='_lib_stats_content_revision:ensure_stats_content_revision',
5624
+ sql_fingerprint='dynamic:_lib_stats_content_revision:ensure_stats_content_revision#1',
5625
+ sql_shape='sha256:7451a814fc141b51',
5626
+ table='dynamic',
5627
+ keys=(),
5628
+ predicate='dynamic SQL',
5629
+ ordering='',
5630
+ selected=(),
5631
+ effects='read',
5632
+ classes=('cross-period',),
5633
+ inert_rule=MAINT,
5634
+ ),
5635
+ AccessContract(
5636
+ function='_lib_stats_content_revision:ensure_stats_content_revision',
5637
+ sql_fingerprint='dynamic:_lib_stats_content_revision:ensure_stats_content_revision#2',
5638
+ sql_shape='sha256:b312dbf76e573326',
5639
+ table='dynamic',
5640
+ keys=(),
5641
+ predicate='dynamic SQL',
5642
+ ordering='',
5643
+ selected=(),
5644
+ effects='read',
5645
+ classes=('cross-period',),
5646
+ inert_rule=MAINT,
5647
+ ),
5648
+ # #1050 T3: the identical child-set check of the open-block projection
5649
+ # and the block-close fold/convergence. `SELECT * FROM {table}` over
5650
+ # `CHILD_TABLES` (the two five-hour block child tables) by the exact
5651
+ # window, and account when the caller's DELETE names one: the same
5652
+ # period-keyed rows the caller would replace, read only to skip a
5653
+ # rewrite that would store identical rows (BLOCKS).
5654
+ # Reviewed re-pin (#1050 T3 fix, base 7602973ef): only the binding
5655
+ # `_CHILD_COLUMNS` changed, dropping its `ORDER BY cid` as above; this
5656
+ # site's table set, keys, predicate and read-only effect are unchanged.
5657
+ AccessContract(
5658
+ function='_lib_stats_content_revision:child_set_unchanged',
5659
+ sql_fingerprint='dynamic:_lib_stats_content_revision:child_set_unchanged#1',
5660
+ sql_shape='sha256:2ff8bd5b011e00b5',
5661
+ table='dynamic',
5662
+ keys=('five_hour_window_key', 'account_key'),
5663
+ predicate='dynamic SQL',
5664
+ ordering='',
5665
+ selected=(),
5666
+ effects='read',
5667
+ classes=('period-keyed',),
5668
+ inert_rule=BLOCKS,
5669
+ ),
5199
5670
  )
5200
5671
 
5201
5672