- Rust 90.6%
- TypeScript 6.6%
- PLpgSQL 1.6%
- Shell 0.5%
- JavaScript 0.4%
- Other 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
CI / Web checks (push) Successful in 54s
Security / Rust dependency advisories (push) Successful in 4m17s
Security / npm dependency advisories (push) Successful in 13s
Security / Secret scan (push) Successful in 23s
CI / Rust checks (push) Successful in 32m59s
Reviewed-on: #65 |
||
| .cargo | ||
| .forgejo/workflows | ||
| .superpowers/sdd/2026-10-27-lexical-search | ||
| crates | ||
| deploy/postgres | ||
| docs | ||
| migrations | ||
| scripts | ||
| web | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| .gitleaksignore | ||
| .node-version | ||
| Cargo.lock | ||
| Cargo.toml | ||
| compose.yaml | ||
| GLOSSARY.md | ||
| README.md | ||
| rust-toolchain.toml | ||
Security-Force RAG Application
The product requirements and design baselines are in docs/. See the implementation sequence and prioritized backlog.
Toolchain
Use Rust 1.94.1 through rustup, Node.js 22.23.2, and npm 10.9.8. The repository pins these in rust-toolchain.toml, .node-version, and web/package.json. Install Node with your preferred version manager; npm rejects incompatible versions. Rustup installs the pinned compiler, rustfmt and Clippy when a Rust command is first run here.
Commit both Cargo.lock and web/package-lock.json. Use locked installations for routine development and update dependencies deliberately in reviewed changes.
Checks
From the repository root:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
From web/:
npm ci --no-audit --no-fund
npm run typecheck
npm test
npm run test:coverage
npm run build
Rust formatting fixes use cargo fmt --all. The ordinary workspace suite needs no services. Run the PostgreSQL integration suite explicitly with bash scripts/test-postgres.sh and a disposable TEST_DATABASE_URL; CI requires this step against PostgreSQL 17. See database setup/testing and CI setup.
Both Rust and frontend require at least 80% line coverage, independently. Install Rust coverage tools with rustup component add llvm-tools-preview and cargo install cargo-llvm-cov --version 0.6.20 --locked, then run bash scripts/coverage.sh rust with the disposable TEST_DATABASE_URL exported. This includes the otherwise ignored PostgreSQL contracts. Frontend coverage runs through npm run test:coverage above. See coverage scope, reports and failure evidence.
Local development
Prerequisites: the pinned toolchains above and Docker with Compose.
- Copy
.env.exampleto.envfor local-only values. - Start local dependencies with
docker compose up -d. - Export the trusted local settings (
set -a,. ./.env,set +a), then runcargo run --locked -p rag-storage-postgres --bin migratewith the separate migration identity. New volumes bootstrap synthetic roles automatically; see the database guide for existing volumes. - Start the API with
cargo run --locked -p rag-api(default bind:127.0.0.1:3000). - In
web/, runnpm ci --no-audit --no-fund, thennpm run dev(default:127.0.0.1:5173). - Check liveness/readiness with
curl --fail http://127.0.0.1:3000/health/liveand/health/ready. - Stop development services with
docker compose down; the named database/index volumes are retained.
Compose reads .env for its local services; the API does not load that file automatically. Export an API setting such as API_BIND in its process environment when overriding the default. Validate Compose without starting services using docker compose config --quiet.
The API verifies migration integrity and restricted PostgreSQL credentials before startup, then performs bounded database readiness probes. Migrations run separately through the DDL role. Readiness for Qdrant, identity/policy and inference remains future work as those modules are connected. See the health and telemetry guide for probes, the operator detail route and the log contract.
The application's view of the AI Engine (model profiles, bounded cancellable requests, streaming and isolation rules) is specified in the AI Engine contract; no real adapter is wired yet.
The React app now has passkey sign-in, invitation and self-registration, administrator approval, account and recovery screens (see identity operations). The chat workspace behind them is still a static shell: retrieval, generation and feedback are not connected. A conversation create, list and history API now exists (authorized on every request and PostgreSQL-only, see conversations operations), but the React workspace now lists, creates and shows conversation history (see web conversations), but there are no chat turns, retrieval or generation yet. Group-aware, fail-closed enforcement now exists at the request boundary through the Enforcer (see authorization operations), but the only protected content routes are the conversation routes; document upload, revision and metadata routes now exist (registered versions stay quarantined and nothing is searchable, see documents operations). A separate ingest-worker process chunks quarantined versions under its own database role, with probes and metrics (see the ingestion worker guide). Chunks can be searched by keyword through an authorization-filtered PostgreSQL search once a version is active, which nothing sets yet and no route exposes (see the lexical search guide). A Qdrant vector index with profile-bound collections and an authorization filter exists as a library with no caller yet (see the vector index guide). Registrations, refusals and audit reads are recorded in a per-organization hash-chained audit trail with limits described in the audit trail guide. Cryptography in use is inventoried in the crypto inventory, and startup requires the proposed (not approved) set dev-synthetic.1 described in crypto profiles.
All local credentials and content must be synthetic development data. Do not place operational or classified material in this environment. The example credentials are intentionally weak and must never be reused outside isolated local development.