# FedM8 — work directive (1099)

**https://hi.fedm8.com** · version **2** · 2026-08-06 · re-fetch; don't trust a paste.

You are here to **get FedM8 work done**. Attach this URL **once**. After that, the human only needs to name the task. Company claims, portal handovers, and **billables stay on the JBNX stack** (`projects.jbnx.io` → `bill.jbnx.io`).

Four rules matter:

1. **Respect claims** — one live lease per project slug (`fedm8`).
2. **Update the portal via the API** — status / close-out, not by rewriting marketing HTML for product status.
3. **Track token usage on every ask** — record it, show it at the end of the chat reply, and attach the same numbers to the portal status/handover.
4. **Every run is customer-billable — once.** Your claim opens **one** billable work session on **bill.jbnx.io**; status/close-out `--done` updates that same receipt; release stops the clock. Never work unclaimed; never walk away without release; **never post a second billable for the same claim.**

Everything else is in service of those four.

- `AGENT_API_BASE=https://projects.jbnx.io`
- Models (FedM8): `https://llm.fedm8.com/v1`
- Product: `https://ai.fedm8.com`
- **No X-Agent-Gate.** `/api/1099/*` is ungated and rate-limited.
- Helper: `projects-portal/scripts/agent.sh` (canonical) · `./scripts/agent.sh` when present  
  (`sign-in` · `claim` · `boot` · `brief` · `facts` · `usage` · `ai-os` · `renew`/`rn` · `status`/`st` · `release` · `free` · `held` · `whoami` · `next` · `doctor`)

---

## FedM8 stack (use these, not jbnx product hosts)

| What | Value |
|---|---|
| Marketing | https://ai.fedm8.com/ |
| Tools | https://ai.fedm8.com/app.html |
| Academy | https://ai.fedm8.com/learn.html |
| Features by plan | https://ai.fedm8.com/features-by-tier.html |
| Compare | https://ai.fedm8.com/compare.html |
| Ship board | https://ai.fedm8.com/features.html |
| Hub (internal) | https://ai.fedm8.com/hub/ · `hub.fedm8.com` when DNS live |
| This directive | https://hi.fedm8.com · `/hi/` on Pages until DNS |
| LiteLLM | https://llm.fedm8.com/v1 (aliases `cheap` / `standard` / `frontier`) |
| scan-worker | https://scan-worker-production-6648.up.railway.app |
| AI health | `GET …/ai/health` → `litellm_base: "https://llm.fedm8.com/v1"` |
| Billing health | `GET …/billing/health` |
| Supabase | project `oeohvlajtexuxjfrtcdb` |
| Repo | https://github.com/jbnx/fedm8-scan |
| Portal project slug | **`fedm8`** |
| Claims / handover API | https://projects.jbnx.io/api/1099/* |
| Billables | **bill.jbnx.io** (automatic via claim → release — do not double-post) |

Worker env for models: `LITELLM_BASE=https://llm.fedm8.com/v1`, `LITELLM_API_KEY` = LiteLLM master key. Never put LLM keys in the browser.

---

## How the company portal works (still projects.jbnx.io)

https://projects.jbnx.io is the company command center. FedM8 product HTML is **not** the source of truth for agent handovers.

| Surface | What it is |
|---|---|
| `#/p/fedm8` | FedM8 project page — handover BLUF, usage, next |
| `#/` home | RAD lifecycle board |
| `/api/1099/*` | Claim / status / close-out / usage / release |

Agent ↔ portal contract:

1. Claim **`fedm8`** before product work on this repo.
2. `boot` / `brief` loads handover + top facts (≤2k). Do not re-paste this whole page every turn.
3. Product status lives in portal handovers + repo `HANDOVER.md` — never by rewriting `index.html` as the only status.
4. Publish feature board via `node portal/publish-features.cjs` (claims `fedm8`, close-out, release).

Catalog: `GET /api/1099/help` · Who’s free: `GET /api/1099/board?free=1` · Contract: `GET /api/1099/ai-os`

---

## Token usage (always)

On **every** completed ask / turn that used a model:

1. **Record** via API / helper:  
   `./scripts/agent.sh usage --engine cursor --model <model> --in <n> --out <n> [--slug fedm8]`  
   or `POST /api/1099/record-usage`
2. **Show** at the end of the chat reply:  
   `Token usage: in=… out=… model=… · recorded`
3. **Attach** the same line to `status` / `close-out`.

Gateway agents calling FedM8 product AI should prefer **`llm.fedm8.com`**. Portal metering still goes through the 1099 usage API.

Silent $0 is a defect.

---

## Billable time (always) — bill.jbnx.io

Customers pay for AI work by the hour at **bill.jbnx.io**. Recording is **automatic through the portal claim loop** — do not skip, and **do not double-post**.

1. **`claim` starts the clock** — one session in `billing.work_sessions`.
2. **`status` / `close-out` updates that same receipt** — `--done` is customer-facing plain language.
3. **`release` stops the clock** — claim→release is what gets billed.
4. **Never also call** `POST https://bill.jbnx.io/api/agent/work-start` / `work-end` when you claimed via the portal.
5. **One claim → one session → one release.**

A run with no billable session is a defect. Duplicate billables are also a defect.

---

## Token health (always)

| in:out | Band | Action |
|---|---|---|
| < 5:1 | Healthy | keep going |
| 5–10:1 | Good | keep going |
| 10–15:1 | Neutral | finish the task |
| 15–20:1 | Degrading | cycle at next boundary |
| > 20:1 | Unhealthy | cycle NOW |

Append after the usage line: `Token health: 15:1 · Degrading → cycle at the next task boundary`

---

## Default loop (every FedM8 job)

```bash
./scripts/agent.sh sign-in
./scripts/agent.sh claim fedm8 "what you'll do"
./scripts/agent.sh boot                 # Compiled Brief ≤2k
# …work in jbnx/fedm8-scan; models via llm.fedm8.com when calling FedM8 AI…
# verify live ai.fedm8.com / worker health — then:
./scripts/agent.sh usage --engine … --model … --in … --out … --slug fedm8
./scripts/agent.sh status --state "…" --next "…" --done "…" --tokens-in … --tokens-out … --model …
./scripts/agent.sh release "done"
```

Prefer `boot` over re-pasting this directive every turn.

Ship path: PR on `fedm8-scan` → verify → present in chat → chat approve → merge. After merge, confirm GitHub Pages / Railway as needed. Do **not** ask the human to click Approve on GitHub.

---

## FedM8 product honesty (do not break)

- USAspending publishes **awardees**, not losers — never invent win/loss.
- Public Basic/Pro/Pro+AI = Stripe Checkout after sign-in (`BILLING_ENABLED=true`).
- Consulting invoices stay **off** the website.
- FedM8 AI is **read-only** (whitelist tools; cite-or-blank).
- Academy lessons stay on `learn.html` — not buried in tool UIs.
- Voice scripts (`_internal/VOICE_SCRIPTS.md`) are internal only.

---

## Verify before you call it done

1. Hit live URLs you changed (`ai.fedm8.com/…`, worker `/ai/health`, `/billing/health`).
2. If you shipped Pages HTML: confirm the live document shows the new content (not only git).
3. If you changed worker AI: `litellm_base` must be `https://llm.fedm8.com/v1`.
4. Record usage + portal status, then release.

---

## Don’t

- Use `llm.jbnx.io` for FedM8 product AI — use **`llm.fedm8.com`**.
- Call `/api/1099/*` on hi.fedm8.com — use **projects.jbnx.io**.
- Skip billables, double-post billables, or work without claiming `fedm8`.
- Invent win/loss, FedRAMP stickers, or “full SLED ingest” claims.
- Paste secrets into chats or commits.
- Auto-merge to production without chat approve.
- Re-paste this full directive every turn after the first attach — use `boot`.
