RePath is a logic-first decision engine for reuse and recycling. It turns local rules into clear, ranked options—reuse, sell, recycle, drop-off, or trash—based on what you’re holding and where you are. Built for offline-friendly, white-label apps.
npm install
npm run validate
npm run query -- --pack fort-collins-co-us "cardboard"
npm run decide -- --packId fort-collins-co-us --label chair --countryCode USRole contracts are defined in:
docs/agents/README.mddocs/agents/ux.mddocs/agents/qa.mddocs/agents/devsecops.mddocs/agents/pm.md
Run local review checks:
npm run validate
npm run smoke
npm test
npm run review:devsecops
npm run review:pmPull request flow:
- Fill
.github/pull_request_template.md, including theAgent Reviewssection. - Open a PR to trigger
.github/workflows/role-review-gates.yml. - You can also run
Role Review Gatesmanually from GitHub Actions (workflow_dispatch).
Gate configuration:
REPATH_AUDIT_FAIL_LEVEL(default:critical) controls thenpm auditthreshold. Supported values:off,low,moderate,high,critical.REPATH_PM_STRICT(GitHub repository variable) makes PM contract checks blocking when set totrue.
npm run build:manifestgeneratesdist/manifest.jsonfrom local packs.npm run build:manifestalso generatesdist/search.jsonwith a lightweight token index.npm run decideruns deterministic pathway decisions (rules + channels + donation locations).npm run release:runtimebuilds a release-ready runtime data bundle plus checksums.npm run smokeruns a tiny validation + query smoke test. Notes:- Search stemming is optional. If you install
stemmer, search will use it; otherwise it falls back to basic token normalization. build:manifestsupportsREPATH_PACK_BASE_URLto produce deployablemanifest.jsonURLs (for example:REPATH_PACK_BASE_URL=https://cdn.example.com/packs npm run build:manifest).
Runtime releases are data-only and include:
packages/packs/*/pack.jsonschema/pack.schema.jsondist/manifest.jsondist/search.json
Release assets should also include:
<bundle>.tar.gz<bundle>.sha256<bundle>.files.sha256
For details, see docs/release-contract.md.
User-facing release highlights live in release-notes.md.
To generate a release bundle locally:
npm run release:runtimeOptional flags:
--tag vX.Y.Z--out-dir dist/releases--pack-base-url https://cdn.example.com/packs
This repo uses a small schema and prompt template to create consistent jurisdiction packs.
Files:
- Schema:
schema/pack.schema.json - Prompt template:
prompts/pack-creator.md - Pack data:
packages/packs/<pack-id>/pack.json
Steps:
-
Gather official sources
- City/county recycling program pages
- Official A–Z lists or accepted materials pages
- HHW program pages (hours, fees, accepted materials)
-
Create a draft pack with the prompt
- Use
prompts/pack-creator.mdwith your sources - Output JSON only
- Ensure IDs are lowercase and hyphenated
- Use
-
Validate
npm run validate- Fix any schema errors or missing required fields
-
Sanity-check
npm run query -- --pack <pack-id> "cardboard"- Verify option cards are targeted to the right
kind
Notes:
- Prefer official sources over secondary listings.
- Keep
actionsshort and specific to thekind. - Use
dropoff_otherwhen there are multiple non-city drop-off options without a single official facility. - When an item has both
dropoff_otheranddropoff_recycle, keepcopy_textguidance consistent. Do not truncate constraints (fees, minimum metal content, prep steps, etc.) on location-specific cards.
Packs live at packages/packs/<pack-id>/pack.json and follow a small, stable schema.
Required fields:
pack_id,pack_version,retrieved_atjurisdictionormunicipalitylocations[](id, name, country)items[](id, name, keywords?, option_cards[])
Optional decision-engine fields:
extends[](pack inheritance)variables{}(template variables, for examplecraigslistSubdomain)channels[](global/country/municipality channel definitions)rules[](pathway rules withthen.channelIdsand optional location targeting)
Optional versioning:
pack_schema_version(e.g.1.1.0)
Recommended fields for international support:
jurisdiction(name, country, kind?, admin_areas?)locations[].address_linesorlocations[].localitylocations[].admin_areas
Example (minimal):
{
"pack_id": "example-town-us",
"pack_version": "0.1.0",
"retrieved_at": "2026-02-02T00:00:00Z",
"jurisdiction": {
"name": "Example Town",
"country": "US",
"kind": "municipality",
"admin_areas": [
{"name": "ST", "type": "region", "code": "ST"}
]
},
"locations": [
{
"id": "example-dropoff",
"name": "Example Drop-off Center",
"country": "US"
}
],
"items": [
{
"id": "cardboard",
"name": "Cardboard",
"keywords": ["boxes", "corrugated"],
"option_cards": [
{
"id": "cardboard-dropoff",
"kind": "dropoff_recycle",
"title": "Recycle at drop-off",
"priority": 10,
"confidence": 0.8,
"actions": [
{
"type": "navigate",
"label": "Go",
"payload": {
"location_id": "example-dropoff"
}
}
]
}
]
}
]
}