No description
  • Rust 90.6%
  • TypeScript 6.6%
  • PLpgSQL 1.6%
  • Shell 0.5%
  • JavaScript 0.4%
  • Other 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
amiryahaya 699a34e457
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
Merge pull request 'Add Qdrant vector index with authorization-filtered search (R01, #20)' (#65) from feat/20-qdrant-index into main
Reviewed-on: #65
2026-10-27 14:14:20 +01:00
.cargo ci: add post-merge security workflow 2026-10-23 00:34:49 +08:00
.forgejo/workflows ci: free the plain debug build before the instrumented coverage build 2026-10-27 15:23:07 +08:00
.superpowers/sdd/2026-10-27-lexical-search fix(storage)+docs: drop dead empty-scope guard, share test helpers, correct tsv exposure notes (#19) 2026-10-27 01:02:18 +08:00
crates fix(ci,qdrant): musl Qdrant binary in CI, crypto inventory, shared batch check, normalized URL (#20) 2026-10-27 03:41:05 +08:00
deploy/postgres feat(api): ingest-worker binary with probes and metrics; docs (#18) 2026-10-26 12:30:18 +08:00
docs fix(ci,qdrant): musl Qdrant binary in CI, crypto inventory, shared batch check, normalized URL (#20) 2026-10-27 03:41:05 +08:00
migrations feat(storage): lexical index on chunks and a column-limited rag_app grant (#19) 2026-10-27 00:28:13 +08:00
scripts fix(ci,qdrant): musl Qdrant binary in CI, crypto inventory, shared batch check, normalized URL (#20) 2026-10-27 03:41:05 +08:00
web test(web): raise the vitest timeout to 15 s for slow CI runners 2026-10-26 22:22:17 +08:00
.env.example fix(ci,qdrant): musl Qdrant binary in CI, crypto inventory, shared batch check, normalized URL (#20) 2026-10-27 03:41:05 +08:00
.gitattributes Merge remote-tracking branch 'origin/main' into feat/5-crypto-config 2026-10-26 23:29:18 +08:00
.gitignore ci: add post-merge security workflow 2026-10-23 00:34:49 +08:00
.gitleaksignore chore(security): ignore the cm1 metadata test vector in gitleaks (#5) 2026-10-26 23:01:23 +08:00
.node-version ci: establish reproducible Rust and React baseline 2026-10-22 02:47:36 +08:00
Cargo.lock fix(ci,qdrant): musl Qdrant binary in CI, crypto inventory, shared batch check, normalized URL (#20) 2026-10-27 03:41:05 +08:00
Cargo.toml feat(storage-qdrant): qdrant-client 1.20.0, UUID chunk ids, injective collection names (#20) 2026-10-27 02:43:10 +08:00
compose.yaml ci+docs: run the Qdrant suites in CI and document the vector index (#20) 2026-10-27 03:17:11 +08:00
GLOSSARY.md docs: specify identity, group access and recovery design 2026-10-22 15:28:05 +08:00
README.md ci+docs: run the Qdrant suites in CI and document the vector index (#20) 2026-10-27 03:17:11 +08:00
rust-toolchain.toml ci: establish reproducible Rust and React baseline 2026-10-22 02:47:36 +08:00

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.

  1. Copy .env.example to .env for local-only values.
  2. Start local dependencies with docker compose up -d.
  3. Export the trusted local settings (set -a, . ./.env, set +a), then run cargo run --locked -p rag-storage-postgres --bin migrate with the separate migration identity. New volumes bootstrap synthetic roles automatically; see the database guide for existing volumes.
  4. Start the API with cargo run --locked -p rag-api (default bind: 127.0.0.1:3000).
  5. In web/, run npm ci --no-audit --no-fund, then npm run dev (default: 127.0.0.1:5173).
  6. Check liveness/readiness with curl --fail http://127.0.0.1:3000/health/live and /health/ready.
  7. 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.