fix(devenv): repair the shell; one-command setup with devenv up or npm run dev #99

Closed
jalenluorion wants to merge 5 commits from feat/devenv-up into main
Member

Makes local setup one step for everyone, and fixes devenv/CI on main.

  • fix(devenv): update git-hooks so the shell evaluates again. Since the Oct 19 lockfile update (#97/#98), every devenv shell and CI run failed with "git-hooks.hooks.gitleaks.entry was accessed but has no value defined": kennel enables the gitleaks hook git-hooks.nix added on Oct 13, but our lock kept git-hooks on Sep 27. Only that input moves. The newer formatters then normalize some files: api/pyproject.toml is whitespace-only (git diff -w is empty); the Markdown gets mdformat normalization (list numbering, --- dividers, one * bullet, and a link that had been split across lines, now fixed). Needed because CI runs prek run --all-files and devenv formats on shell entry.
  • feat(devenv): devenv up runs the API, the web app (npm run dev:next) and kennel's Ricochet module on :8090, with the dev secrets from OpenBao.
  • feat(web): npm run dev starts a local sign-in relay (web/scripts/dev-relay.js), a stand-in for Ricochet's dev mode: 127.0.0.1:8090, unpadded base64url JSON state, loopback http(s) return_to only, 302 with state/code/session_state/iss/error/error_description, else 400 invalid state. Skipped when 8090 is taken. dev.js forwards SIGINT/SIGTERM/SIGHUP to next so it never outlives the script. No Rust or third terminal for the manual setup.
  • docs: one getting-started guide with three setups (manual env files before governance; OpenBao via secretspec run on any OS; devenv up with Nix). The api and web READMEs drop pip/venv, Vercel, Railway and old-repo instructions, and the api README no longer shows running migrations against production. Scraper and course agent READMEs use uv and port 8080.

Tested: devenv up and the manual path (API plus npm run dev, no Ricochet installed) both signed in through Keycloak and loaded courses; SIGTERM to npm run dev frees :3000 and :8090; relay refusals cover non-local, lookalike and userinfo hosts, non-http schemes and malformed state (independent review tried ~25 hostname tricks). Web tests 34/34, tsc clean, no new eslint errors; prek run --all-files passes, gitleaks included. kennel/build and nixbot pass; the CI runners have not picked up jobs since Oct 22.

Makes local setup one step for everyone, and fixes devenv/CI on main. - **fix(devenv): update git-hooks so the shell evaluates again.** Since the Oct 19 lockfile update (#97/#98), every `devenv shell` and CI run failed with "`git-hooks.hooks.gitleaks.entry` was accessed but has no value defined": kennel enables the gitleaks hook git-hooks.nix added on Oct 13, but our lock kept git-hooks on Sep 27. Only that input moves. The newer formatters then normalize some files: `api/pyproject.toml` is whitespace-only (`git diff -w` is empty); the Markdown gets mdformat normalization (list numbering, `---` dividers, one `*` bullet, and a link that had been split across lines, now fixed). Needed because CI runs `prek run --all-files` and devenv formats on shell entry. - **feat(devenv): `devenv up`** runs the API, the web app (`npm run dev:next`) and kennel's Ricochet module on :8090, with the dev secrets from OpenBao. - **feat(web): `npm run dev` starts a local sign-in relay** (`web/scripts/dev-relay.js`), a stand-in for Ricochet's dev mode: 127.0.0.1:8090, unpadded base64url JSON `state`, loopback http(s) `return_to` only, 302 with `state`/`code`/`session_state`/`iss`/`error`/`error_description`, else `400 invalid state`. Skipped when 8090 is taken. `dev.js` forwards SIGINT/SIGTERM/SIGHUP to next so it never outlives the script. No Rust or third terminal for the manual setup. - **docs:** one getting-started guide with three setups (manual env files before governance; OpenBao via `secretspec run` on any OS; `devenv up` with Nix). The api and web READMEs drop pip/venv, Vercel, Railway and old-repo instructions, and the api README no longer shows running migrations against production. Scraper and course agent READMEs use `uv` and port 8080. Tested: `devenv up` and the manual path (API plus `npm run dev`, no Ricochet installed) both signed in through Keycloak and loaded courses; SIGTERM to `npm run dev` frees :3000 and :8090; relay refusals cover non-local, lookalike and userinfo hosts, non-http schemes and malformed state (independent review tried ~25 hostname tricks). Web tests 34/34, tsc clean, no new eslint errors; `prek run --all-files` passes, gitleaks included. kennel/build and nixbot pass; the CI runners have not picked up jobs since Oct 22.
The Oct 19 lockfile update moved kennel to a version that enables the
gitleaks hook from git-hooks.nix, but git-hooks stayed on a Sep 27 revision
that predates it, so every devenv shell and CI run failed to evaluate. The
newer formatters reformat a few Markdown files and pyproject.toml
(whitespace and indentation only).
feat(devenv): start the API, web app and sign-in relay with devenv up
Some checks failed
nixbot/nix-eval evaluation succeeded in 0s (1 warning)
nixbot/nix-build 0 attributes built
kennel/build build succeeded
CI / check (pull_request) Has been cancelled
CI / check-1 (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
7700246fba
Team members with Nix now run devenv up instead of three terminals and env
files: the API and web app run as processes with the dev secrets from
OpenBao, and kennel's ricochet module serves the dev Keycloak callback on
:8090. The manual setup stays in the guide for Windows and new members.
feat(web): start a local sign-in relay with npm run dev
Some checks failed
nixbot/nix-build 0 attributes built
kennel/build build succeeded
nixbot/nix-eval evaluation succeeded in 0s (1 warning)
CI / check (pull_request) Has been cancelled
CI / check-1 (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
fe36eb2e73
The cal-dev Keycloak client only returns to localhost:8090, so the manual
setup needed Rust, a Ricochet install and a third terminal. npm run dev now
serves a small stand-in for Ricochet's dev mode on 127.0.0.1:8090 that only
forwards to loopback URLs, and skips it when the port is taken. devenv up keeps
the real Ricochet and starts Next with dev:next.
jalenluorion changed title from fix(devenv): repair the shell, and start everything with devenv up to fix(devenv): repair the shell; one-command setup with devenv up or npm run dev 2026-10-24 20:55:57 +00:00
Manual (env files, before governance), OpenBao (secretspec run, any OS) and
devenv (devenv up, with Nix). The api and web READMEs drop the pip/venv,
Vercel, Railway and old-repo instructions and point at the guide; the api
README no longer shows running migrations against production.
fix(web): stop next with npm run dev, and decode state like Ricochet
All checks were successful
nixbot/nix-eval evaluation succeeded in 0s (1 warning)
nixbot/nix-build 0 attributes built
kennel/build build succeeded
CI / check-1 (pull_request) Successful in 4m2s
CI / check (pull_request) Successful in 0s
CI / build (pull_request) Successful in 3m10s
d87b8a955a
dev.js now forwards SIGINT, SIGTERM and SIGHUP to next and exits the way next
did, so stopping npm run dev by signal no longer leaves next holding :3000.
The relay accepts only unpadded base64url state, as Ricochet does.
Author
Member

Superseded by #105, which removes the Ricochet step without a relay and carries the devenv lockfile fix.

Superseded by #105, which removes the Ricochet step without a relay and carries the devenv lockfile fix.
jalenluorion closed this pull request 2026-11-21 21:51:34 +00:00
Some checks are pending
nixbot/nix-eval evaluation succeeded in 0s (1 warning)
Required
Details
nixbot/nix-build 0 attributes built
Required
Details
kennel/build build succeeded
CI / check-1 (pull_request) Successful in 4m2s
CI / check (pull_request) Successful in 0s
CI / build (pull_request) Successful in 3m10s
CI / checks*
Required
kennel/deploy
Required

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/cal!99
No description provided.