Skip to content
Merged
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
75 changes: 75 additions & 0 deletions .github/workflows/deploy-landing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy landing

on:
push:
branches: [main, develop]
paths:
- "packages/mimir-landing/**"
- ".github/workflows/deploy-landing.yml"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: deploy-landing-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
name: Build and deploy landing
runs-on: ubuntu-latest
environment:
name: ${{ github.ref == 'refs/heads/main' && 'landing-production' || 'landing-staging' }}
url: ${{ github.ref == 'refs/heads/main' && 'https://mimir.jcode.works' || 'https://staging.mimir.jcode.works' }}
defaults:
run:
working-directory: packages/mimir-landing
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Install mise
run: |
curl https://mise.run | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH"

- name: Install pinned Node via mise
run: mise install
working-directory: .

- name: Set up pnpm
run: |
corepack enable
corepack prepare pnpm@11.9.0 --activate

- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: .

- name: Build (production)
if: github.ref == 'refs/heads/main'
run: pnpm build
env:
PUBLIC_MIMIR_LANDING_URL: https://mimir.jcode.works

- name: Deploy (production)
if: github.ref == 'refs/heads/main'
run: pnpm exec wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

- name: Build (staging, not indexed)
if: github.ref == 'refs/heads/develop'
run: pnpm build
env:
PUBLIC_MIMIR_LANDING_URL: https://staging.mimir.jcode.works

- name: Deploy (staging)
if: github.ref == 'refs/heads/develop'
run: pnpm exec wrangler deploy --env staging
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
37 changes: 32 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@
`excludeFolders`/`excludeFiles` in sync with new generated-output or private-data directories.
Registering the repo on context7.com (so it resolves through `resolve-library-id`) is a manual
step on their site; these files only prepare the repo for that step.
- The bundled `mimir` skill is directly installable from this monorepo's nested path with the
[skills.sh](https://skills.sh) CLI (`npx skills add <repo-url>/tree/main/packages/mimir-core/skills/mimir`),
since that CLI supports a direct subdirectory path. If `packages/mimir-core/skills/` moves, update
the command documented in the README's "Agent Skills And MCP" section.
- `packages/mimir-ui` is the shared UI/style foundation adapted from the WorkoutGen landing/UI
approach. It provides the common Tailwind theme and React primitives for both the landing and the
Tauri app; do not import WorkoutGen product copy, assets, analytics, or secrets.
Expand Down Expand Up @@ -179,12 +175,21 @@
with `mise.toml` by hand. pnpm stays pinned via Corepack through `packageManager` in
`package.json`, not duplicated in `mise.toml`. Keep mise scoped to toolchain-version pinning —
it is not a package manager or task runner here, so don't mirror `package.json` scripts as mise
tasks; that would just create a second source of truth for no benefit.
tasks and don't wrap launch scripts (`dev:app`, `dev:landing`, `example`) in `mise exec`; that
would create a second source of truth and break the "plain pnpm works without mise" onboarding
path. For local dev, contributors activate mise in their shell (`mise activate`) so the pinned
Node/Rust land on `PATH` via shims and every `pnpm` script uses the CI toolchain automatically.
- Keep Mimir core free of Ollama. `embeddingProvider: "local-hash"` supports ingestion, search, MCP,
and cited retrieval without a model server, but it must not be described as equivalent to semantic
retrieval. `embeddingProvider: "transformers"` is the optional semantic embedding path.
- Keep `packages/mimir-core/examples/sovereign-rag-demo` synthetic and safe to commit. It exists for
package/user testing only; never place real confidential documents there.
- `packages/mimir-core/examples/library-api-demo` is the local library-API smoke (`pnpm example`). It
`import`s `@jcode.labs/mimir` via Node self-referencing so it always exercises the local
`packages/mimir-core/dist` build, never the npm-published package, and it reuses the
`sovereign-rag-demo` synthetic corpus rather than adding a second one. Testing local changes must
use this local build (or `node packages/mimir-core/dist/cli.js`), not `npx mimir`, which would
resolve the released npm version.
- Use Context7 before changing dependencies or public APIs that rely on external libraries.
- Run `pnpm validate` before opening a release pull request or publishing. It covers
Biome, dependency security audit, TypeScript, Vitest, build output, production CLI/MCP smoke
Expand All @@ -196,6 +201,28 @@
- Use Git Flow locally: `main` is production, `develop` is integration, feature work starts from
`develop` under `feature/*`. Do not deploy or publish from feature branches.

## AI Coding Agent Guardrails

These rules are binding for every AI coding agent working in this repository (Claude Code, Codex, and
any other), because several agents may run against this repo in parallel.

- **Never create, rename, delete, switch, or reset Git branches on your own.** Ask the user for
explicit confirmation first, and state the exact branch name and base you intend to use. A
high-level task is not blanket permission to spawn branches — confirm the branch itself.
- **Always follow the repository Git Flow.** `main` is production and `develop` is integration; both
are protected and only change through a pull request with green required checks (Quality gate,
Commitlint, Analyze TypeScript). Start work from `develop` under `feature/*` (fixes `fix/*`, chores
`chore/*`), open a PR into `develop`, and promote `develop` to `main` with a release PR. Never
commit or push directly to `main` or `develop`, and never force-push either branch.
- **Do not open or merge pull requests, or trigger a release / npm publish, without explicit
confirmation.** The protected `Release npm` workflow and its `npm-publish` environment approval are
the only publish path.
- **Reuse the branch or PR the user already approved instead of creating new ones.** Do not
proliferate short-lived branches; when a temporary branch is genuinely required (for example a
protected-branch back-merge), name it clearly and delete it once merged.
- **Respect other agents' work.** Before editing, run `git status` and check for other running agents
or processes; never stage, commit, or discard uncommitted changes you did not make.

## Coding Conventions

General principles (KISS, DRY, YAGNI, SOLID) as applied in this codebase. Match the surrounding style.
Expand Down
10 changes: 10 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
high-level architecture. Read it first. This file adds only the Claude Code operational details and
non-obvious traps that matter when editing here, without duplicating `AGENTS.md`.

## Branches, PRs, and releases — confirm first

Never create, rename, switch, or reset a branch, open or merge a PR, or trigger a release / npm
publish on your own. Ask for explicit confirmation (naming the exact branch and base), and follow the
Git Flow in `AGENTS.md`: `feature/*` off `develop`, PR into `develop`, release PR `develop` → `main`.
`main` and `develop` are protected (PR + green Quality gate, Commitlint, Analyze TypeScript). Reuse a
branch the user already approved instead of spawning new ones. Full rules: "AI Coding Agent
Guardrails" in `AGENTS.md`.

## Commands

```bash
Expand All @@ -14,6 +23,7 @@ pnpm build # builds UI, app frontend, landing, TTS, then Mimir Core
pnpm check # typecheck UI/app/landing/TTS/core
pnpm dev:app # run the Vite frontend for the Tauri shell
pnpm dev:landing # run the Astro landing locally
pnpm example # build core + run the library-API smoke against the local build (examples/library-api-demo)
pnpm lint # Biome CI (format + lint check, no writes)
pnpm lint:fix # Biome auto-fix
pnpm format # Biome format --write
Expand Down
133 changes: 133 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
contact@jcode.works.

All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][mozilla coc].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[mozilla coc]: https://github.com/mozilla/diversity
[faq]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@ pnpm validate
`pnpm bootstrap` runs `mise install && pnpm install`. Without mise, any Node.js 20+ and pnpm install
works too — just run `pnpm install` directly.

Activate mise in your shell (`mise activate`, per the
[mise docs](https://mise.jdx.dev/getting-started.html)) so that entering this repository puts the
pinned Node (and Rust) on your `PATH` automatically. Then `pnpm dev:app`, `pnpm dev:landing`, and
`pnpm example` run on the same toolchain as CI without any per-script wiring — mise stays a
version pinner, not a task runner (see `AGENTS.md`).

`pnpm validate` runs Biome, a dependency security audit, TypeScript, Vitest, the production CLI/MCP
smoke test, and npm package metadata checks.

To smoke-test the library API against your local build while developing Mimir Core, run
`pnpm example` (see
[`packages/mimir-core/examples/library-api-demo`](./packages/mimir-core/examples/library-api-demo)).

Run the security audit alone with:

```bash
Expand Down
Loading