Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,35 @@ All notable changes to this project are documented here. The format follows
[Semantic Versioning](https://semver.org/spec/v2.0.0.html) — while the major version is 0,
any release may change behaviour.

## [1.0.0] — Unreleased

The cross-agent session budget cap, and the 1.0 stability promise
([design](docs/dev/DESIGN-v1.0-budget-cap.md)). In progress: this entry grows as the parts land;
the release is cut when the hook integration, the `aegis budget` commands, the docs and the live
test on each agent are in.

### Added
- `aegis_core.budget`, the budget cap's core (design §3–§6):
- `budget.yaml`, signed, whose `principal` must hold the new **`budget`** authority class:
a per-session and a per-project-per-day limit in estimated USD or tokens (`unit` is
required), a warning threshold, the day's time zone, the agents measured (only listed
agents are), `on_unknown_log`, `on_unknown_price`, signed price overrides and a
premium-request limit for Copilot CLI. Every shape problem is a load error.
- A dated price table (`aegis_core/budget/prices.yaml`: Anthropic, OpenAI and Google list
prices read 2026-10-07). An unpriced model is estimated per billing category from its
vendor's (or the whole table's) highest rate — an estimate, not an upper bound — or, with
`on_unknown_price: deny`, refused until priced. Usage is stored as tokens per model, so a
new override re-prices earlier usage.
- Usage readers for the session logs of Claude Code, Codex CLI, Gemini CLI, OpenCode and
Copilot CLI (premium requests), with linked sub-agents counted inside their parent session,
tested against redacted samples of real logs.
- Accounting that the logs can always rebuild: per-session records, project/day totals merged
by revision from a durable per-session counter, a session inventory outside the cache,
rebuilds that report whether the day is complete, partial or of unknown completeness, and
usage bucketed by the time the log recorded, never the time it was read.
- Evaluation to allow / warn / deny with the measured usage, limits and observed overshoot.
- The example `authority.yaml` gives `admin` the `budget` class.

## [0.3.2] — 2026-09-29

Package metadata only; no change to behaviour.
Expand Down
1 change: 1 addition & 0 deletions data/authority.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ principals:
- deletion
- configuration
- identity # may change agents.yaml, the identity model
- budget # may change budget.yaml, the budget cap
sre_lead:
- scaling
- configuration
Expand Down
2 changes: 1 addition & 1 deletion data/authority.example.yaml.sig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
aegis-sig-v1
b0d414e6dcaee5b9ca5d5ed5aa8405f35ed1ea2c7a623124faed7bfe670a104d
b2ceb3e6cb27ac15787c4d6b9015065e03b804a6ac837c8fcc4f9895961bd130
2 changes: 1 addition & 1 deletion gemini-extension.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "aegis-devops",
"version": "0.3.2",
"version": "1.0.0",
"description": "Checks the infrastructure commands Gemini CLI wants to run (kubectl, terraform/tofu, aws/az/gcloud, helm, argocd, git, SQL) against your signed, authority-checked policy before they run. Only active in projects with a .aegis/ policy. Needs 'pip install aegis-devops'."
}
2 changes: 1 addition & 1 deletion plugins/copilot/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "aegis-devops",
"version": "0.3.2",
"version": "1.0.0",
"description": "Checks the infrastructure commands Copilot wants to run (kubectl, terraform/tofu, aws/az/gcloud, helm, argocd, git, SQL) against your signed, authority-checked policy before they run. Only active in projects with a .aegis/ policy directory. Needs 'pip install aegis-devops'.",
"author": { "name": "Vamshidher Reddy Jannapu Reddy" },
"homepage": "https://github.com/moneytool/aegis-devops",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ version = {attr = "aegis_core.__version__"}
where = ["src"]

[tool.setuptools.package-data]
aegis_core = ["_examples/**/*", "integrations/*", "compile/actions/*"]
aegis_core = ["_examples/**/*", "integrations/*", "compile/actions/*", "budget/*.yaml"]

[tool.ruff]
line-length = 100
Expand Down
2 changes: 1 addition & 1 deletion src/aegis_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
See the README for what this does and, importantly, what it does not yet do.
"""

__version__ = "0.3.2"
__version__ = "1.0.0"
1 change: 1 addition & 0 deletions src/aegis_core/_examples/authority.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ principals:
- deletion
- configuration
- identity # may change agents.yaml, the identity model
- budget # may change budget.yaml, the budget cap
sre_lead:
- scaling
- configuration
Expand Down
2 changes: 1 addition & 1 deletion src/aegis_core/_examples/authority.example.yaml.sig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
aegis-sig-v1
b0d414e6dcaee5b9ca5d5ed5aa8405f35ed1ea2c7a623124faed7bfe670a104d
b2ceb3e6cb27ac15787c4d6b9015065e03b804a6ac837c8fcc4f9895961bd130
27 changes: 27 additions & 0 deletions src/aegis_core/budget/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Cross-agent session budget cap (design: docs/dev/DESIGN-v1.0-budget-cap.md).

* :mod:`~aegis_core.budget.policy` -- the signed ``budget.yaml``;
* :mod:`~aegis_core.budget.pricing` -- tokens to estimated dollars;
* :mod:`~aegis_core.budget.logs` -- reading usage from each agent's logs;
* :mod:`~aegis_core.budget.accounting` -- session records, project/day
totals, revisions, locks, the inventory and rebuilds;
* :mod:`~aegis_core.budget.evaluate` -- allow / warn / deny.
"""

from aegis_core.budget.accounting import BudgetStore, Snapshot, rebuild, refresh
from aegis_core.budget.evaluate import ALLOW, DENY, WARN, Verdict, evaluate
from aegis_core.budget.logs import Locator, default_logs
from aegis_core.budget.policy import BUDGET_CLASS, BUDGET_FILE, BudgetPolicy, load_budget_policy
from aegis_core.budget.pricing import PriceTable, load_builtin_table


def price_table(policy: BudgetPolicy) -> PriceTable:
"""The built-in prices with the policy's signed overrides."""
return PriceTable(load_builtin_table(), policy.pricing)


__all__ = [
"ALLOW", "BUDGET_CLASS", "BUDGET_FILE", "DENY", "WARN", "BudgetPolicy", "BudgetStore",
"Locator", "PriceTable", "Snapshot", "Verdict", "default_logs", "evaluate",
"load_budget_policy", "load_builtin_table", "price_table", "rebuild", "refresh",
]
Loading
Loading