Windows beta 1.9.3.1. See the GitHub release for downloads.
Townlight Grants 0.3.0 is packaged with Windows beta 1.9.3.1. Staff can draft an opportunity, assign it to a named staff member, review it against an adopted Budget revision, a signed Contract and a Records request, then record the award, complete its reporting and download a verified closeout archive. The standalone API provides advisory workpapers and retains its original routes and settings. See the GitHub release.
Townlight Grants is the Townlight module for grant opportunity triage, eligibility-factor matching, application outline support, compliance-calendar scaffolding, staff review queues, review-required Townlight Records grant context packets, adversarial local integration mocks, and audit-ready grant files.
Current state: v0.3.0 grant support and staff review queue runtime. This repo ships a FastAPI package using Townlight Core 1.3.0.dev2, health/root endpoints, documentation gates, deterministic and database-backed grant opportunity triage, compliance-calendar records, staff-only review queue workflows, review-required CivicRecords/grant-file context packets, adversarial local integration mocks, application outline helper, audit-ready export checklist, and accessible public sample UI at /civicgrants. It does not ship live funder feeds, official eligibility decisions, legal advice, live LLM calls, submission portals, award acceptance, or grant system-of-record integrations.
- Triage sample grant opportunities and recommend a staff owner.
- Match sample eligibility factors that staff must verify.
- Draft application outlines for staff review.
- Build compliance-calendar scaffolds for awarded grants.
- Persist grant opportunity and compliance-calendar records when
CIVICGRANTS_GRANT_DB_URLis configured. - Route grant review work through staff-only queue endpoints protected by
CIVICGRANTS_STAFF_API_KEY. - Carry Townlight Records and grant-file context IDs into review-required packets without calling those systems live.
- Validate adversarial local integration mocks for spoofed roles, official eligibility attempts, submission attempts, award-acceptance attempts, legal-advice claims, stale context, and live funder-feed claims.
- Produce audit-ready export checklists for grant files.
- Demonstrate a public grant-support UI at
/civicgrants.
- It does not decide official eligibility.
- It does not submit grant applications.
- It does not accept grant awards.
- It does not provide legal advice.
- It does not call live LLMs or live funder feeds in this recovery release.
- It does not replace a grant management system of record.
Townlight Grants installs against the pinned Townlight Core source:
python -m pip install "townlight-core @ git+https://github.com/townlight/core.git@2f6ba9be4a95e3772dc47a3682ac780c5283b626"GET /returns the shipped/planned boundary.GET /healthreturns package and Townlight Core versions.GET /civicgrantsreturns the accessible public sample UI.POST /api/v1/civicgrants/opportunities/triagereturns sample opportunity triage.POST /api/v1/civicgrants/eligibility/matchreturns staff-review eligibility factors.POST /api/v1/civicgrants/applications/outlinereturns an application outline and astaff_review_idwhen persistence is configured.POST /api/v1/civicgrants/compliance/calendarreturns compliance reminders and acompliance_idwhen persistence is configured.GET /api/v1/civicgrants/compliance/{compliance_id}retrieves a persisted compliance calendar whenCIVICGRANTS_GRANT_DB_URLis configured.POST /api/v1/civicgrants/context/grant-reviewreturns review-required CivicRecords/grant-file context.POST /api/v1/civicgrants/integrations/mock/grant-contextvalidates local adversarial integration payloads.POST /api/v1/civicgrants/staff/reviewscreates a staff-only review queue item.GET /api/v1/civicgrants/staff/reviewslists staff-only review queue items.PATCH /api/v1/civicgrants/staff/reviews/{review_id}updates staff-only queue status, assignment, and resolution.GET /api/v1/civicgrants/staff/reviews/summaryreturns staff queue counts.POST /api/v1/civicgrants/exportreturns an audit-file export checklist.
Set CIVICGRANTS_GRANT_DB_URL to enable local SQLAlchemy-backed grant records:
export CIVICGRANTS_GRANT_DB_URL="sqlite+pysqlite:///./civicgrants.db"Set CIVICGRANTS_STAFF_API_KEY before using staff-only review routes:
export CIVICGRANTS_STAFF_API_KEY="replace-with-city-secret"Staff routes require X-CivicGrants-Role: staff and X-CivicGrants-Staff-Key matching the configured key. Townlight Grants uses Townlight Core staff_key_gate for timing-safe key comparison. Without persistence, Townlight Grants remains deterministic and stateless. Retrieval and staff-only endpoints return actionable 503 responses that name the required configuration.
python -m pip install -e ".[dev]"
python -m pytest -q
bash scripts/verify-release.shCode: AGPL-3.0-only, with the TownLight Public Institution Exception for qualifying deployments. See LICENSE and LICENSE-EXCEPTION.md. Documentation: CC BY 4.0 (LICENSE-DOCS).