Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(doctor): goldens carry the capacity forecast; table_bytes is volatile (#6696)

garrytan51613e61c770
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index 2a3fc4c786..5905d50240 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -472,16 +472,138 @@
{
"category": "ops",
"details": {
+ "background_pause_pct": 80,
"commands": [],
+ "docs": "docs/guides/concurrent-writes.md#quota-near-exhaustion",
"exact": true,
+ "forecast": {
+ "retention_days": 30,
+ "rows": [
+ {
+ "basis": "aggregate_1d_short_history",
+ "config_key": "persistence.limits.brain_lifetime_ids",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 8000000,
+ "max_day_7d": 24,
+ "pct": 0,
+ "per_day_7d": 24,
+ "recommended_limit": 16000000,
+ "resource": "lifetime_ids",
+ "scope": "brain",
+ "spike_day": null,
+ "status": "ok",
+ "used": 24,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history:gross_then_net",
+ "config_key": "persistence.limits.brain_terminal_bytes",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 68719476736,
+ "max_day_7d": 194961,
+ "net_per_day_7d": 58816,
+ "pct": 0,
+ "per_day_7d": 194961,
+ "reclaimable_bytes": 136145,
+ "recommended_limit": 137438953472,
+ "resource": "terminal_bytes",
+ "scope": "brain",
+ "spike_day": null,
+ "status": "ok",
+ "under_reserved_receipts": 0,
+ "used": 194961,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history",
+ "config_key": "persistence.limits.principal_lifetime_ids",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 2000000,
+ "max_day_7d": 24,
+ "pct": 0,
+ "per_day_7d": 24,
+ "recommended_limit": 4000000,
+ "resource": "lifetime_ids",
+ "scope": "principal:local_cli:<uuid>",
+ "spike_day": null,
+ "status": "ok",
+ "used": 24,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history:gross_then_net",
+ "config_key": "persistence.limits.principal_terminal_bytes",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 17179869184,
+ "max_day_7d": 194961,
+ "net_per_day_7d": 58816,
+ "pct": 0,
+ "per_day_7d": 194961,
+ "reclaimable_bytes": 136145,
+ "recommended_limit": 34359738368,
+ "resource": "terminal_bytes",
+ "scope": "principal:local_cli:<uuid>",
+ "spike_day": null,
+ "status": "ok",
+ "under_reserved_receipts": 0,
+ "used": 194961,
+ "window_days": 1
+ }
+ ],
+ "table_bytes": "<volatile>",
+ "thresholds": {
+ "fail_days": 7,
+ "fail_pct": 95,
+ "warn_days": 30,
+ "warn_pct": 80
+ },
+ "window_days": 1
+ },
"inspected": 2,
+ "paused_producers": [],
"resources": [],
- "truncated": false
+ "truncated": false,
+ "verify": "gbrain doctor --only persistence_capacity --json"
},
- "message": "Managed write capacity is below 80% of every cumulative limit.",
+ "message": "Managed write capacity is below 80% of every cumulative limit and none runs out within 30 days at its 7-day rate.",
"name": "persistence_capacity",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "docs": "docs/guides/repair.md#receipt-compaction",
+ "last_compaction": {
+ "at": "<ts>",
+ "compacted": 0,
+ "freed_bytes": 0,
+ "host_id": "<uuid>",
+ "skipped_by_reason": {}
+ },
+ "last_compaction_age_hours": 0,
+ "live_consumers": 0,
+ "stale_hours": 24
+ },
+ "message": "Receipt compaction last ran 0 hour(s) ago (compacted 0, freed 0 bytes).",
+ "name": "persistence_compaction",
+ "status": "ok"
+ },
+ {
+ "category": "ops",
+ "details": {
+ "docs": "docs/guides/concurrent-writes.md#counter-drift",
+ "drift": [],
+ "inspected": 2,
+ "true_up_clamped": 0
+ },
+ "message": "Receipt-bytes counters match the receipts they account for (2 scope(s)).",
+ "name": "persistence_counter_drift",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -898,7 +1020,7 @@
"days_to_exhaustion": null,
"exhaustion_date": null,
"lifetime_ids": 24,
- "limit": 1000000,
+ "limit": 8000000,
"per_day": 3,
"scope": "brain",
"window_days": 7
@@ -909,7 +1031,7 @@
"days_to_exhaustion": null,
"exhaustion_date": null,
"lifetime_ids": 24,
- "limit": 250000,
+ "limit": 2000000,
"per_day": 3,
"scope": "principal:local_cli:<uuid>",
"window_days": 7
@@ -918,7 +1040,7 @@
"verify": "gbrain doctor --json (check persistence_request_growth)",
"window_days": 7
},
- "message": "22 request row(s); no scope exhausts its lifetime request IDs within 90 days at its last-7-day rate.",
+ "message": "22 request row(s); no scope exhausts its lifetime request IDs within 30 days at its last-7-day rate.",
"name": "persistence_request_growth",
"status": "ok"
},
@@ -1358,6 +1480,7 @@
"docs": "docs/guides/troubleshooting.md#maintenance-write-drift",
"repair": "file-drift",
"sources": [],
+ "suppressed": [],
"window_sequences": 20000
},
"message": "No page whose writes refuse source_changed still has a canonical file that differs from the database.",
@@ -3643,16 +3766,138 @@
{
"category": "ops",
"details": {
+ "background_pause_pct": 80,
"commands": [],
+ "docs": "docs/guides/concurrent-writes.md#quota-near-exhaustion",
"exact": true,
+ "forecast": {
+ "retention_days": 30,
+ "rows": [
+ {
+ "basis": "aggregate_1d_short_history",
+ "config_key": "persistence.limits.brain_lifetime_ids",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 8000000,
+ "max_day_7d": 24,
+ "pct": 0,
+ "per_day_7d": 24,
+ "recommended_limit": 16000000,
+ "resource": "lifetime_ids",
+ "scope": "brain",
+ "spike_day": null,
+ "status": "ok",
+ "used": 24,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history:gross_then_net",
+ "config_key": "persistence.limits.brain_terminal_bytes",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 68719476736,
+ "max_day_7d": 194961,
+ "net_per_day_7d": 58816,
+ "pct": 0,
+ "per_day_7d": 194961,
+ "reclaimable_bytes": 136145,
+ "recommended_limit": 137438953472,
+ "resource": "terminal_bytes",
+ "scope": "brain",
+ "spike_day": null,
+ "status": "ok",
+ "under_reserved_receipts": 0,
+ "used": 194961,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history",
+ "config_key": "persistence.limits.principal_lifetime_ids",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 2000000,
+ "max_day_7d": 24,
+ "pct": 0,
+ "per_day_7d": 24,
+ "recommended_limit": 4000000,
+ "resource": "lifetime_ids",
+ "scope": "principal:local_cli:<uuid>",
+ "spike_day": null,
+ "status": "ok",
+ "used": 24,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history:gross_then_net",
+ "config_key": "persistence.limits.principal_terminal_bytes",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 17179869184,
+ "max_day_7d": 194961,
+ "net_per_day_7d": 58816,
+ "pct": 0,
+ "per_day_7d": 194961,
+ "reclaimable_bytes": 136145,
+ "recommended_limit": 34359738368,
+ "resource": "terminal_bytes",
+ "scope": "principal:local_cli:<uuid>",
+ "spike_day": null,
+ "status": "ok",
+ "under_reserved_receipts": 0,
+ "used": 194961,
+ "window_days": 1
+ }
+ ],
+ "table_bytes": "<volatile>",
+ "thresholds": {
+ "fail_days": 7,
+ "fail_pct": 95,
+ "warn_days": 30,
+ "warn_pct": 80
+ },
+ "window_days": 1
+ },
"inspected": 2,
+ "paused_producers": [],
"resources": [],
- "truncated": false
+ "truncated": false,
+ "verify": "gbrain doctor --only persistence_capacity --json"
},
- "message": "Managed write capacity is below 80% of every cumulative limit.",
+ "message": "Managed write capacity is below 80% of every cumulative limit and none runs out within 30 days at its 7-day rate.",
"name": "persistence_capacity",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "docs": "docs/guides/repair.md#receipt-compaction",
+ "last_compaction": {
+ "at": "<ts>",
+ "compacted": 0,
+ "freed_bytes": 0,
+ "host_id": "<uuid>",
+ "skipped_by_reason": {}
+ },
+ "last_compaction_age_hours": 0,
+ "live_consumers": 0,
+ "stale_hours": 24
+ },
+ "message": "Receipt compaction last ran 0 hour(s) ago (compacted 0, freed 0 bytes).",
+ "name": "persistence_compaction",
+ "status": "ok"
+ },
+ {
+ "category": "ops",
+ "details": {
+ "docs": "docs/guides/concurrent-writes.md#counter-drift",
+ "drift": [],
+ "inspected": 2,
+ "true_up_clamped": 0
+ },
+ "message": "Receipt-bytes counters match the receipts they account for (2 scope(s)).",
+ "name": "persistence_counter_drift",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -4069,7 +4314,7 @@
"days_to_exhaustion": null,
"exhaustion_date": null,
"lifetime_ids": 24,
- "limit": 1000000,
+ "limit": 8000000,
"per_day": 3,
"scope": "brain",
"window_days": 7
@@ -4080,7 +4325,7 @@
"days_to_exhaustion": null,
"exhaustion_date": null,
"lifetime_ids": 24,
- "limit": 250000,
+ "limit": 2000000,
"per_day": 3,
"scope": "principal:local_cli:<uuid>",
"window_days": 7
@@ -4089,7 +4334,7 @@
"verify": "gbrain doctor --json (check persistence_request_growth)",
"window_days": 7
},
- "message": "22 request row(s); no scope exhausts its lifetime request IDs within 90 days at its last-7-day rate.",
+ "message": "22 request row(s); no scope exhausts its lifetime request IDs within 30 days at its last-7-day rate.",
"name": "persistence_request_growth",
"status": "ok"
},
@@ -4529,6 +4774,7 @@
"docs": "docs/guides/troubleshooting.md#maintenance-write-drift",
"repair": "file-drift",
"sources": [],
+ "suppressed": [],
"window_sequences": 20000
},
"message": "No page whose writes refuse source_changed still has a canonical file that differs from the database.",
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index 7cc31d7a40..56f400cbc4 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -471,16 +471,138 @@
{
"category": "ops",
"details": {
+ "background_pause_pct": 80,
"commands": [],
+ "docs": "docs/guides/concurrent-writes.md#quota-near-exhaustion",
"exact": true,
+ "forecast": {
+ "retention_days": 30,
+ "rows": [
+ {
+ "basis": "aggregate_1d_short_history",
+ "config_key": "persistence.limits.brain_lifetime_ids",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 8000000,
+ "max_day_7d": 24,
+ "pct": 0,
+ "per_day_7d": 24,
+ "recommended_limit": 16000000,
+ "resource": "lifetime_ids",
+ "scope": "brain",
+ "spike_day": null,
+ "status": "ok",
+ "used": 24,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history:gross_then_net",
+ "config_key": "persistence.limits.brain_terminal_bytes",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 68719476736,
+ "max_day_7d": 196014,
+ "net_per_day_7d": 58822,
+ "pct": 0,
+ "per_day_7d": 196014,
+ "reclaimable_bytes": 137192,
+ "recommended_limit": 137438953472,
+ "resource": "terminal_bytes",
+ "scope": "brain",
+ "spike_day": null,
+ "status": "ok",
+ "under_reserved_receipts": 0,
+ "used": 196014,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history",
+ "config_key": "persistence.limits.principal_lifetime_ids",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 2000000,
+ "max_day_7d": 24,
+ "pct": 0,
+ "per_day_7d": 24,
+ "recommended_limit": 4000000,
+ "resource": "lifetime_ids",
+ "scope": "principal:local_cli:<uuid>",
+ "spike_day": null,
+ "status": "ok",
+ "used": 24,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history:gross_then_net",
+ "config_key": "persistence.limits.principal_terminal_bytes",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 17179869184,
+ "max_day_7d": 196014,
+ "net_per_day_7d": 58822,
+ "pct": 0,
+ "per_day_7d": 196014,
+ "reclaimable_bytes": 137192,
+ "recommended_limit": 34359738368,
+ "resource": "terminal_bytes",
+ "scope": "principal:local_cli:<uuid>",
+ "spike_day": null,
+ "status": "ok",
+ "under_reserved_receipts": 0,
+ "used": 196014,
+ "window_days": 1
+ }
+ ],
+ "table_bytes": "<volatile>",
+ "thresholds": {
+ "fail_days": 7,
+ "fail_pct": 95,
+ "warn_days": 30,
+ "warn_pct": 80
+ },
+ "window_days": 1
+ },
"inspected": 2,
+ "paused_producers": [],
"resources": [],
- "truncated": false
+ "truncated": false,
+ "verify": "gbrain doctor --only persistence_capacity --json"
},
- "message": "Managed write capacity is below 80% of every cumulative limit.",
+ "message": "Managed write capacity is below 80% of every cumulative limit and none runs out within 30 days at its 7-day rate.",
"name": "persistence_capacity",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "docs": "docs/guides/repair.md#receipt-compaction",
+ "last_compaction": {
+ "at": "<ts>",
+ "compacted": 0,
+ "freed_bytes": 0,
+ "host_id": "<uuid>",
+ "skipped_by_reason": {}
+ },
+ "last_compaction_age_hours": 0,
+ "live_consumers": 0,
+ "stale_hours": 24
+ },
+ "message": "Receipt compaction last ran 0 hour(s) ago (compacted 0, freed 0 bytes).",
+ "name": "persistence_compaction",
+ "status": "ok"
+ },
+ {
+ "category": "ops",
+ "details": {
+ "docs": "docs/guides/concurrent-writes.md#counter-drift",
+ "drift": [],
+ "inspected": 2,
+ "true_up_clamped": 0
+ },
+ "message": "Receipt-bytes counters match the receipts they account for (2 scope(s)).",
+ "name": "persistence_counter_drift",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -887,7 +1009,7 @@
"days_to_exhaustion": null,
"exhaustion_date": null,
"lifetime_ids": 24,
- "limit": 1000000,
+ "limit": 8000000,
"per_day": 3,
"scope": "brain",
"window_days": 7
@@ -898,7 +1020,7 @@
"days_to_exhaustion": null,
"exhaustion_date": null,
"lifetime_ids": 24,
- "limit": 250000,
+ "limit": 2000000,
"per_day": 3,
"scope": "principal:local_cli:<uuid>",
"window_days": 7
@@ -907,7 +1029,7 @@
"verify": "gbrain doctor --json (check persistence_request_growth)",
"window_days": 7
},
- "message": "~22 request row(s); no scope exhausts its lifetime request IDs within 90 days at its last-7-day rate.",
+ "message": "~22 request row(s); no scope exhausts its lifetime request IDs within 30 days at its last-7-day rate.",
"name": "persistence_request_growth",
"status": "ok"
},
@@ -1354,6 +1476,7 @@
"docs": "docs/guides/troubleshooting.md#maintenance-write-drift",
"repair": "file-drift",
"sources": [],
+ "suppressed": [],
"window_sequences": 20000
},
"message": "No page whose writes refuse source_changed still has a canonical file that differs from the database.",
@@ -3634,16 +3757,138 @@
{
"category": "ops",
"details": {
+ "background_pause_pct": 80,
"commands": [],
+ "docs": "docs/guides/concurrent-writes.md#quota-near-exhaustion",
"exact": true,
+ "forecast": {
+ "retention_days": 30,
+ "rows": [
+ {
+ "basis": "aggregate_1d_short_history",
+ "config_key": "persistence.limits.brain_lifetime_ids",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 8000000,
+ "max_day_7d": 24,
+ "pct": 0,
+ "per_day_7d": 24,
+ "recommended_limit": 16000000,
+ "resource": "lifetime_ids",
+ "scope": "brain",
+ "spike_day": null,
+ "status": "ok",
+ "used": 24,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history:gross_then_net",
+ "config_key": "persistence.limits.brain_terminal_bytes",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 68719476736,
+ "max_day_7d": 196014,
+ "net_per_day_7d": 58822,
+ "pct": 0,
+ "per_day_7d": 196014,
+ "reclaimable_bytes": 137192,
+ "recommended_limit": 137438953472,
+ "resource": "terminal_bytes",
+ "scope": "brain",
+ "spike_day": null,
+ "status": "ok",
+ "under_reserved_receipts": 0,
+ "used": 196014,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history",
+ "config_key": "persistence.limits.principal_lifetime_ids",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 2000000,
+ "max_day_7d": 24,
+ "pct": 0,
+ "per_day_7d": 24,
+ "recommended_limit": 4000000,
+ "resource": "lifetime_ids",
+ "scope": "principal:local_cli:<uuid>",
+ "spike_day": null,
+ "status": "ok",
+ "used": 24,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history:gross_then_net",
+ "config_key": "persistence.limits.principal_terminal_bytes",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 17179869184,
+ "max_day_7d": 196014,
+ "net_per_day_7d": 58822,
+ "pct": 0,
+ "per_day_7d": 196014,
+ "reclaimable_bytes": 137192,
+ "recommended_limit": 34359738368,
+ "resource": "terminal_bytes",
+ "scope": "principal:local_cli:<uuid>",
+ "spike_day": null,
+ "status": "ok",
+ "under_reserved_receipts": 0,
+ "used": 196014,
+ "window_days": 1
+ }
+ ],
+ "table_bytes": "<volatile>",
+ "thresholds": {
+ "fail_days": 7,
+ "fail_pct": 95,
+ "warn_days": 30,
+ "warn_pct": 80
+ },
+ "window_days": 1
+ },
"inspected": 2,
+ "paused_producers": [],
"resources": [],
- "truncated": false
+ "truncated": false,
+ "verify": "gbrain doctor --only persistence_capacity --json"
},
- "message": "Managed write capacity is below 80% of every cumulative limit.",
+ "message": "Managed write capacity is below 80% of every cumulative limit and none runs out within 30 days at its 7-day rate.",
"name": "persistence_capacity",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "docs": "docs/guides/repair.md#receipt-compaction",
+ "last_compaction": {
+ "at": "<ts>",
+ "compacted": 0,
+ "freed_bytes": 0,
+ "host_id": "<uuid>",
+ "skipped_by_reason": {}
+ },
+ "last_compaction_age_hours": 0,
+ "live_consumers": 0,
+ "stale_hours": 24
+ },
+ "message": "Receipt compaction last ran 0 hour(s) ago (compacted 0, freed 0 bytes).",
+ "name": "persistence_compaction",
+ "status": "ok"
+ },
+ {
+ "category": "ops",
+ "details": {
+ "docs": "docs/guides/concurrent-writes.md#counter-drift",
+ "drift": [],
+ "inspected": 2,
+ "true_up_clamped": 0
+ },
+ "message": "Receipt-bytes counters match the receipts they account for (2 scope(s)).",
+ "name": "persistence_counter_drift",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -4050,7 +4295,7 @@
"days_to_exhaustion": null,
"exhaustion_date": null,
"lifetime_ids": 24,
- "limit": 1000000,
+ "limit": 8000000,
"per_day": 3,
"scope": "brain",
"window_days": 7
@@ -4061,7 +4306,7 @@
"days_to_exhaustion": null,
"exhaustion_date": null,
"lifetime_ids": 24,
- "limit": 250000,
+ "limit": 2000000,
"per_day": 3,
"scope": "principal:local_cli:<uuid>",
"window_days": 7
@@ -4070,7 +4315,7 @@
"verify": "gbrain doctor --json (check persistence_request_growth)",
"window_days": 7
},
- "message": "~22 request row(s); no scope exhausts its lifetime request IDs within 90 days at its last-7-day rate.",
+ "message": "~22 request row(s); no scope exhausts its lifetime request IDs within 30 days at its last-7-day rate.",
"name": "persistence_request_growth",
"status": "ok"
},
@@ -4517,6 +4762,7 @@
"docs": "docs/guides/troubleshooting.md#maintenance-write-drift",
"repair": "file-drift",
"sources": [],
+ "suppressed": [],
"window_sequences": 20000
},
"message": "No page whose writes refuse source_changed still has a canonical file that differs from the database.",
diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.json
index 58f5aee1e9..d6f84ec2c3 100644
--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json
+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json
@@ -535,7 +535,7 @@
"window_days": 1
}
],
- "table_bytes": 262144,
+ "table_bytes": "<volatile>",
"thresholds": {
"fail_days": 7,
"fail_pct": 95,
@@ -1310,6 +1310,7 @@
"docs": "docs/guides/troubleshooting.md#maintenance-write-drift",
"repair": "file-drift",
"sources": [],
+ "suppressed": [],
"window_sequences": 20000
},
"message": "No page whose writes refuse source_changed still has a canonical file that differs from the database.",
diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.json
index 6b432b099d..61cbf6b81b 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json
@@ -538,7 +538,7 @@
"window_days": 1
}
],
- "table_bytes": 262144,
+ "table_bytes": "<volatile>",
"thresholds": {
"fail_days": 7,
"fail_pct": 95,
@@ -1329,6 +1329,7 @@
"docs": "docs/guides/troubleshooting.md#maintenance-write-drift",
"repair": "file-drift",
"sources": [],
+ "suppressed": [],
"window_sequences": 20000
},
"message": "No page whose writes refuse source_changed still has a canonical file that differs from the database.",
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index ab7a22cd01..ae81d944c0 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -455,16 +455,138 @@
{
"category": "ops",
"details": {
+ "background_pause_pct": 80,
"commands": [],
+ "docs": "docs/guides/concurrent-writes.md#quota-near-exhaustion",
"exact": true,
+ "forecast": {
+ "retention_days": 30,
+ "rows": [
+ {
+ "basis": "aggregate_1d_short_history",
+ "config_key": "persistence.limits.brain_lifetime_ids",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 8000000,
+ "max_day_7d": 1,
+ "pct": 0,
+ "per_day_7d": 1,
+ "recommended_limit": 16000000,
+ "resource": "lifetime_ids",
+ "scope": "brain",
+ "spike_day": null,
+ "status": "ok",
+ "used": 1,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history:gross_then_net",
+ "config_key": "persistence.limits.brain_terminal_bytes",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 68719476736,
+ "max_day_7d": 19163,
+ "net_per_day_7d": 2845,
+ "pct": 0,
+ "per_day_7d": 19163,
+ "reclaimable_bytes": 16318,
+ "recommended_limit": 137438953472,
+ "resource": "terminal_bytes",
+ "scope": "brain",
+ "spike_day": null,
+ "status": "ok",
+ "under_reserved_receipts": 0,
+ "used": 19163,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history",
+ "config_key": "persistence.limits.principal_lifetime_ids",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 2000000,
+ "max_day_7d": 1,
+ "pct": 0,
+ "per_day_7d": 1,
+ "recommended_limit": 4000000,
+ "resource": "lifetime_ids",
+ "scope": "principal:local_cli:<uuid>",
+ "spike_day": null,
+ "status": "ok",
+ "used": 1,
+ "window_days": 1
+ },
+ {
+ "basis": "aggregate_1d_short_history:gross_then_net",
+ "config_key": "persistence.limits.principal_terminal_bytes",
+ "days_to_exhaustion": null,
+ "exhaustion_date": null,
+ "limit": 17179869184,
+ "max_day_7d": 19163,
+ "net_per_day_7d": 2845,
+ "pct": 0,
+ "per_day_7d": 19163,
+ "reclaimable_bytes": 16318,
+ "recommended_limit": 34359738368,
+ "resource": "terminal_bytes",
+ "scope": "principal:local_cli:<uuid>",
+ "spike_day": null,
+ "status": "ok",
+ "under_reserved_receipts": 0,
+ "used": 19163,
+ "window_days": 1
+ }
+ ],
+ "table_bytes": "<volatile>",
+ "thresholds": {
+ "fail_days": 7,
+ "fail_pct": 95,
+ "warn_days": 30,
+ "warn_pct": 80
+ },
+ "window_days": 1
+ },
"inspected": 2,
+ "paused_producers": [],
"resources": [],
- "truncated": false
+ "truncated": false,
+ "verify": "gbrain doctor --only persistence_capacity --json"
},
- "message": "Managed write capacity is below 80% of every cumulative limit.",
+ "message": "Managed write capacity is below 80% of every cumulative limit and none runs out within 30 days at its 7-day rate.",
"name": "persistence_capacity",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "docs": "docs/guides/repair.md#receipt-compaction",
+ "last_compaction": {
+ "at": "<ts>",
+ "compacted": 0,
+ "freed_bytes": 0,
+ "host_id": "<uuid>",
+ "skipped_by_reason": {}
+ },
+ "last_compaction_age_hours": 0,
+ "live_consumers": 0,
+ "stale_hours": 24
+ },
+ "message": "Receipt compaction last ran 0 hour(s) ago (compacted 0, freed 0 bytes).",
+ "name": "persistence_compaction",
+ "status": "ok"
+ },
+ {
+ "category": "ops",
+ "details": {
+ "docs": "docs/guides/concurrent-writes.md#counter-drift",
+ "drift": [],
+ "inspected": 2,
+ "true_up_clamped": 0
+ },
+ "message": "Receipt-bytes counters match the receipts they account for (2 scope(s)).",
+ "name": "persistence_counter_drift",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -818,7 +940,7 @@
"days_to_exhaustion": null,
"exhaustion_date": null,
"lifetime_ids": 1,
- "limit": 1000000,
+ "limit": 8000000,
"per_day": 0,
"scope": "brain",
"window_days": 7
@@ -829,7 +951,7 @@
"days_to_exhaustion": null,
"exhaustion_date": null,
"lifetime_ids": 1,
- "limit": 250000,
+ "limit": 2000000,
"per_day": 0,
"scope": "principal:local_cli:<uuid>",
"window_days": 7
@@ -838,7 +960,7 @@
"verify": "gbrain doctor --json (check persistence_request_growth)",
"window_days": 7
},
- "message": "~0 request row(s); no scope exhausts its lifetime request IDs within 90 days at its last-7-day rate.",
+ "message": "~0 request row(s); no scope exhausts its lifetime request IDs within 30 days at its last-7-day rate.",
"name": "persistence_request_growth",
"status": "ok"
},
@@ -1203,6 +1325,7 @@
"docs": "docs/guides/troubleshooting.md#maintenance-write-drift",
"repair": "file-drift",
"sources": [],
+ "suppressed": [],
"window_sequences": 20000
},
"message": "No page whose writes refuse source_changed still has a canonical file that differs from the database.",
diff --git a/test/helpers/doctor-json-golden.ts b/test/helpers/doctor-json-golden.ts
index 9e2fa216f0..b3a2224708 100644
--- a/test/helpers/doctor-json-golden.ts
+++ b/test/helpers/doctor-json-golden.ts
@@ -144,7 +144,7 @@ export function patchConfig(h: DoctorHome, patch: (cfg: Record<string, unknown>)
}
const UUID = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
-const VOLATILE_KEYS = /(^|_)(ms|pid|elapsed|duration|uptime)$|_ms$|^elapsed/i;
+const VOLATILE_KEYS = /(^|_)(ms|pid|elapsed|duration|uptime)$|_ms$|^elapsed|^table_bytes$/i;
export function normalizeDoctorText(text: string, roots: Record<string, string>, extra: Array<[RegExp | string, string]> = []): string {
let out = scrubPaths(text, roots);