Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,24 @@ jobs:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up pnpm
uses: pnpm/action-setup@08c4be7e2e672a47d11bd04269e27e5f3e8529cb # v6.0.0
with:
package_json_file: osprey_ui/package.json

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "18"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably update this at some point, but that can happen later

cache: "npm"
cache-dependency-path: osprey_ui/package-lock.json
cache: "pnpm"
cache-dependency-path: osprey_ui/pnpm-lock.yaml

- name: Install UI dependencies
run: npm ci --ignore-scripts
run: pnpm install --frozen-lockfile
working-directory: osprey_ui

- name: Run prettier check
run: npm run format:check
run: pnpm run format:check
working-directory: osprey_ui

rust-quality:
Expand Down
18 changes: 9 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ docker compose up -d
# with coordinator:
./start.sh --with-coordinator

# UI dev server
cd osprey_ui && npm ci && npm start
# UI dev server (Corepack auto-resolves pnpm from osprey_ui/package.json's packageManager field)
cd osprey_ui && corepack enable && pnpm install --frozen-lockfile && pnpm start

# Regenerate protobuf bindings after editing proto/osprey/rpc/**/*.proto
./gen-protos.sh
Expand Down Expand Up @@ -77,7 +77,7 @@ uv run pre-commit run --all-files
UI checks (in `osprey_ui/`):

```bash
npm run format:check
pnpm run format:check
```

Rust checks (in `osprey_coordinator/`; requires `protoc`). CI only gates on `fmt` and `build`; `clippy` and `test` are advisory (`continue-on-error: true`):
Expand Down Expand Up @@ -116,7 +116,7 @@ System libs:

`install-deps` only auto-supports recent Ubuntu / Debian. Fedora, Arch, Alpine, and NixOS need manual lib installation — Playwright's troubleshooting docs cover their package names.

Before calling `browser_navigate("http://localhost:5002")`, **the operator** starts the dev server (`cd osprey_ui && npm start`, listens on `:5002`).
Before calling `browser_navigate("http://localhost:5002")`, **the operator** starts the dev server (`cd osprey_ui && pnpm start`, listens on `:5002`).

If the MCP approval prompt doesn't fire on a fresh `claude` launch, **the operator** runs `claude mcp reset-project-choices` and re-launches.

Expand All @@ -133,8 +133,8 @@ uv tool run fawltydeps --check-unused --pyenv .venv

# code-quality.yml → ui-quality (CI `working-directory: osprey_ui`)
( cd osprey_ui
npm ci
npm run format:check )
pnpm install --frozen-lockfile
pnpm run format:check )

# code-quality.yml → rust-quality (CI `working-directory: osprey_coordinator`)
# Note: in CI the `cargo clippy` and `cargo test` steps are marked `continue-on-error: true`,
Expand Down Expand Up @@ -169,7 +169,7 @@ uv tool run fawltydeps --check-unused --pyenv .venv
## Code style

- Python: version in `.python-version`. Lint + format with `ruff`, type-check with `mypy` (versions and config in `pyproject.toml` under `[tool.ruff]` and `[tool.mypy]`).
- TypeScript / React in `osprey_ui/` (versions in `osprey_ui/package.json`). Formatter is Prettier (`npm run format:check`); config in `osprey_ui/.prettierrc`. Node version in `.github/workflows/code-quality.yml`.
- TypeScript / React in `osprey_ui/` (versions in `osprey_ui/package.json`). Formatter is Prettier (`pnpm run format:check`); config in `osprey_ui/.prettierrc`. Node version in `.github/workflows/code-quality.yml`. pnpm version pinned via `packageManager` field in `osprey_ui/package.json`; resolved everywhere via Corepack.
- Rust stable in `osprey_coordinator/` (edition and toolchain in `osprey_coordinator/Cargo.toml`). Formatter `cargo fmt`; linter `cargo clippy -- -D warnings`.
- Protobuf generated files (`*_pb2*.py`, `*_pb2*.pyi`) are excluded from ruff and mypy — do not edit.

Expand All @@ -183,7 +183,7 @@ uv tool run fawltydeps --check-unused --pyenv .venv
## Dependencies

- Python deps are pinned in `pyproject.toml` and locked in `uv.lock`. Add with `uv add <pkg>` (runtime) or `uv add --dev <pkg>` (dev); commit the updated `uv.lock`.
- Node deps live in `osprey_ui/package.json`; add with `npm install --save <pkg>` and commit the updated `osprey_ui/package-lock.json`.
- Node deps live in `osprey_ui/package.json`; add with `pnpm add <pkg>` and commit the updated `osprey_ui/pnpm-lock.yaml`. The lockfile is the parity contract — `pnpm add` will re-resolve transitives, so review the `pnpm-lock.yaml` diff for unintended version bumps before committing.
- Rust deps live in `osprey_coordinator/Cargo.toml`. Note: `Cargo.lock` is currently in `.gitignore` — do not commit it without first un-ignoring it.
- Every new or upgraded package including transitive dependencies requires human approval. Confirm the license is compatible with `LICENSE.md` and that there are no known CVEs.
- `fawltydeps` enforces that every declared Python dep is used; add intentional exceptions to `[tool.fawltydeps].ignore_unused` in `pyproject.toml` with a comment.
Expand All @@ -202,5 +202,5 @@ Stop and get explicit human approval before:

- Changing license headers, copyright notices, or any legal text (including `LICENSE.md`).
- Modifying release, signing, or deploy workflows: `.github/workflows/publish-coordinator-image.yml`, `.github/workflows/release-osprey-rpc.yml`, `.github/workflows/mdbook.yml`, production Dockerfiles (`osprey_coordinator/Dockerfile`, `osprey_worker/Dockerfile`, `osprey_ui/Dockerfile`), `docker-compose.yaml`, `start.sh`, or `entrypoint.sh`.
- Adding, removing, or upgrading any library or package (including transitive dependencies in `uv.lock` or `osprey_ui/package-lock.json`) — confirm licenses are compatible.
- Adding, removing, or upgrading any library or package (including transitive dependencies in `uv.lock` or `osprey_ui/pnpm-lock.yaml`) — confirm licenses are compatible.
- Editing generated code under `osprey_rpc/src/osprey/rpc/` by hand instead of regenerating via `./gen-protos.sh`.
2 changes: 1 addition & 1 deletion docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This guide provides comprehensive instructions for setting up a development envi
- **[Python](https://www.python.org/) 3.11 or higher** (check with `python --version`)
- **[Git](https://git-scm.com/)** for version control
- **[uv](https://docs.astral.sh/uv/)** for Python package management
- **[npm](https://nodejs.org/en/download)**
- **[Node.js](https://nodejs.org/en/download/) 18+** for the UI (Corepack ships with Node and auto-resolves pnpm from `osprey_ui/package.json`'s `packageManager` field — no separate pnpm install needed)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is corepack what we want? im unfamiliar with it, though it does seem useful from my brief understanding


## Project Setup

Expand Down
4 changes: 2 additions & 2 deletions docs/UI.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

```bash
cd osprey_ui
npm install
npm start
pnpm install --frozen-lockfile
pnpm start
```

The Osprey UI has several pages accessible by a left-hand menu:
Expand Down
8 changes: 7 additions & 1 deletion osprey_ui/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
legacy-peer-deps=true
auto-install-peers=true
strict-peer-dependencies=false
# hoisted layout: TypeScript needs a single cytoscape module identity.
# The default isolated layout exposes both cytoscape's bundled types and
# the older @types/cytoscape (pulled in by @types/cytoscape-dagre) and the
# two definitions collide at compile time.
node-linker=hoisted
8 changes: 5 additions & 3 deletions osprey_ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ FROM node:18-alpine

WORKDIR /app

COPY osprey_ui/package.json osprey_ui/package-lock.json* ./
COPY osprey_ui/package.json osprey_ui/pnpm-lock.yaml osprey_ui/.npmrc ./

RUN npm install --legacy-peer-deps
RUN npm install -g corepack@latest && corepack enable

RUN pnpm install --frozen-lockfile

COPY osprey_ui/ .

EXPOSE 5002

CMD ["npm", "start"]
CMD ["pnpm", "start"]
6 changes: 3 additions & 3 deletions osprey_ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Prerequisites

- Node.js (version 16+ recommended)
- npm package manager
- pnpm (via Corepack — auto-resolved from the `packageManager` field in `package.json`; no separate install needed once Node.js 18+ is on the host)
- Docker (for backend services)

## Purpose
Expand Down Expand Up @@ -36,13 +36,13 @@ This starts all required backend services including Kafka, PostgreSQL, Druid, an

```bash
cd osprey_ui
npm install
pnpm install --frozen-lockfile
```

3. **Start Development Server**

```bash
npm start
pnpm start
```

The UI will be available at **http://localhost:5002** unless otherwise specified, and will automatically connect to the backend services running in Docker containers.
Expand Down
Loading
Loading