Nxtgauge Backend Services
Critical: ai_access_middleware was wired via from_fn_with_state((), ...) - passing the unit type as state - and pulled AppState from request extensions, which nothing ever populated. Every request through /api/ai/* and /api/ai/auto/* returned 500 INCOMPLETE_CONTEXT. Fixed by extracting State<AppState> properly and passing the real state at both call sites; removed the redundant, identically-broken inner middleware layer inside ai_router(). Security: ai_addon_purchase (/api/ai/addons/purchase, /api/ai/credits/buy) and ai_plan_upgrade (/api/ai/plans/upgrade) granted AI credits / plan upgrades (including enterprise) with zero payment verification - any authenticated user could mint unlimited free credits, and the frontend already called this directly. Disabled both until wired to a real payment flow. Quality: added a grounding/anti-hallucination system prompt applied to every AI feature call (orchestrator::call_feature / call_feature_with_plan, plus the handful of call sites that bypass the orchestrator). Verified against the live model that it reduces but does not eliminate fabrication on harder reasoning tasks - even the larger model invents facts not present in the input on some prompts. This is a real limitation of the two locally-hosted models, not something a system prompt alone fully solves; flagged for follow-up (e.g. a verification pass or deterministic checks for high-stakes decisions like auto-apply). Also fixed Persona/Pillar keyword detection using naive substring matching (e.g. "team" matching inside "esteemed", "lead" matching inside "leadership") - added a word-boundary-aware contains_word() helper and applied it to all keyword classifiers in this file. |
||
|---|---|---|
| .cargo | ||
| .forgejo | ||
| .gitea/workflows | ||
| .github/workflows | ||
| .mavis/plans | ||
| .sqlx | ||
| apps | ||
| crates | ||
| docs | ||
| load-tests | ||
| scripts | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| cargo-deny.toml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| companies.pid | ||
| customers.pid | ||
| DEPLOYMENT_OPTIMIZATION.md | ||
| docker-compose.yml | ||
| Dockerfile.base | ||
| Dockerfile.fast | ||
| Dockerfile.from-binary | ||
| Dockerfile.migrate | ||
| Dockerfile.optimized | ||
| Dockerfile.simple | ||
| Dockerfile.superfast | ||
| Dockerfile.template | ||
| Dockerfile.ultrafast | ||
| Dockerfile.working | ||
| gateway.pid | ||
| job_seekers.pid | ||
| k8s-migration-job.yaml | ||
| README.md | ||
| start-services.pid | ||
| start-services.sh | ||
| TESTING_STRATEGY.md | ||
| users.pid | ||
| wir.md | ||
NXTGAUGE Backend Rust
Rust migration target for nxtgauge-nov-2025-backend, preserving the same microservices and request flow.
Target Service Topology
gateway(HTTP API)users(identity, runtime roles, onboarding, approvals)companiescustomersprofessionalsjobseekers
Migration Policy
- Keep contracts stable (REST + proto semantics).
- Keep runtime-config and onboarding schema behavior unchanged during parity phases.
- Replace service implementations one by one.
See docs/MIGRATION_MASTER_PLAN.md for full staged plan.
CI (Woodpecker)
Required secrets:
REGISTRY_USERNAMEREGISTRY_PASSWORD
See .forgejo/workflows/README.md for details.