Hugdrigo's picture
Upload 3 files
46f9812 verified
|
Raw History Blame Contribute Delete
6.55 kB
---
title: "BudgetForge | Strategic Budget Intelligence"
emoji: "🏛️"
colorFrom: green
colorTo: blue
sdk: static
app_file: index.html
pinned: false
license: mit
short_description: "Offline public budget allocation and equity lab"
tags:
- operations-research
- decision-support
- optimization
- public-policy
- budgeting
- data-visualization
- javascript
---
# BudgetForge | Strategic Budget Intelligence
**Project #72 · Portfolio optimization · Transparent policy trade-offs · Local-first**
BudgetForge is a standalone browser application for exploring how a fixed, illustrative budget can be allocated among candidate public, academic, and community projects. It combines an **exact binary project-portfolio optimizer**, a hard minimum priority-area spending requirement, adjustable decision weights and reproducible preference sensitivity analysis.
> **Educational prototype:** Every example, amount, impact score, cost and beneficiary count shipped with the app is **synthetic**. This is not a fiscal forecast, procurement authorization, audit certification, causal evaluation, or substitute for community consultation.
## Live application
The `index.html` file contains all CSS, JavaScript, data examples and charts. It runs entirely in your browser as a **Hugging Face Static Space**. No Python server, external libraries, backend, model inference API, registration or paid hardware is required.
## Features
| Area | What it does |
|---|---|
| Command Center | Budget use, priority-area spending, selected programs and beneficiaries, plus an exact-versus-greedy comparison |
| Program Portfolio | Search and edit program costs, impact and readiness scores |
| Allocation Studio | Four adjustable criteria; re-optimize the portfolio immediately |
| Equity & Coverage | Compare priority-area shares, regional coverage and the unconstrained benchmark |
| Sensitivity Lab | Re-optimize 120 times under seeded perturbations of the decision weights |
| Data & Audit | Validated CSV import, seven downloadable outputs and methodology disclosure |
## Included synthetic examples
1. **Municipal Services:** ten community and infrastructure programs, $145k illustrative budget, minimum 25% priority spending.
2. **University Research:** ten academic investments, $120k illustrative budget, minimum 30% priority spending.
3. **Climate Resilience:** ten adaptation investments, $185k illustrative budget, minimum 30% priority spending.
All currency figures are in **thousands of illustrative US dollars** and do not reflect any jurisdiction's current costs.
## Mathematical approach
For each project `i`, `x_i ∈ {0,1}` means either fully selected or not selected.
**Maximize** `Σ score_i · x_i` subject to:
- **Budget:** `Σ cost_i · x_i ≤ B`
- **Priority share:** `Σ_priority cost_i · x_i ≥ q · Σ_all cost_i · x_i`
- At least one selected project, and a maximum of fourteen imported candidates.
Each `score_i` combines impact (`impact / 100`), impact-per-dollar efficiency (normalized to the maximum impact/cost ratio in the present portfolio), readiness (`readiness / 100`) and low-risk preference (`(100-risk)/100`). Four user-controlled nonnegative weights are normalized to sum to one. The optimizer enumerates every subset of at most 14 candidates; therefore the reported objective is globally optimal **only within this explicitly defined model**. Ties are resolved by larger reported beneficiary reach and then lower cost.
**Not in the objective:** Urgency is shown as metadata; estimated beneficiaries are used only to break an exact-score tie. It is misleading to read this objective as social welfare, net present value or verified public benefit.
The reference greedy method sorts projects by `score/cost`. It may be infeasible under the priority-share rule and is not a certified optimizer.
### Sensitivity protocol
The application generates 120 deterministic preference perturbations using a seeded pseudo-random number generator. The four weights are independently multiplied by factors between 0.58 and 1.42 and then normalized. The budget and area target remain fixed. Selection frequency indicates **robustness to modeled preference changes**, not empirical confidence or an effect probability.
## Import CSV
Choose **Data & Audit → CSV template**, fill in these exact fields, and import the file:
```csv
id,name,area,cost,impact,urgency,risk,readiness,people
P01,Community learning centre,Priority,24,88,82,25,90,1300
P02,Urban information portal,General,15,70,62,20,95,1800
```
- **2–14 rows**, unique IDs, program names up to 120 characters.
- `area` must be **Priority** or **General** (exact spelling).
- `cost` is strictly positive, in illustrative thousands of USD.
- `impact`, `urgency`, `risk`, `readiness` are numerical scores in `[0,100]`.
- `people` is nonnegative, illustrative reach and **not deduplicated**.
- Invalid imports are rejected without replacing the current portfolio.
- Imported datasets and edits live in the current browser session. Download a snapshot before closing or refreshing.
## Exported files
The **Data & Audit** section provides a Markdown research report, a full JSON snapshot, selected-project CSV, full-portfolio CSV, decision audit CSV, deterministic sensitivity CSV and import template CSV. CSV downloads escape spreadsheet formula prefixes in text fields.
## Limitations and ethical use
- No partial funding, multi-year disbursement, project dependency, uncertainty about impact or mutually exclusive program groupings.
- Budget equity is based on **spending share**, not the distribution of actual outcomes, access, legal rights or fairness.
- Beneficiary counts may overlap and are not a measured or audited impact.
- Input scores are subjective and must be validated with stakeholder evidence, public consultation, feasibility checks and independent review.
- No procurement, fiscal or regulatory compliance is checked.
- As this is a purely static app, data is not transmitted to a backend. Do not publish sensitive raw data in the public Space repository.
## Verification
The provided technical archive contains `tests/test_engine.js` and `tests/test_browser.py`. The engine suite checks random small cases against an independent recursive exhaustive search. Chromium functional checks cover all six sections, both screen sizes, editing, data validation, exports, and reset flows. These are **local checks**, not confirmation of deployment to a user's Hugging Face account.
## License
MIT, see [LICENSE](LICENSE).