Skip to content

Commit 86805aa

Browse files
committed
Add .acb storage budget policy and budget command
1 parent 4c35be0 commit 86805aa

6 files changed

Lines changed: 417 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ If `.acb/.amem/.avis` files are on another machine, sync them to the server firs
293293
| Autonomic profile | Conservative local-first posture | `ACB_AUTONOMIC_PROFILE=desktop|cloud|aggressive` |
294294
| Rolling backup | Compile writes checkpointed backups for existing outputs | `ACB_AUTO_BACKUP`, `ACB_AUTO_BACKUP_RETENTION`, `ACB_AUTO_BACKUP_DIR` |
295295
| Storage migration | Policy-gated with checkpointed auto-safe path | `ACB_STORAGE_MIGRATION_POLICY=auto-safe|strict|off` |
296+
| Storage budget policy | 20-year projection + backup rollup when budget pressure appears | `ACB_STORAGE_BUDGET_MODE=auto-rollup|warn|off`, `ACB_STORAGE_BUDGET_BYTES`, `ACB_STORAGE_BUDGET_HORIZON_YEARS`, `ACB_STORAGE_BUDGET_TARGET_FRACTION` |
296297
| Collective cache maintenance | Periodic expiry cleanup of collective cache entries | `ACB_COLLECTIVE_CACHE_MAINTENANCE_SECS` |
297298
| Maintenance throttling | SLA-aware under sustained registry load | `ACB_SLA_MAX_REGISTRY_OPS_PER_MIN` |
298299
| Health ledger | Periodic operational snapshots (default: `~/.agentra/health-ledger`) | `ACB_HEALTH_LEDGER_DIR`, `AGENTRA_HEALTH_LEDGER_DIR`, `ACB_HEALTH_LEDGER_EMIT_SECS` |

docs/public/command-surface.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ acb get
1717
acb completions
1818
acb health
1919
acb gate
20+
acb budget
2021
```
2122

2223
## `acb compile`
@@ -69,6 +70,25 @@ acb gate <file.acb> --unit-id 42 --max-risk 0.55 --depth 4 --require-tests
6970

7071
Fails with non-zero exit if risk/test criteria are not met (CI-friendly).
7172

73+
## `acb budget`
74+
75+
```bash
76+
acb budget <file.acb>
77+
acb budget <file.acb> --horizon-years 20 --max-bytes 2147483648
78+
acb budget <file.acb> --format json
79+
```
80+
81+
Estimates long-horizon growth and reports whether the graph is on track for a fixed storage budget.
82+
83+
Runtime policy env:
84+
85+
```bash
86+
export ACB_STORAGE_BUDGET_MODE=auto-rollup
87+
export ACB_STORAGE_BUDGET_BYTES=2147483648
88+
export ACB_STORAGE_BUDGET_HORIZON_YEARS=20
89+
export ACB_STORAGE_BUDGET_TARGET_FRACTION=0.85
90+
```
91+
7292
## `acb-mcp`
7393

7494
```bash

docs/public/implementation-2026-02-22.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ This page records the codebase-system upgrades implemented in this cycle.
1717
- `test-gap`
1818
- `hotspots`
1919
- `dead-code`
20+
5. Long-horizon storage budget policy:
21+
- Added `acb budget` command for projection and budget guidance.
22+
- Added compile-time storage policy:
23+
- `ACB_STORAGE_BUDGET_MODE=auto-rollup|warn|off`
24+
- `ACB_STORAGE_BUDGET_BYTES`
25+
- `ACB_STORAGE_BUDGET_HORIZON_YEARS`
26+
- `ACB_STORAGE_BUDGET_TARGET_FRACTION`
27+
- `auto-rollup` mode trims oldest `.acb` backup lineage when budget pressure is detected.
2028

2129
## Why this matters
2230

@@ -33,6 +41,7 @@ acb query repo.acb hotspots
3341
acb query repo.acb dead-code
3442
acb health repo.acb
3543
acb gate repo.acb --unit-id 42 --max-risk 0.60 --require-tests
44+
acb budget repo.acb --horizon-years 20 --max-bytes 2147483648
3645
```
3746

3847
## Files changed
@@ -42,4 +51,3 @@ acb gate repo.acb --unit-id 42 --max-risk 0.60 --require-tests
4251
- `docs/public/command-surface.md`
4352
- `docs/public/quickstart.md`
4453
- `README.md`
45-

docs/public/quickstart.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ acb query project.acb dead-code
3131
```bash
3232
acb health project.acb
3333
acb gate project.acb --unit-id 1 --max-risk 0.60 --require-tests
34+
acb budget project.acb --horizon-years 20 --max-bytes 2147483648
3435
```
3536

3637
## 5. Start MCP server

docs/public/runtime-install-sync.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,20 @@ export AGENTIC_TOKEN="$(openssl rand -hex 32)"
4343
```
4444

4545
Server deployments must sync `.acb/.amem/.avis` artifacts to server storage before runtime.
46+
47+
## Long-horizon storage budget policy
48+
49+
To target ~1-2 GB over long horizons (for example 20 years), configure:
50+
51+
```bash
52+
export ACB_STORAGE_BUDGET_MODE=auto-rollup
53+
export ACB_STORAGE_BUDGET_BYTES=2147483648
54+
export ACB_STORAGE_BUDGET_HORIZON_YEARS=20
55+
export ACB_STORAGE_BUDGET_TARGET_FRACTION=0.85
56+
```
57+
58+
Modes:
59+
60+
- `auto-rollup`: trims oldest `.acb` backup lineage when budget pressure is detected.
61+
- `warn`: emit warnings only.
62+
- `off`: disable policy.

0 commit comments

Comments
 (0)