7.9 KiB
Agent Notes
lore-forge is a Rust web server that sits beside Epic's Lore version control server. It provides accounts, sign-in through GitHub, Discord and Google, the tokens Lore verifies, per-repository permissions, and a self-hosted forge UI on top.
Status: phase 1 in progress. The walking skeleton works end to end against a real
loreserver; see the phases in architecture-overview.md.
Git commits
- Do not add Claude or any other AI attribution to commits. No
Co-Authored-By: Claude ...trailer, no "Generated with Claude Code" line, no similar footer. This applies to commit messages and to pull request descriptions. - Commit only when asked.
Building and testing
-
cargo test --workspaceruns the unit and in-process HTTP tests.protocmust be onPATH(Lore'suser.protois compiled at build time). -
cargo clippy --workspace --all-targetsshould stay clean. -
scripts/e2e-lore.shruns lore-forge against an unmodifiedloreserverandloreCLI: by default the release pinned inlore.lock, fetched into.lore/byscripts/fetch-lore.sh. SetLORE_BIN_DIRto test another build, andLORE_PORT/FORGE_PORTto run it beside a deployment started byscripts/start.sh. Run it after any change to the issuer, registry or directory, the generatedloreserverconfig, the backup scripts, and whenever the Lore version moves.SMOKE=1stops after one login and push. It runs loreserver over TLS (lores://) with a CA made for the run, trusted throughSSL_CERT_FILEby the lore commands, lore-forge and the desktop service only;NO_TLS=1useslore://. It ends with a backup, a push, and a restore throughscripts/backup.shandscripts/restore.sh. It also drives the desktopforge-servicethroughscripts/desktop-e2e.py, so run it after service changes too;NO_DESKTOP=1skips that. That part signs in a second user, bob, with a CLI working copy, to check locks and autosync between two users. The service logs atRUST_LOG(defaultinfo,forge_service=debug) tostdout.login its directory, which the script prints on failure. Its logins useLORE_AUTH_STORE=fallback, so it never asks for the keychain. -
To move Lore:
scripts/fetch-lore.sh --pin vX.Y.Z, then the e2e test, then update the version recorded in lore-integration.md. Iflore.hchanged, regenerate the bindings (cargo run -p lore-sys-gen -- .lore/vX.Y.Z/lore.hindesktop/, afterscripts/fetch-lore.sh --liblore) and bumplore_sys::INTERFACE_VERSION. -
The desktop client in
desktop/builds separately with Zig 0.17.1 and Cargo:cd desktop && zig build testruns its Rust tests and the GUI's self-test against a private service. On macOS the window cannot open while the display sleeps ("open session: Operating system error");caffeinate -u -t 2first wakes it;zig build check -Dtarget=x86_64-windows-gnucross-compiles the GUI;cargo clippy --all-targetsindesktop/should stay clean;forge-desktop --test --config-from <toml> --screenshot <png> [--tab files|graph|tree|changes|locks]captures the window, for checking UI changes without screen-recording permission. With workspaces it syncs the first and waits for the tab's data, so it needs a live server and a login (LORE_AUTH_PATH); a held e2e run (HOLD=1 KEEP_WORK=1) provides both.- The service finds liblore through
LORE_FORGE_LIBLOREor beside its executable;forge-desktop --liblore=PATHpasses it on. Outside the e2e, the real service on macOS asks for keychain access once per binary unlessLORE_AUTH_STORE=fallbackis set.
Where things are
| Path | Contents |
|---|---|
crates/forge-store |
SQLite pool, migrations (migrations/), audit helper |
crates/forge-access |
Actions, presets, name rules, grant resolution, registry rules, organisations |
crates/forge-id |
Secret key, passwords, signing keys and JWTs, users, sessions, the issuer (src/issuer/) |
crates/forge-lore |
Vendored Lore protos (proto/), the gRPC directory and registry, generated loreserver config |
crates/forge-web |
axum routes: issuer endpoints, pages (maud), CSRF and security headers |
crates/lore-forge |
The binary: serve, loreserver-config, generate-secret-key, create-user, rotate-signing-key, backup-database |
scripts/start.sh |
Starts a deployment from run/ (git-ignored): settings, secret key, both servers |
scripts/fetch-lore.sh, lore.lock |
Downloads the pinned Lore release into .lore/ (git-ignored), checking SHA-256; --liblore fetches liblore and lore.h |
scripts/e2e-lore.sh, scripts/desktop-e2e.py |
End-to-end test against real Lore, including the desktop service |
scripts/backup.sh, scripts/restore.sh |
Back up and restore the database and loreserver's store together |
scripts/build-desktop-dist.sh |
Cross-compiles the desktop client for Linux and Windows with Zig and packs the archives /download serves |
deploy/ |
Production on Linux: install.sh, systemd units, the Caddy site, the settings template, README.md for operators |
desktop/ |
The desktop client: gui/ (C++ tray app), service/ and protocol/ (Rust), lore-sys/ (liblore bindings; gen/ regenerates them), vendor/ (UHDK, Dear ImGui) |
- .ai/designs/ holds the design documents. Start with architecture-overview.md, which links to the rest.
| Document | Covers |
|---|---|
| architecture-overview.md | The whole system, decisions made so far, build phases |
| lore-integration.md | What Lore provides and requires, and how lore-forge connects to it |
| accounts-and-sign-in.md | Accounts, invites, provider linking, sessions |
| token-issuer.md | The OIDC issuer: endpoints, grants, claims, keys |
| namespaces-and-access.md | User/org namespaces, teams, role presets, grants |
| web-ui.md | Server-rendered UI stack and its security constraints |
| forge-features.md | Repo browser, change requests, landing, activity |
| storage.md | SQLite, the data directory, tables |
| deployment.md | Production on Linux: TLS, Caddy, systemd, backups |
| desktop-client.md | The desktop client: service, GUI, TUI, their protocol, liblore, UHDK |
Working on the design
- Keep the design documents current. When a decision changes, edit the document that owns it and the decision table in the overview, rather than adding a new file that contradicts it.
- Each document separates what was verified in Lore's source from what is assumed or open. Keep that distinction when editing; do not promote an assumption to a fact without checking.
- Lore is pre-1.0 and changes quickly. Before relying on a Lore behaviour described here, re-check it against the Lore version in use. The documents record which commit they were checked against.
- Put open design decisions to the project owner as interactive questions with a recommended option, rather than listing them in prose and assuming an answer.
References
- Lore: https://github.com/EpicGames/lore. Minimum version for this design is v0.14.0. The most relevant upstream files are listed in lore-integration.md.
- UHDK: the owner's desktop library (a sibling checkout,
../uhdk-internal), vendored intodesktop/vendor/. Update it only as desktop/vendor/README.md describes; never edit the vendored copy. - piki: the owner's Go project (a sibling checkout,
../piki) is the reference for the account system. Itsagents/data-auth-services.mdmaps the auth code.