Funnel: token config + plan-from workspace autodiscovery — the idiot-proof guide
Everything a human needs to make the funnel fire on this box: how funnel plan-from finds your workspace, and exactly where to put the Claude (Anthropic) token so the LLM planner/executor + the 🤖 Claude tab work. Both degrade gracefully — offline modes exist and the human-facing errors point right back here.
1. funnel plan-from <idea-id> — how the workspace is discovered
plan-from turns a funnel idea into a plan-DAG: it builds the cross-repo dependency graph, classifies the idea → component(s), computes the affected set, and weaves one node per affected component. To build the graph it must find the workspace's nornir-workspace.toml descriptor.
Resolution order (first hit wins)
The descriptor is resolved by mimir::resolve_descriptor_at(workspace_root, config_path) — the SAME resolver submit/idea/mimir use, so every funnel verb agrees:
$NORNIR_WORKSPACE— an explicit pin. May be the descriptor file (…/nornir-workspace.toml) OR a directory holding it. Always wins.<workspace_root>/nornir-workspace.toml<workspace_root>/workspace_holger/nornir-workspace.toml(legacy holger).<workspace_dir>/nornir-workspace.toml— theworkspace_*/dir itself, i.e. the grandparent of aworkspace_<name>/release/nornir.tomlconfig.<config_dir>/nornir-workspace.toml(next torelease/nornir.toml).
The bug this fixes
Standing in git/workspace_nordisk, config::discover sets workspace_root = git/ and config_path = workspace_nordisk/release/nornir.toml. The descriptor lives at workspace_nordisk/nornir-workspace.toml — the config's grandparent. The old list only searched git/, workspace_holger/, and release/, so plan-from failed with "no nornir-workspace.toml found" even though the file was right there. Candidate #4 (and the $NORNIR_WORKSPACE pin #1) close that gap for any workspace name, not just workspace_holger.
Prove it end-to-end
cd git/workspace_nordisk
nornir funnel idea "add a dark theme toggle" # → i-042
nornir funnel plan-from i-042 # builds the graph, derives the plan
nornir funnel show # displays the plan p-NNN + its nodes
--dry-run prints the derived plan without writing it; --component <name> skips classification and targets a component directly (handy when the local LLM isn't running). If a workspace member is git-sourced and not yet cloned locally, the graph build asks you to bootstrap that checkout — that is a workspace provisioning step, separate from descriptor discovery. On a box with local checkouts, pin a path=-member descriptor via $NORNIR_WORKSPACE.
2. Where to put the Claude (Anthropic) token
The LLM planner (funnel prompt --llm), funnel decompose, the funnel run executor (claude: generator backend), and the 🤖 Claude tab all talk to the Anthropic Messages API through ONE client (viz::claude). They resolve the key from a single chain — first non-blank wins:
| # | Source | Put it here |
| 1 | env ANTHROPIC_API_KEY |
export ANTHROPIC_API_KEY=sk-ant-… (best for CI / headless / systemd Environment=) |
| 2 | file ~/.nornir/anthropic-key |
printf '%s' sk-ant-… > ~/.nornir/anthropic-key && chmod 600 ~/.nornir/anthropic-key (durable; survives restarts) |
| 3 | 🤖 Claude tab session token | paste sk-ant-… into the tab's field — held in memory for that session only, never written to disk |
Do NOT reuse ~/.nornir/token for this — that file is the nornir-server bearer token (a different secret). The Anthropic key has its own file, ~/.nornir/anthropic-key, so the two are never conflated.
Quick setup (the durable way)
umask 077
printf '%s' 'sk-ant-YOURKEYHERE' > ~/.nornir/anthropic-key
chmod 600 ~/.nornir/anthropic-key # 0600 — owner-only
# verify (should print a plan, not a "no key" hint):
nornir funnel prompt --llm i-042
Graceful degradation (no token present)
The funnel never panics when the key is absent — it degrades:
plan-fromalready runs offline: it offers the local LLM (Ollama) and falls through to the embedder → pick-list. No Anthropic key needed at all.decompose/runaccept amock/local--gen <spec>backend for offline work; only theclaude:backend needs the key.- The 🤖 Claude tab shows "No key in ANTHROPIC_API_KEY or ~/.nornir/anthropic-key — paste a token…" and offers the session field.
- Any Anthropic call with no key resolves to a clear, actionable message that names all three locations above — never a crash.
3. The plan-DAG grows
Once a plan exists, the 🗂 Plan-DAG view (metric-bearing facett-plandag) renders every node and grows as nodes are added. On dwarf the funnel panel (dwarves/crates/nornir-funnel-embed) auto-polls Funnel.Show on an interval, so the DAG grows on its own as ideas land — no manual refresh. Coverage:
nornirrobot scenariorobot_funnel_plandag_grows_as_nodes_land(tests/robot_funnel_journey.rs) — drives the real 🗂 Funnel tab, runs the demo, toggles Plan-DAG, assertsnode_countgrows 0 → N through the live render (+ onenornir-testmatrixcellfunnel-plandag).nornir-funnel-embedunitplandag_grows_as_nodes_land— successiveFunnel.Showpolls with more nodes reconstruct into a strictly larger DAG (+ atestmatrixcell).
See also
- funnel-executor.md — the two Claude roles (planner vs executor).
- funnel-prompt-planner-spec.md — the prompt planner.
- local-llm-setup.md — running from a local, on-prem LLM instead.