Novelty analysis, codebase improvement suggestions, and phased build roadmap
- Why BAMAS Is Genuinely Novel
- Competitive Landscape (Web Research)
- Critical Gaps: plan.md vs. Current Code
- Suggested Changes to plan.md
- Suggested Changes to commercialization_roadmap.md
- Concrete Code Improvements
- Phased Implementation Roadmap
- Summary: Top 5 Next Priorities
- Budget Hardening (P1–P7)
- Future Research Directions
BAMAS combines three mechanisms that individually exist elsewhere but are never combined into one unified runtime:
| Mechanism | BAMAS | Competitors |
|---|---|---|
| LLM-guided topology selection (semantic) | ✅ Primary path | ❌ None |
| Contextual Multi-Armed Bandit (Thompson Sampling) per topology arm | ✅ RL refinement | Partial (TREACLE uses RL for model cascade only) |
| Pre-execution topology structural degradation under budget pressure | ✅ Novel ★ | ❌ None — all others swap models, not topology shape |
| Reasoning-divergence escalation (not vote count) | ✅ Novel ★ | ❌ None |
| 4-band budget governor with automatic downgrade chain | ✅ Novel ★ | ❌ None |
The topology degradation chain (ensemble→fanout→supervisor→pipeline→single) is the single most unique engineering contribution. No published framework does pre-run structural graph collapse as a budget response. LangSight, AgentPrune, and BudgetMLAgent all stop at model-tier swapping.
The original BAMAS paper (Yang et al., 2026, AAAI-40) uses Integer Linear Programming (ILP) for model selection. This implementation replaces ILP with LLM semantic classification as the primary optimizer, keeping RL (Thompson Sampling) for topology refinement. This is a valid and practical departure because:
- ILP requires offline profiling of model performance per task type — expensive to maintain.
- LLM classification is zero-shot generalisable, costs ~1 LLM call, and falls back to rules.
- The RL layer provides the adaptive optimisation the paper intended ILP to give.
This deviation should be documented as a conscious design decision, not an omission.
- AI agent software spend hits $206.5 billion in 2026 (Gartner, May 2026) — up 139% YoY.
- The AI agents market grows from $7.6B (2025) → $182.9B (2033) at 49.6% CAGR (Grand View Research).
- Production cost blowouts are the #1 pain point — one team's prototype costing $20/month hit $9,800 in month two (Edgeless Lab, 2026). This is BAMAS's exact wedge.
- Only 14–23% of enterprises have reached production-scale agent deployment. The market needs cost governance tooling now to unlock the remaining 77–86%.
- LangGraph's durable execution (checkpoints, retries, fan-out) amplifies cost failures — this is documented at runcycles.io (March 2026), which directly validates BAMAS's approach.
| System | Cost Strategy | Topology Selection | Runtime Budget Enforcement |
|---|---|---|---|
| BAMAS (this repo) | LLM + RL + topology degradation | 5 topologies, RL-selected | 4-band governor, pre-execution |
| AgentBalance (HKUST, 2025) | Backbone-then-topology, latency-aware | Adaptive topology synthesis | At design time only |
| BudgetMLAgent (TCS, 2024) | LLM cascade + profiling + expert calls | Fixed (cascade) | None |
| TREACLE (NeurIPS 2024) | RL for model + prompt selection | No topology concept | Per-query budget |
| AgentPrune (2024) | Communication graph pruning | Fixed topology, prunes messages | None |
| LangSight (2026) | Budget cap via monkey-patch | None | Per-session cap (hard stop) |
| AgentOps Control Plane | Cost attribution + quality scoring | None | None |
- Mid-execution budget enforcement with topology degradation — nobody does this in real time.
- Reasoning-divergence as an escalation signal — all others use vote-count or static thresholds.
- Multi-topology orchestrator as a drop-in middleware — not just a proxy or a wrapper.
- RL policy that learns which topology works for which task type — persistent, improves over time.
- AgentBalance (Dec 2025) is the closest academic competitor. It does backbone-then-topology selection but lacks runtime budget governance.
- LangGraph Platform (LangChain Inc.) is building managed deployment with cost controls — potential to commoditise the proxy layer. BAMAS must differentiate at the topology-intelligence and RL layers.
- OpenAI Realtime API and native model routing (GPT-4o mini fallback) reduce the need for external orchestration at the cheap/standard tier boundary.
These are inconsistencies or gaps found by cross-referencing docs/plan.md, feature_comparison.md, and the actual source files.
docs/plan.md says:
"Only overrides after ≥10 trained tasks." (Section: RL Policy Details)
core/rl_policy.py initialises from the plan description with a threshold of 5 for selection and uses separate logic for overriding. The documentation is inconsistent. Fix: make RL_MIN_TASKS_FOR_OVERRIDE a configurable setting in core/config.py and document the actual value.
Resolution: Implemented in P4–P7 (commit
19f1b6c). Budget gates now fire at every synchronization barrier — post-planner, post-executor, post-supervisor, and post-judge — across all 5 topologies. Mid-execution degradation vialanggraph.types.interrupt()is fully operational.
docs/file-spec.md describes two V3 modules:
core/stats.py— tracks topology × budget × task performance.core/learning.py— self-optimisation loop using Judge scores.
Neither file exists. The RL policy (core/rl_policy.py) partially covers stats.py functionality but lacks the Judge-score feedback loop. These should be scaffolded now, even if empty, so the architecture is complete.
Resolution: JWT auth wired to all routes (
api/routes/auth.py), WebSocket uses?token=query param (api/websocket.py).DEFAULT_JWT_SECRETextracted tocore/config.pyas single source of truth.
Resolution: 20s heartbeat/ping implemented in
api/websocket.py. Prevents reverse proxy idle timeout disconnections.
Resolution: SQLite persistence via
aiosqlitewith in-memory fast path.core/audit.pyimplementsAuditTrailclass with DB fallback. Indexed bytask_id. Survives process restarts.
These are additions/corrections to docs/plan.md:
Add a section after Cost-tier Optimizer — Flow:
### Design Departure from AAAI-26 Paper
The original BAMAS paper uses Integer Linear Programming (ILP) for model selection.
This implementation replaces ILP with LLM semantic classification as the primary
optimizer. Rationale: ILP requires per-model performance profiling per task type,
which is expensive to maintain in production. LLM classification is zero-shot
generalizable and falls back gracefully to rules. The RL layer provides the adaptive
optimization the ILP was intended to supply.
Change the RL Policy Details section to:
- **Cold start**: Returns None for first {RL_MIN_TASKS_FOR_SELECTION} tasks (configurable, default 5)
- **Override threshold**: Only overrides LLM decision after ≥{RL_MIN_TASKS_FOR_OVERRIDE} trained tasks (configurable, default 10)
Update the Budget Governor ★ section to include a planned mid-execution mode:
| Spent | Band | Action |
|-------|------|--------|
| <70% | HEALTHY | Full topology, all tiers |
| 70-90% | TIER_DOWNGRADE | Downgrade model tiers only |
| 90-100% | STRUCTURAL_DEGRADE | Collapse topology pre-execution (current); pause and migrate mid-execution (planned) |
| >100% | CRITICAL | Single topology, cheap model, skip Judge |
├── core/
│ ├── ...
│ ├── stats.py # (V2) topology × budget × task performance tracker
│ └── learning.py # (V2) Judge-score feedback loop → optimizer improvement
## Related Work
| System | Paper | Key Difference |
|--------|-------|----------------|
| AgentBalance | arXiv 2512.11426, 2025 | Backbone-then-topology; no runtime budget enforcement |
| BudgetMLAgent | TCS Research, 2024 | LLM cascade; no topology abstraction |
| TREACLE | NeurIPS 2024 | RL model+prompt selection; no multi-topology orchestration |
| AgentPrune | arXiv 2410.02506 | Message pruning; no budget degradation |
Insert before Section 1:
## Market Context (2026)
- AI agent software spend: $206.5B in 2026, up 139% YoY (Gartner)
- AI agents market: $7.6B (2025) → $182.9B by 2033 at 49.6% CAGR (Grand View Research)
- Production cost blowouts are the #1 documented pain point: prototype→production
cost spikes of 5–15× are reported across the industry (Edgeless Lab, 2026)
- LangGraph's durable execution (retries, fan-out, checkpoints) amplifies cost
failures — documented at runcycles.io (March 2026). BAMAS's budget governor
directly addresses this pattern.
The tagline "We guarantee your AI agents will never exceed their budget" is strong but slightly overpromises (CRITICAL band still runs a degraded single agent). A more defensible framing:
"BAMAS is the cost-intelligence layer for production multi-agent systems: it automatically selects the cheapest topology that meets your quality threshold, and degrades gracefully before budget overruns occur."
The CLI tool (bamas-cli) is listed as Step 2 in GTM. It should be Step 1 because:
- It is a zero-infrastructure lead magnet.
- It produces shareable artefacts (Budget Burn Risk Reports) that go viral in dev communities.
- It makes the core algorithm discoverable before the full backend is needed.
| 4. Policy SDK for LangGraph | Package the budget governor + escalation engine as
`pip install bamas-policy`. Developers add it as a governance node inside any
LangGraph workflow. | LangGraph / LangChain ecosystem developers |
Open-core: free for <$100/mo API spend per tenant, $49/mo commercial license above.
The AAAI-26 paper citation should appear prominently in the README and commercialization doc:
"Based on the peer-reviewed AAAI-26 paper: Yang, L. et al. (2026). BAMAS: Structuring Budget-Aware Multi-Agent Systems. AAAI-40, pp. 29802–29810."
This is a rare and strong differentiator — most competing repos have no peer-reviewed backing.
Status: Implemented in P4–P7 (commit
19f1b6c). See Section 9 for full details.Budget gates now fire at every synchronization barrier across all topologies:
- Post-planner: Catches budget exhaustion before any execution starts
- Post-executor: Existing gate, now returns delta-only values (P1 fix)
- Post-supervisor: Catches budget exhaustion between supervisor dispatches
- Post-judge: Catches budget exhaustion after judge LLM call
Circuit breaker at 110% provides last-resort hard stop. Pre-LLM checks in executor/planner/supervisor skip calls entirely when budget exhausted.
Status: Implemented.
core/audit.pyuses SQLite viaaiosqlitewith in-memory fast path. DB initialized on startup. Indexed bytask_id. Survives process restarts.
Status: Implemented. 20s heartbeat/ping in
api/websocket.py. Prevents reverse proxy idle timeout.
core/stats.py — Tracks topology × budget × task performance for the RL reward signal:
"""
Tracks task outcomes by topology, budget band, and task type.
Feeds the RL policy's reward function with richer historical data.
"""
from dataclasses import dataclass, field
from collections import defaultdict
from statistics import mean
@dataclass
class TaskOutcome:
topology: str
budget_band: str
task_type: str # code / research / data / verify / general
quality_score: float # 0.0–1.0 from Judge or Validator
cost_usd: float
cost_efficiency: float # budget_remaining / budget_total
class PerformanceStats:
"""In-memory (V1) performance stats. Persisted to Redis in V2."""
def __init__(self):
self._outcomes: list[TaskOutcome] = []
self._by_topology: dict[str, list[TaskOutcome]] = defaultdict(list)
def record(self, outcome: TaskOutcome):
self._outcomes.append(outcome)
self._by_topology[outcome.topology].append(outcome)
def best_topology_for(self, task_type: str, budget_band: str) -> str | None:
"""Returns the topology with highest mean quality for a given context."""
candidates = {
topo: [o.quality_score for o in outcomes
if o.task_type == task_type and o.budget_band == budget_band]
for topo, outcomes in self._by_topology.items()
}
scored = {t: mean(scores) for t, scores in candidates.items() if len(scores) >= 3}
return max(scored, key=scored.get) if scored else None
stats = PerformanceStats()core/learning.py — Closes the feedback loop between Judge output and the optimizer:
"""
Self-optimisation loop. Judge scores (quality_score) are fed back into
both the RL policy reward and the performance stats tracker.
"""
from core.stats import stats, TaskOutcome
from core.rl_policy import RLPolicy
async def record_task_result(
rl_policy: RLPolicy,
topology: str,
budget_band: str,
task_type: str,
quality_score: float,
cost_usd: float,
budget_total: float,
):
"""
Called at task completion (in agent/graph.py after finalizer).
Updates both the RL policy and the performance stats tracker.
"""
cost_efficiency = max(0.0, 1.0 - (cost_usd / budget_total)) if budget_total > 0 else 0.0
reward = quality_score * 0.7 + cost_efficiency * 0.3
# Update RL policy
arm_index = rl_policy.topology_to_arm(topology)
if arm_index is not None:
rl_policy.update(arm_index, reward)
# Update stats tracker
stats.record(TaskOutcome(
topology=topology,
budget_band=budget_band,
task_type=task_type,
quality_score=quality_score,
cost_usd=cost_usd,
cost_efficiency=cost_efficiency,
))Status: Implemented.
core/config.pyhasRL_MIN_TASKS_FOR_SELECTION,RL_MIN_TASKS_FOR_OVERRIDE,RL_QUALITY_WEIGHT,RL_COST_EFFICIENCY_WEIGHTas configurable settings.
Status: Implemented. JWT auth via
api/routes/auth.py(Bearer token),api/websocket.py(?token= query param).DEFAULT_JWT_SECRETincore/config.py. Dev-mode bypass when default secret is in use.
Status: Implemented as
POST /estimateinapi/routes/estimate.py. Returns topology, model tiers, estimated cost, budget headroom, and risk level (LOW/MEDIUM/HIGH). Powers the frontend cost estimation banner.
Create cli/bamas_cli.py:
#!/usr/bin/env python3
"""
bamas-cli — Budget Burn Risk Analyser for LangGraph agents.
Usage: python -m cli.bamas_cli --task "..." --budget 1.00
"""
import argparse
import asyncio
import httpx
async def dry_run(task: str, budget: float, server: str = "http://localhost:8000"):
async with httpx.AsyncClient() as client:
resp = await client.post(f"{server}/estimate", json={"task": task, "budget_usd": budget})
data = resp.json()
print("\n=== BAMAS Budget Burn Risk Report ===")
print(f" Task : {task[:80]}")
print(f" Budget : ${budget:.2f}")
print(f" Topology : {data['topology']}")
print(f" Model tiers : {data['model_tiers']}")
print(f" Est. cost : ${data['estimated_cost_usd']:.4f}")
print(f" Budget left : {data['budget_headroom_pct']:.1f}%")
print(f" Rationale : {data['rationale']}")
risk = "LOW" if data["budget_headroom_pct"] > 30 else "MEDIUM" if data["budget_headroom_pct"] > 10 else "HIGH"
print(f"\n Risk Level : {risk}")
print("=====================================\n")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="BAMAS Budget Burn Risk Analyser")
parser.add_argument("--task", required=True, help="Task description")
parser.add_argument("--budget", type=float, required=True, help="Budget in USD")
parser.add_argument("--server", default="http://localhost:8000", help="BAMAS server URL")
args = parser.parse_args()
asyncio.run(dry_run(args.task, args.budget, args.server))gantt
title BAMAS Implementation Phases
dateFormat YYYY-MM-DD
section Phase 1 — Robustness
Mid-execution budget checkpoint :p1a, 2026-07-01, 21d
Persistent audit trail (SQLite) :p1b, 2026-07-01, 7d
WebSocket heartbeat :p1c, 2026-07-08, 5d
stats.py + learning.py scaffold :p1d, 2026-07-10, 7d
RL config externalisation :p1e, 2026-07-05, 3d
POST /estimate endpoint :p1f, 2026-07-15, 5d
section Phase 2 — Developer Tools
bamas-cli dry-run tool :p2a, 2026-07-22, 7d
JWT auth middleware (wired) :p2b, 2026-07-22, 5d
plan.md + README update :p2c, 2026-07-28, 3d
GitHub release + PyPI packaging :p2d, 2026-08-01, 10d
section Phase 3 — Enterprise
PostgreSQL audit persistence :p3a, 2026-08-11, 10d
Multi-tenancy (user isolation) :p3b, 2026-08-15, 21d
Encrypted credential vault :p3c, 2026-09-01, 14d
Next.js observability dashboard :p3d, 2026-09-01, 30d
section Phase 4 — Commercial
SaaS billing / metering :p4a, 2026-10-01, 30d
LangGraph plugin packaging :p4b, 2026-10-01, 21d
Enterprise self-hosted license :p4c, 2026-11-01, 21d
Goal: Make the existing system production-safe with zero external dependencies added.
| Task | File(s) | Effort | Impact | Status |
|---|---|---|---|---|
agent/nodes/budget_gate.py, topology files, agent/state.py |
3d | ★★★★★ | ✅ Done (P4–P7, commit 19f1b6c) |
|
core/audit.py |
1d | ★★★★ | ✅ Done | |
api/websocket.py |
0.5d | ★★★ | ✅ Done | |
core/stats.py, core/learning.py |
1d | ★★★ | ✅ Done | |
core/config.py, core/rl_policy.py |
0.5d | ★★ | ✅ Done | |
api/routes/estimate.py, api/main.py |
1d | ★★★★ | ✅ Done | |
| Budget hardening (P1–P7) | 12 files | 2d | ★★★★★ | ✅ Done (commit 19f1b6c) |
Goal: Create lead magnets and make the system installable.
| Task | File(s) | Effort | Impact |
|---|---|---|---|
bamas-cli dry-run tool |
cli/bamas_cli.py, pyproject.toml |
1.5d | ★★★★★ |
| Wire JWT auth | api/middleware/auth.py, api/routes/*.py |
1d | ★★★ |
| Plan.md + README improvements | docs/plan.md, README.md |
1d | ★★★ |
PyPI packaging (pip install bamas) |
pyproject.toml, MANIFEST.in |
2d | ★★★★ |
Goal: Add the infrastructure needed for paying enterprise customers.
| Task | Depends On | Effort |
|---|---|---|
| PostgreSQL audit persistence | Phase 1 audit work | 2d |
| Multi-tenancy (org/user isolation in Redis + audit) | JWT from Phase 2 | 5d |
| Encrypted credential vault (per-user API keys) | Multi-tenancy | 3d |
| Next.js observability dashboard | POST /estimate + WebSocket | 2–4 weeks |
Goal: Monetise.
| Task | Description |
|---|---|
| Billing/metering infrastructure | Stripe integration for pay-as-you-go proxied spend |
| LangGraph plugin | pip install bamas-policy governance node |
| Enterprise self-hosted license | Docker image + license key enforcement |
| Technical blog post | Medium/HN deep dive referencing AAAI-26 paper |
Implemented: 2026-07-09 | Commit: 19f1b6c | 12 files, +235/-38 lines
Seven phases of production-grade budget enforcement, addressing bugs found by deep audit and code review. These changes transform the budget system from "mostly works" to "production-hardened with multiple safety nets."
| Phase | Fix | Files | Impact |
|---|---|---|---|
| P1 | Double-counting: return delta, not prev+delta |
5 node files | Stops silent cost inflation at source |
| P2 | Fanout cost tracking: aggregate worker deltas | fanout.py |
Recovers lost cost data |
| P3 | Ensemble race: dispatcher pre-allocates per-agent caps | ensemble.py, state.py |
Prevents 3x race overrun |
| P4 | Missing gates: post-planner, post-supervisor, post-judge | 4 topology files | Catches budget breaches at every sync point |
| P5 | BudgetTracker sync: gate writes live values to tracker | budget_gate.py |
Makes band detection work |
| P6 | Pre-LLM checks: skip LLM call if budget exhausted | budget.py, 3 node files |
Prevents wasting tokens on nodes that would be degraded |
| P7 | Circuit breaker: 110% hard cap forces emergency stop | budget_gate.py |
Last-resort safety net |
Bug: consumed_tokens and consumed_cost use Annotated[type, operator.add] as reducer. Sequential nodes returned prev + delta instead of delta, causing the reducer to compute prev + (prev + delta) — inflating costs on every node call.
Fix: All nodes return only their local delta:
executor.py:exec_tokens/exec_cost(wasacc_tokens/acc_cost)validator.py:val_tokens/val_costjudge.py:judge_tokens/judge_costsupervisor.py:sup_tokens/sup_costplanner.py:local_tokens/local_cost
Bug: parallel_workers_node collected step_results and logs from workers but dropped consumed_tokens/consumed_cost.
Fix: Added merged_tokens/merged_cost accumulators that sum each worker's deltas.
Bug: Three parallel agents read the same stale consumed_cost and all proceeded — combined cost could exceed budget 3x before the gate fired.
Fix: New ensemble_dispatcher node divides remaining budget equally among agents. Each agent checks its pre-allocated cap before calling LLM. Global threshold lowered from 100% → 80%.
Bug: No gate after planner, supervisor, or judge in most topologies.
Fix: Added budget_gate_post_planner, budget_gate_post_supervisor, budget_gate_post_judge nodes:
| Topology | Gates Added |
|---|---|
| Single | post-planner, post-judge |
| Pipeline | post-planner, post-judge |
| Supervisor | post-planner, post-supervisor, post-judge |
| Fanout | post-planner |
| Ensemble | (already had full coverage) |
Bug: BudgetTracker.consumed_cost was never synced with state.consumed_cost. The budget_checkpoint node in budget_interrupt.py always returned HEALTHY.
Fix: budget_gate_node now writes budget.consumed_cost = acc_cost and budget.consumed_tokens = acc_tokens at every gate evaluation, before returning {"budget": budget}.
Bug: Executor, planner, and supervisor called LLM without checking budget first. Tokens were wasted on nodes that would be degraded by the gate.
Fix: New should_skip_llm(state, threshold=0.9) utility in core/budget.py. Called before every LLM invocation:
- Executor: skips step, returns "[Step skipped - budget exhausted]"
- Planner: returns single-step fallback with 0 cost
- Supervisor: returns
{"status": "completed"}, stops execution
Bug: If all gates failed, no last-resort safety net existed.
Fix: HARD_CAP_MULTIPLIER = 1.1 constant. If consumed_cost >= budget.max_cost_usd * 1.1, budget_gate_node emits budget_circuit_breaker event, records in audit trail, and calls interrupt() to force-stop.
Applied during review of P1–P7:
| Issue | Severity | Fix |
|---|---|---|
Executor truncated-step return outside if block |
Critical | Restored correct indentation (12 spaces) |
Ensemble dispatcher stored per_agent instead of acc_cost + per_agent |
Critical | Agents would never run — fixed cap calculation |
acc_tokens/acc_cost naming ambiguous |
Suggestion | Renamed to total_tokens/total_cost in executor |
| Inline band computation hard to maintain | Suggestion | Extracted _spent_band() helper |
| Supervisor skip event missing step count | Suggestion | Added pending_steps to event payload |
| Missing trailing newlines | Nitpick | Added to budget.py, budget_gate.py |
The system now has 12 distinct budget enforcement mechanisms:
Layer 1: Pre-execution degradation (core/degrader.py)
Layer 2: Pre-LLM budget check (should_skip_llm in executor/planner/supervisor)
Layer 3: Per-step budget caps (planner → executor)
Layer 4: Post-planner budget gate
Layer 5: Post-executor budget gate
Layer 6: Post-supervisor budget gate (supervisor topology)
Layer 7: Post-judge budget gate
Layer 8: Ensemble per-agent budget caps (dispatcher)
Layer 9: Ensemble global 80% threshold
Layer 10: BudgetTracker sync (band detection)
Layer 11: Circuit breaker at 110%
Layer 12: Orchestrator degradation chain (ensemble→fanout→supervisor→pipeline→single)
- Cost transparency: Every LLM call is tracked with delta-only values. No silent inflation.
- Race condition safety: Parallel agents (ensemble) cannot collectively exceed budget.
- Zero-waste execution: Nodes skip LLM calls entirely when budget is exhausted.
- Multiple safety nets: Even if one gate misses, the circuit breaker catches overruns at 110%.
- Correct band detection:
BudgetTrackerstays in sync with live state, sobudget_interrupt.pyfires accurately.
The original AAAI-26 paper uses ILP for model selection. Implement a lightweight online ILP solver using scipy.optimize.milp (already in requirements.txt as scipy) that uses observed cost-per-token data from core/stats.py as ILP coefficients. This would make BAMAS fully paper-faithful and publishable as an extension.
Current Thompson Sampling resets per deployment. Add task embedding similarity: when a new task arrives, find the 3 most similar past tasks (cosine similarity of task embeddings stored in Redis), and initialise the Thompson Sampling priors from their outcomes. This is a direct research contribution.
docs/plan.md notes:
"Current implementation is threshold-based. Not topology-aware."
For supervisor topology, the escalation check should compare divergence between worker sub-results, not just executor vs. validator. This requires routing divergence signals through the supervisor dispatch loop.
As documented in AgentPrune (2024), multi-agent systems are vulnerable to adversarial messages inflating token counts. BAMAS's budget governor could be extended with a token-budget pre-commitment step: estimate max tokens per step from the plan, reject execution if a step would exceed its allocation.
The AAAI-26 paper evaluates on 3 internal tasks. A public evaluation on SWE-Bench (code), GAIA (general), and HumanEval (code generation) would make BAMAS's cost savings claims independently verifiable and dramatically increase academic citations and GitHub visibility.
| # | Action | File | Impact | Time |
|---|---|---|---|---|
| 1 | PostgreSQL audit persistence | core/audit.py |
Unlocks production durability, multi-tenant audit | 2d |
| 2 | Prometheus metrics + Grafana dashboards | api/main.py, new metrics/ |
Production monitoring, SLA tracking | 3d |
| 3 | Rate limiting on API endpoints | api/middleware/ |
Security, fairness, abuse prevention | 1d |
| 4 | OpenTelemetry distributed tracing | agent/nodes/, core/ |
Debugging at scale, cross-service visibility | 2d |
| 5 | Kubernetes manifests + health probes | deploy/ |
Deployment maturity, horizontal scaling | 2d |
Generated: 2026-07-09 | Based on AAAI-26 paper + repo analysis + web research
Last updated: Budget hardening P1–P7 complete (commit 19f1b6c)