Files
helexa/Cargo.toml
T
grenadeandClaude Fable 5 216ebdad58
CI / Test (push) Waiting to run
CI / CUDA type-check (push) Waiting to run
CI / Format (push) Successful in 10s
CI / Clippy (push) Successful in 2m28s
CI / Build cortex SRPM (push) Has been cancelled
CI / Build neuron SRPM (push) Has been cancelled
CI / Publish cortex to COPR (push) Has been cancelled
CI / Publish neuron to COPR (push) Has been cancelled
CI / Bump version in source (push) Has been cancelled
feat(angels): confidential investor portal — access control core
New crate `helexa-angels`, the service behind angels.helexa.ai.

Why a separate service rather than routes in the helexa.ai SPA: that app
is a static bundle (vite build -> dist -> nginx `try_files`), so every
string in it — all 42 locale files included — is compiled into
/assets/index-*.js and served unauthenticated. A React route guard gates
navigation, not access; confidential material placed there is one curl
from disclosure. That is a property of static hosting, not a routing bug.

Server-rendering inverts it, and three things follow from the choice
rather than being bolted on:

- the audit is honest — one document render is one server request, so the
  log records reading rather than fetching. An SPA against a JSON API
  could pull every document once and re-read them offline for a week
  while the log showed a single view;
- watermarking is possible at all, since the viewer is in scope at render
  time;
- no second asset pipeline and no i18n machinery — the portal is
  English-only by decision, all wording operator-reviewed.

Shared with helexa.ai: credentials. One helexa account signs in on both,
so an investor can evaluate the platform they are being asked to back.
NOT shared: sessions. Upstream's `sessions` back the public SPA, whose
token sits in localStorage in an app that renders markdown, runs a chat
loop and fetches remote pages; honouring those tokens here would put
confidential documents one script injection away. The cookie minted here
is HttpOnly, Secure, SameSite=Lax and host-only — no Domain attribute, so
it never travels to helexa.ai.

Schema lives in its own `angels` Postgres schema, not `public`. Both
services run sqlx::migrate! against one database and sqlx writes an
unqualified `_sqlx_migrations`; two migrators in one schema would fight
over that table and corrupt each other's history. Own schema, own
bookkeeping, with `search_path = angels, public` keeping public.users
reachable for the credential join.

Invites are reusable and treated as a distribution mechanism, not a
security boundary — a code will be forwarded, and the design assumes so.
What it buys is a chance to identify yourself; access then attaches to
the USER. Someone who forwards a code produces another *named* account,
never anonymous access, and a grant can be revoked where an unguessable
content URL cannot. Only the code hash is stored.

Sharp edges handled: sign-in verifies against a real argon2 hash even for
unknown addresses, since holding an account here implies being an invited
investor and timing would otherwise leak that; `next=` is confined to
same-site paths (//host and scheme URLs rejected) so the portal can't be
used as an open redirect; unknown, revoked, expired and exhausted codes
are indistinguishable; unverified accounts cannot sign in, or an invite
sent to one person could be claimed by whoever registered that address
first; a revoked grant is never resurrected by re-using a live code.

Operator CLI: invite / invites / access / reads / revoke / approve /
revoke-invite. Registration delegates to helexa-upstream rather than
forking password policy, argon2 params, verification mail and the
unverified reaper.

19 unit tests. Workspace fmt/clippy/test green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165r11RzqkMqWWXfJE8tAVU
2026-08-03 22:09:29 +03:00

89 lines
2.9 KiB
TOML

[workspace]
resolver = "2"
members = [
"crates/cortex-core",
"crates/cortex-gateway",
"crates/cortex-cli",
"crates/neuron",
"crates/helexa-acp",
"crates/helexa-angels",
"crates/helexa-bench",
"crates/helexa-router",
"crates/helexa-stream",
"crates/helexa-tools",
"crates/helexa-upstream",
]
[workspace.package]
version = "0.1.16"
edition = "2024"
license = "GPL-3.0-or-later"
repository = "https://git.lair.cafe/helexa/helexa"
[workspace.dependencies]
# async runtime
tokio = { version = "1", features = ["full"] }
# web framework
axum = { version = "0.8", features = ["macros"] }
tower = "0.5"
tower-http = { version = "0.6", features = ["cors", "trace", "timeout"] }
# serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
toml = "0.8"
# http client (for proxying to neuron backends)
reqwest = { version = "0.12", features = ["json", "stream"] }
# observability
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
metrics = "0.24"
metrics-exporter-prometheus = "0.16"
# time
chrono = { version = "0.4", features = ["serde"] }
# config
figment = { version = "0.10", features = ["toml", "env"] }
# error handling
anyhow = "1"
thiserror = "2"
# async traits
async-trait = "0.1"
# CLI
clap = { version = "4", features = ["derive"] }
# futures / streams (for SSE proxying)
futures = "0.3"
tokio-stream = "0.1"
eventsource-stream = "0.2"
# workspace crates
cortex-core = { path = "crates/cortex-core" }
cortex-gateway = { path = "crates/cortex-gateway" }
# Patched cudarc (affects neuron's 0.19.x only; candle's 0.17.x is
# untouched since the fork is 0.19.8, rebased for the candle 0.11 bump, and now also serves candle's ^0.19.8 req — one unified cudarc). Adds
# Comm::abort / get_async_error / raw comm() — needed for #17 Stage 2 TP
# hang-recovery (abort a wedged collective from another thread, then
# rebuild the comm). Pinned to a fork revision pending upstream review
# (grenade/cudarc @ nccl-comm-abort).
[patch.crates-io]
cudarc = { git = "https://github.com/grenade/cudarc", rev = "6904cf2e651a0384eac318f003ce6417f47f5d94" }
# Patched candle (#199): z_image all-ones attention-mask elision so the
# flash-attn path actually engages — unlocks >=1536^2 denoising on the
# blackwell (flash-attn) builds. Upstream PR:
# https://github.com/huggingface/candle/pull/3798 — drop this pin (and
# the fork) when it lands in a release. All four crates pin to the same
# rev so candle types unify across the graph.
candle-core = { git = "https://github.com/grenade/candle", rev = "f8fa85fd2753b334cb4f42e7357f8ba9d9bb2940" }
candle-nn = { git = "https://github.com/grenade/candle", rev = "f8fa85fd2753b334cb4f42e7357f8ba9d9bb2940" }
candle-transformers = { git = "https://github.com/grenade/candle", rev = "f8fa85fd2753b334cb4f42e7357f8ba9d9bb2940" }
candle-flash-attn = { git = "https://github.com/grenade/candle", rev = "f8fa85fd2753b334cb4f42e7357f8ba9d9bb2940" }