diff --git a/docs/FEATURES.md b/docs/FEATURES.md index 5c4cd53..355e705 100644 --- a/docs/FEATURES.md +++ b/docs/FEATURES.md @@ -124,7 +124,7 @@ fails the verb instead of going unchecked. - `foundry-init.sh` — one-shot repo scaffold. - `setup-labels.sh` — create the GitHub labels the workflows + ticket state machine need (agent:ready/working/blocked, align, ruleset-change, autofix). Idempotent; run by `foundry-init`. - `foundry-pr-report` - one-shot, non-blocking PR check reporter: prints the bucket verdict for a PR's checks and, on failure, dumps the failing steps' logs via `gh run view --log-failed`; exits 0 (all passed/skipped), 1 (a check failed), or 2 (still pending). Trigger-agnostic by design, so a PR-authoring agent gets the actual failure text looped back without a blocking watch: call it once CI has finished, from whatever async trigger you wire up (a local post-push hook, a webhook-fired routine, or a background task that resumes the session). Needs `gh`. -- `jev/` — the **advisory** Jev layer: `client.mjs` (provider port lifted from jev-triage), `route.mjs` (pure routing/triage core), and `review.mjs` (runnable review pre-filter: `node scripts/jev/review.mjs [baseRef]` prints per-file `{review, lens, reason}` routing JSON). Near-free System-One decisions on the **proposer** side only: which diff hunks warrant deep review and on which lens. Opt-in via `JEV_API_KEY` (+ `JEV_PROVIDER`/`JEV_MODEL`/`TYPESAFE_AI_BASE_URL`); absent key ⇒ every caller fails open to current behavior (review all). **Never in the deterministic gate** — `boundary.test.mjs` reds the build if a gate workflow or mise verb references it; the `jev-scripts.yml` workflow runs the suite (`node --test scripts/jev/*.test.mjs`) on change. +- `jev/` — the **advisory** Jev layer: `client.mjs` (provider port lifted from jev-triage), `route.mjs` (pure routing/triage core), and `review.mjs` (runnable review pre-filter: `node scripts/jev/review.mjs [baseRef]` prints per-file `{review, lens, reason}` routing JSON). Near-free System-One decisions on the **proposer** side only: which diff hunks warrant deep review and on which lens. Opt-in via `JEV_API_KEY` (+ `JEV_PROVIDER`/`JEV_MODEL`/`TYPESAFE_AI_BASE_URL`); absent key ⇒ every caller fails open to current behavior (review all). **Never in the deterministic gate** — `boundary.test.mjs` reds the build if a gate workflow or mise verb references it; the `jev-scripts.yml` workflow runs the suite (`node --test scripts/jev/*.test.mjs`) on change. The non-secret knobs have a commented home in every mise template's `[env]` block (the "Jev (advisory layer)" group: `JEV_PROVIDER`, `JEV_MODEL`, `TYPESAFE_AI_BASE_URL`, `JEV_REVIEW_MIN_FILES`, and the downstream `JEV_TOOLCALL_TRIAGE` / `JEV_FEATURE_PRECHECK` hook toggles); the key itself stays in the shell, never in committed config. ## Agent half — `cmaintz-skills` diff --git a/mise/dotnet.toml b/mise/dotnet.toml index f6caa38..a668fee 100644 --- a/mise/dotnet.toml +++ b/mise/dotnet.toml @@ -26,6 +26,24 @@ _.path = [ "{{config_root}}/scripts", ] +# -- Jev (advisory layer; opt-in, OFF unless set) -------------------------- +# Foundry's near-free System One layer (see docs/FEATURES.md, the "jev/" entry): +# it only routes review and triages turns on the proposer side, never the gate. +# All of it stays off unless a key is present, so this whole block is optional. +# +# The key is NEVER committed: export JEV_API_KEY in your shell, not here. The +# lines below are the safe, non-secret knobs at their defaults; uncomment to +# change one. mise [env] reaches only processes under `mise run`/`mise exec` or +# a mise-activated shell, so a Claude Code hook sees these only when the editor +# was launched from such a shell. +# +# JEV_PROVIDER = "typesafe" # or "cloudflare" (then set CLOUDFLARE_ACCOUNT_ID) +# JEV_MODEL = "jev-latest" # pin to a version to freeze behavior +# TYPESAFE_AI_BASE_URL = "https://api.typesafe.ai/v1" # a self-host, proxy, or mock +# JEV_REVIEW_MIN_FILES = "0" # skip review routing on diffs at or under N files +# JEV_TOOLCALL_TRIAGE = "0" # 1 warns on risky tool calls (repos with that hook) +# JEV_FEATURE_PRECHECK = "0" # 1 pre-checks a feature ticket (repos with that hook) + [hooks] # Provision the pinned habit-hooks on `mise install` (local and CI alike), like setup:pmd. postinstall = "mise run setup:habit-hooks" diff --git a/mise/java.toml b/mise/java.toml index 70b071b..65f1117 100644 --- a/mise/java.toml +++ b/mise/java.toml @@ -47,6 +47,24 @@ _.path = [ # Gitignore `.foundry/`. Read it with `foundry-loop-report`. foundry-init installs the wrapper. FOUNDRY_TELEMETRY = "{{config_root}}/.foundry/telemetry.jsonl" +# -- Jev (advisory layer; opt-in, OFF unless set) -------------------------- +# Foundry's near-free System One layer (see docs/FEATURES.md, the "jev/" entry): +# it only routes review and triages turns on the proposer side, never the gate. +# All of it stays off unless a key is present, so this whole block is optional. +# +# The key is NEVER committed: export JEV_API_KEY in your shell, not here. The +# lines below are the safe, non-secret knobs at their defaults; uncomment to +# change one. mise [env] reaches only processes under `mise run`/`mise exec` or +# a mise-activated shell, so a Claude Code hook sees these only when the editor +# was launched from such a shell. +# +# JEV_PROVIDER = "typesafe" # or "cloudflare" (then set CLOUDFLARE_ACCOUNT_ID) +# JEV_MODEL = "jev-latest" # pin to a version to freeze behavior +# TYPESAFE_AI_BASE_URL = "https://api.typesafe.ai/v1" # a self-host, proxy, or mock +# JEV_REVIEW_MIN_FILES = "0" # skip review routing on diffs at or under N files +# JEV_TOOLCALL_TRIAGE = "0" # 1 warns on risky tool calls (repos with that hook) +# JEV_FEATURE_PRECHECK = "0" # 1 pre-checks a feature ticket (repos with that hook) + [hooks] # Provision both pinned tools on `mise install` (local and CI alike). Array form runs # them in order; each no-ops on a warm install. diff --git a/mise/kotlin.toml b/mise/kotlin.toml index cef08fb..1371b56 100644 --- a/mise/kotlin.toml +++ b/mise/kotlin.toml @@ -5,6 +5,25 @@ [tools] java = "21" # Kotlin compiles on the JVM; pin to what the repo targets +[env] +# -- Jev (advisory layer; opt-in, OFF unless set) -------------------------- +# Foundry's near-free System One layer (see docs/FEATURES.md, the "jev/" entry): +# it only routes review and triages turns on the proposer side, never the gate. +# All of it stays off unless a key is present, so this whole block is optional. +# +# The key is NEVER committed: export JEV_API_KEY in your shell, not here. The +# lines below are the safe, non-secret knobs at their defaults; uncomment to +# change one. mise [env] reaches only processes under `mise run`/`mise exec` or +# a mise-activated shell, so a Claude Code hook sees these only when the editor +# was launched from such a shell. +# +# JEV_PROVIDER = "typesafe" # or "cloudflare" (then set CLOUDFLARE_ACCOUNT_ID) +# JEV_MODEL = "jev-latest" # pin to a version to freeze behavior +# TYPESAFE_AI_BASE_URL = "https://api.typesafe.ai/v1" # a self-host, proxy, or mock +# JEV_REVIEW_MIN_FILES = "0" # skip review routing on diffs at or under N files +# JEV_TOOLCALL_TRIAGE = "0" # 1 warns on risky tool calls (repos with that hook) +# JEV_FEATURE_PRECHECK = "0" # 1 pre-checks a feature ticket (repos with that hook) + [tasks.fix] description = "Auto-format (ktlint)" run = "./gradlew ktlintFormat" diff --git a/mise/php.toml b/mise/php.toml index 6efe558..4002ea2 100644 --- a/mise/php.toml +++ b/mise/php.toml @@ -21,6 +21,24 @@ _.path = [ "{{config_root}}/scripts", ] +# -- Jev (advisory layer; opt-in, OFF unless set) -------------------------- +# Foundry's near-free System One layer (see docs/FEATURES.md, the "jev/" entry): +# it only routes review and triages turns on the proposer side, never the gate. +# All of it stays off unless a key is present, so this whole block is optional. +# +# The key is NEVER committed: export JEV_API_KEY in your shell, not here. The +# lines below are the safe, non-secret knobs at their defaults; uncomment to +# change one. mise [env] reaches only processes under `mise run`/`mise exec` or +# a mise-activated shell, so a Claude Code hook sees these only when the editor +# was launched from such a shell. +# +# JEV_PROVIDER = "typesafe" # or "cloudflare" (then set CLOUDFLARE_ACCOUNT_ID) +# JEV_MODEL = "jev-latest" # pin to a version to freeze behavior +# TYPESAFE_AI_BASE_URL = "https://api.typesafe.ai/v1" # a self-host, proxy, or mock +# JEV_REVIEW_MIN_FILES = "0" # skip review routing on diffs at or under N files +# JEV_TOOLCALL_TRIAGE = "0" # 1 warns on risky tool calls (repos with that hook) +# JEV_FEATURE_PRECHECK = "0" # 1 pre-checks a feature ticket (repos with that hook) + [hooks] # Provision the pinned habit-hooks on `mise install` (local and CI alike), like setup:pmd. postinstall = "mise run setup:habit-hooks" diff --git a/mise/python.toml b/mise/python.toml index 0623cb9..a5c0f87 100644 --- a/mise/python.toml +++ b/mise/python.toml @@ -53,6 +53,24 @@ _.path = [ # Read it with `foundry-loop-report`. foundry-init installs the wrapper. FOUNDRY_TELEMETRY = "{{config_root}}/.foundry/telemetry.jsonl" +# -- Jev (advisory layer; opt-in, OFF unless set) -------------------------- +# Foundry's near-free System One layer (see docs/FEATURES.md, the "jev/" entry): +# it only routes review and triages turns on the proposer side, never the gate. +# All of it stays off unless a key is present, so this whole block is optional. +# +# The key is NEVER committed: export JEV_API_KEY in your shell, not here. The +# lines below are the safe, non-secret knobs at their defaults; uncomment to +# change one. mise [env] reaches only processes under `mise run`/`mise exec` or +# a mise-activated shell, so a Claude Code hook sees these only when the editor +# was launched from such a shell. +# +# JEV_PROVIDER = "typesafe" # or "cloudflare" (then set CLOUDFLARE_ACCOUNT_ID) +# JEV_MODEL = "jev-latest" # pin to a version to freeze behavior +# TYPESAFE_AI_BASE_URL = "https://api.typesafe.ai/v1" # a self-host, proxy, or mock +# JEV_REVIEW_MIN_FILES = "0" # skip review routing on diffs at or under N files +# JEV_TOOLCALL_TRIAGE = "0" # 1 warns on risky tool calls (repos with that hook) +# JEV_FEATURE_PRECHECK = "0" # 1 pre-checks a feature ticket (repos with that hook) + [hooks] # Two provisioning tasks on `mise install` (local and CI alike): the project .venv tools # and the pinned habit-hooks venv - the array form the java template uses for setup:pmd. diff --git a/mise/ts.toml b/mise/ts.toml index 832cfcd..8157251 100644 --- a/mise/ts.toml +++ b/mise/ts.toml @@ -45,6 +45,24 @@ FOUNDRY_TELEMETRY = "{{config_root}}/.foundry/telemetry.jsonl" # See designs/changed-scope-gate.md. An unresolvable ref falls back to whole-tree # (never skips). The signal is opt-in per verb; callers MUST NOT require it. +# -- Jev (advisory layer; opt-in, OFF unless set) -------------------------- +# Foundry's near-free System One layer (see docs/FEATURES.md, the "jev/" entry): +# it only routes review and triages turns on the proposer side, never the gate. +# All of it stays off unless a key is present, so this whole block is optional. +# +# The key is NEVER committed: export JEV_API_KEY in your shell, not here. The +# lines below are the safe, non-secret knobs at their defaults; uncomment to +# change one. mise [env] reaches only processes under `mise run`/`mise exec` or +# a mise-activated shell, so a Claude Code hook sees these only when the editor +# was launched from such a shell. +# +# JEV_PROVIDER = "typesafe" # or "cloudflare" (then set CLOUDFLARE_ACCOUNT_ID) +# JEV_MODEL = "jev-latest" # pin to a version to freeze behavior +# TYPESAFE_AI_BASE_URL = "https://api.typesafe.ai/v1" # a self-host, proxy, or mock +# JEV_REVIEW_MIN_FILES = "0" # skip review routing on diffs at or under N files +# JEV_TOOLCALL_TRIAGE = "0" # 1 warns on risky tool calls (repos with that hook) +# JEV_FEATURE_PRECHECK = "0" # 1 pre-checks a feature ticket (repos with that hook) + [hooks] # Provision the pinned habit-hooks on `mise install` (local and CI alike), like setup:pmd. postinstall = "mise run setup:habit-hooks" diff --git a/scripts/jev/README.md b/scripts/jev/README.md index 0e956bf..ed624b2 100644 --- a/scripts/jev/README.md +++ b/scripts/jev/README.md @@ -53,7 +53,15 @@ min-files gate) routes every file to review - Jev only ever narrows spend, never Read from the environment (keys never in CI): `JEV_API_KEY`, `JEV_PROVIDER` (`typesafe` | `cloudflare`), `JEV_MODEL` (defaults to `jev-latest`), `CLOUDFLARE_ACCOUNT_ID`, and `TYPESAFE_AI_BASE_URL` -(point the direct call at a self-host, proxy, or mock). +(point the direct call at a self-host, proxy, or mock). `review.mjs` also reads +`JEV_REVIEW_MIN_FILES`. + +The non-secret knobs have a commented, opt-in home in each mise template's +`[env]` block (the "Jev (advisory layer)" group), so a repo centralizes them in +one place instead of scattering exports. Note the reach: a mise `[env]` value +only lands in processes started via `mise run` / `mise exec` or a mise-activated +shell, so a Claude Code hook picks it up only when the editor was launched from +such a shell. The key is never committed; export `JEV_API_KEY` in the shell. ## Tests