Public engineering mirror of the retrieval, Darija classification and tool-calling code used by jak.ma, a Moroccan home-services marketplace.
Production records, credentials and deployment history are deliberately excluded. The live service can also move ahead of this mirror.
| Part | Code | Tests |
|---|---|---|
| Darija and Arabizi trade/city classification | lib/text-classifier.js |
tests/text-classifier.test.js |
| Bounded tool-calling and worker allow-list checks | lib/agent-loop.js, lib/tools.js |
tests/agent-loop.test.js |
| Candidate retrieval and citation verification | lib/grounded-retrieval.js |
tests/grounded_retrieval.test.js, tests/grounded_integration.test.js |
| Price-band rules and fallback behavior | lib/price-fairness.js |
tests/price-fairness.test.js |
The full local suite currently contains 170 passing node:test cases. They use fixtures and mocks to check deterministic behavior; they do not establish production accuracy, traffic share, latency, cost or reliability.
npm ci
npm testNo database or provider key is needed for the test suite.
npm ci
npm startThe complete server expects provider configuration and, for production-backed routes, MongoDB. Do not put credentials in the repository. The deterministic classification, retrieval and fairness tests are the easiest way to inspect the public code without production access.
query
-> follow-up/tool intent check
-> Darija rule classifier or provider fallback
-> allow-listed worker retrieval
-> streamed response
-> cited-worker and price checks
Implementation details and historical design notes are in ARCHITECTURE.md and docs/. Numerical traffic, cost and latency figures in those notes are not reproduced by this public mirror unless a file explicitly includes the dataset and command used to calculate them.
- Worker names, phone numbers, addresses or other production records
- Provider keys, database credentials or private environment files
- Private evaluation logs and service dashboards
- LoRA training data; the separately published adapter has its own model card and license
All rights reserved. The repository is public for review and reference, not open-source reuse. See LICENSE.