jfl 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # JFL - Just Fucking Launch
2
2
 
3
- **The context layer for AI-native teams.**
3
+ [![npm version](https://img.shields.io/npm/v/jfl.svg)](https://www.npmjs.com/package/jfl)
4
4
 
5
- JFL provides persistent context for AI workflows. Agents read what happened in previous sessions, understand decisions made, and access project knowledge — eliminating the cold-start problem where each AI interaction begins from zero.
5
+ **The engineering intelligence platform.**
6
+
7
+ JFL provides persistent context, autonomous agents, and self-driving improvement loops for any project. Agents read past sessions, understand decisions, track eval scores, and propose improvements — all backed by structured files in git.
6
8
 
7
9
  Context lives in git as structured files (markdown, JSONL). Any AI tool can integrate via MCP.
8
10
 
@@ -16,8 +18,9 @@ AI agents are stateless. Each session starts from scratch:
16
18
  - Previous decisions aren't remembered
17
19
  - Work from other sessions isn't visible
18
20
  - Context has to be re-explained every time
21
+ - Agent improvements aren't measured or tracked
19
22
 
20
- JFL provides a shared context layer that accumulates over time and is accessible to any AI tool.
23
+ JFL provides a shared context layer that accumulates over time, measures agent performance, and enables autonomous improvement loops — accessible to any AI tool.
21
24
 
22
25
  ---
23
26
 
@@ -136,11 +139,13 @@ jfl context-hub serve # Run in foreground (daemon mode)
136
139
  | `memory_search` | Search indexed journal memories |
137
140
  | `memory_status` | Memory system statistics |
138
141
  | `memory_add` | Add manual memory entry |
142
+ | `events_publish` | Publish event to MAP event bus |
143
+ | `events_recent` | Get recent events (with pattern filter) |
139
144
  | `query_experiment_history` | Query RL trajectories for agent experiments |
140
145
 
141
146
  **Resilience:** 5-layer system — MCP auto-recovery on ECONNREFUSED, health-check-before-ensure hooks, `ensure-all` for batch startup, `doctor` diagnostics, launchd/systemd daemon with keepalive.
142
147
 
143
- ### Dashboard V2
148
+ ### Dashboard
144
149
 
145
150
  A pre-built Vite + Preact + Tailwind SPA served by Context Hub at `/dashboard/`. Auto-detects workspace type and adapts layout.
146
151
 
@@ -155,11 +160,15 @@ A pre-built Vite + Preact + Tailwind SPA served by Context Hub at `/dashboard/`.
155
160
  | **Flows** | Flow definitions and execution history |
156
161
  | **Health** | System metrics, context sources, memory index, tracked projects |
157
162
  | **Agents** | Eval leaderboards grouped by product domain |
163
+ | **Experiments** | Experiment runs with dot plots — green (improved) / gray (no change) / red (regression) |
164
+ | **Telemetry** | Cost breakdown, command usage, error rates, hub health metrics |
165
+ | **Topology** | Service dependency graph and event flow visualization |
158
166
 
159
167
  **Features:** Sidebar with structured sections (Workspace / Infra / Eval), inline SVG icons, agent leaderboard in sidebar, sparkline charts, real-time polling.
160
168
 
161
169
  ```bash
162
170
  jfl context-hub dashboard # Opens /dashboard/ in browser
171
+ jfl viz dash # Terminal equivalent (no browser needed)
163
172
  ```
164
173
 
165
174
  ### MAP Event Bus
@@ -172,7 +181,7 @@ Metrics, Agents, Pipeline — an in-process event bus inside Context Hub.
172
181
  - **Pattern-matching subscriptions** (glob support)
173
182
  - **Transports:** SSE, WebSocket, HTTP polling
174
183
  - **Cross-product routing** — portfolio flows route events between child GTMs
175
- - **Event types:** `session:started`, `session:ended`, `eval:scored`, `journal:entry`, `flow:triggered`, `agent:iteration-complete`, `portfolio:phone-home`, and more
184
+ - **Event types:** `session:started`, `session:ended`, `eval:scored`, `journal:entry`, `flow:triggered`, `agent:iteration-complete`, `portfolio:phone-home`, `review:findings`, `telemetry:insight`, `peter:pr-proposed`, and more
176
185
 
177
186
  Services emit events by appending to `.jfl/service-events.jsonl` — no auth needed, Context Hub watches the file automatically.
178
187
 
@@ -211,6 +220,58 @@ jfl eval tuples # Extract (state, action, reward) training tuples
211
220
  - `GET /api/eval/leaderboard` — all agents ranked by composite
212
221
  - `GET /api/eval/trajectory?agent=X&metric=composite` — score trajectory with timestamps
213
222
 
223
+ ### Self-Driving Loop
224
+
225
+ The autonomous improvement cycle. Agents detect issues, create fixes, and the system auto-merges if eval scores improve.
226
+
227
+ ```
228
+ Telemetry Agent detects issue
229
+ → telemetry:insight event
230
+ → Flow engine routes to Peter Parker
231
+ → PP creates fix PR (pp/ branch)
232
+ → GitHub Action runs eval + AI review
233
+ → eval:scored event posted to hub
234
+ → Auto-merge if improved / flag if regressed
235
+ → Training tuple logged
236
+ → Cycle repeats
237
+ ```
238
+
239
+ **9 declarative flows** in `.jfl/flows/self-driving.yaml`:
240
+
241
+ | Flow | Trigger | Action |
242
+ |------|---------|--------|
243
+ | `auto-merge-on-improvement` | `eval:scored` (improved) | `gh pr merge` + journal milestone |
244
+ | `flag-regression` | `eval:scored` (regressed) | `gh pr review --request-changes` |
245
+ | `log-training-tuple` | `eval:scored` | Log (state, action, reward) to journal |
246
+ | `log-quality-training-tuple` | `eval:scored` | Enriched tuple with AI quality dimensions |
247
+ | `block-merge-on-blockers` | `review:findings` (red) | `gh pr review --request-changes` |
248
+ | `log-review-training-data` | `review:findings` | Log review results as training data |
249
+ | `pp-address-review-blockers` | `review:findings` (red) | Spawn PP to fix (gated, max 3 iterations) |
250
+ | `insight-triggers-pp` | `telemetry:insight` (high) | Spawn PP to create fix PR |
251
+ | `predict-before-pr` | `peter:pr-proposed` | Run Stratus prediction before acting |
252
+
253
+ **Review gate:** Eval checks for AI review blockers before auto-merging. If the AI review requested changes (red findings), eval holds the merge even if tests improved. PRs must pass both eval AND review to auto-merge.
254
+
255
+ **CI Workflows** that close the loop:
256
+
257
+ - **`jfl-eval.yml`** — Runs on PP pull requests (`pp/` prefix). Checks out main for baseline, runs tests on PR, computes delta, runs AI quality assessment, posts `eval:scored` event to hub, comments on PR with eval results.
258
+ - **`jfl-review.yml`** — Context-aware AI code review on PP PRs. Gathers project context + knowledge docs, reviews diff for bugs/security/architecture, extracts structured findings (red/yellow/blue severity), posts `review:findings` event to hub.
259
+
260
+ ### Stratus Prediction Engine
261
+
262
+ Predict eval score deltas before executing changes using the Stratus world model (JEPA rollout + chat ensemble).
263
+
264
+ ```bash
265
+ jfl predict run --proposal "Fix auth timeout" --goal "improve test pass rate" --type fix --scope small
266
+ jfl predict resolve --id <id> --actual-delta 0.05 --actual-score 0.92 --eval-run <run-id>
267
+ jfl predict accuracy # Direction accuracy, mean delta error, calibration
268
+ jfl predict history # Recent predictions with sparkline trend
269
+ ```
270
+
271
+ **Dual Stratus strategy:**
272
+ - **Rollout API** (`/v1/rollout`) — JEPA world model, ~1.6s, ~$0.001. Fast state prediction for health trajectory.
273
+ - **Chat API** (`/v1/chat/completions`) — Full reasoning, ~28s, ~$0.05. Human-readable insights when patterns detected.
274
+
214
275
  ### RL Infrastructure
215
276
 
216
277
  JFL generalizes the Karpathy nanochat pattern: structured journals are the replay buffer, eval scores are rewards, agents learn in-context from past trajectories.
@@ -221,15 +282,16 @@ Stratus (World Model) > predicts outcomes, filters bad proposals
221
282
  Journals (Replay Buffer) > structured experiment history
222
283
  Eval Framework (Reward) > composite scores, score deltas
223
284
  Event Bus (Nervous System) > connects everything
285
+ Telemetry Agent > autonomous health monitoring + anomaly detection
224
286
  ```
225
287
 
226
288
  **JournalEntry type** — canonical schema with 6 RL fields: `hypothesis`, `outcome`, `score_delta`, `eval_snapshot`, `diff_hash`, `context_entries`.
227
289
 
228
290
  **TrajectoryLoader** — query, filter, and render experiment trajectories for agent context windows. Supports filtering by session, agent, outcome, score range.
229
291
 
230
- **Peter Parker** — model-routed orchestrator with cost/balanced/quality profiles. Routes tasks to haiku/sonnet/opus based on complexity. Subscribes to event bus for reactive dispatch.
292
+ **Peter Parker** — model-routed orchestrator with cost/balanced/quality profiles. Routes tasks to haiku/sonnet/opus based on complexity. Subscribes to event bus for reactive dispatch. Creates PRs on `pp/` branches.
231
293
 
232
- **Flow Engine** — declarative trigger-action automation in `.jfl/flows.yaml`:
294
+ **Flow Engine** — declarative trigger-action automation in `.jfl/flows.yaml` and `.jfl/flows/*.yaml`:
233
295
 
234
296
  ```yaml
235
297
  - name: eval-scored-trigger-analysis
@@ -246,6 +308,34 @@ Flow actions: `log`, `emit`, `journal`, `webhook`, `command`, `spawn`. Gates: `a
246
308
 
247
309
  **MCP tool:** `query_experiment_history` — agents query past experiment trajectories to inform next proposals.
248
310
 
311
+ ### Telemetry Agent
312
+
313
+ Autonomous monitoring agent that runs inside Context Hub on a configurable interval.
314
+
315
+ - Analyzes local telemetry events for patterns
316
+ - Detects anomalies: cost spikes (2x baseline), error spikes (3x baseline)
317
+ - Calls Stratus rollout API for JEPA health trajectory prediction
318
+ - Tracks `brain_goal_proximity` over time (product health score)
319
+ - Emits `telemetry:insight` events that trigger the self-driving loop
320
+ - State persisted at `.jfl/telemetry-agent-state.json`
321
+
322
+ **Insight types:** `anomaly`, `regression`, `cost_spike`, `pattern`, `stratus_prediction`
323
+
324
+ ### Terminal Visualizations
325
+
326
+ Headless dashboard data rendered in the terminal via `jfl viz`. No browser needed — same data as the web dashboard.
327
+
328
+ ```bash
329
+ jfl viz dash # Composite: leaderboard + flows + events + status
330
+ jfl viz experiments # Experiment runs with dot plot and sparklines
331
+ jfl viz leaderboard # Ranked agents with bar chart
332
+ jfl viz flows # Flow definitions and pending executions
333
+ jfl viz events # Recent event stream with type coloring
334
+ jfl viz status # Hub health and sources
335
+ ```
336
+
337
+ All subcommands support `--json` for programmatic consumption. Uses kuva for rich terminal plots with ASCII fallback.
338
+
249
339
  ### Portfolio Management
250
340
 
251
341
  Coordinate multiple GTM workspaces under one portfolio.
@@ -404,6 +494,7 @@ jfl services # Interactive TUI (no args)
404
494
  | `jfl validate-settings [--fix] [--json]` | Validate and repair .claude/settings.json |
405
495
  | `jfl preferences [--clear-ai] [--show]` | Manage JFL preferences |
406
496
  | `jfl profile [action]` | Manage profile (show, edit, export, import, generate) |
497
+ | `jfl ci setup` | Deploy eval + review CI workflows to project |
407
498
  | `jfl test` | Test onboarding flow (isolated environment) |
408
499
 
409
500
  ### Context Hub
@@ -429,8 +520,28 @@ jfl services # Interactive TUI (no args)
429
520
  | `jfl eval list [-a agent] [-l limit]` | List recent eval entries |
430
521
  | `jfl eval trajectory -a <agent>` | Composite score trajectory with sparkline |
431
522
  | `jfl eval log -a <agent> -m <metrics>` | Log an eval entry |
432
- | `jfl eval compare` | Side-by-side agent comparison |
433
- | `jfl eval tuples [--limit N] [--format json]` | Extract training tuples from journals |
523
+ | `jfl eval compare --agents <a,b>` | Side-by-side agent comparison |
524
+ | `jfl eval tuples [--team N] [--since date]` | Extract training tuples from journals |
525
+
526
+ ### Prediction
527
+
528
+ | Command | Description |
529
+ |---------|-------------|
530
+ | `jfl predict run --proposal <text> --goal <text>` | Predict eval delta for proposed change |
531
+ | `jfl predict resolve --id <id> --actual-delta <n>` | Resolve prediction with actual results |
532
+ | `jfl predict accuracy` | Prediction accuracy stats (direction, delta error, calibration) |
533
+ | `jfl predict history [--limit N]` | Recent predictions with sparkline |
534
+
535
+ ### Visualization
536
+
537
+ | Command | Description |
538
+ |---------|-------------|
539
+ | `jfl viz dash` | Composite terminal dashboard (default) |
540
+ | `jfl viz experiments [--agent name]` | Experiment runs with dot plot and sparklines |
541
+ | `jfl viz leaderboard` | Ranked agent leaderboard with bar chart |
542
+ | `jfl viz flows [--pending]` | Flow definitions and pending executions |
543
+ | `jfl viz events [--pattern glob] [--limit N]` | Recent events with type coloring |
544
+ | `jfl viz status` | Hub health, children, sources |
434
545
 
435
546
  ### Portfolio
436
547
 
@@ -478,8 +589,13 @@ jfl services # Interactive TUI (no args)
478
589
  | `jfl agent init <name> [-d desc]` | Scaffold agent (manifest + policy + lifecycle flows) |
479
590
  | `jfl agent list` | List registered agents |
480
591
  | `jfl agent status <name>` | Show agent health and config |
592
+ | `jfl peter setup [--cost\|--balanced\|--quality]` | Configure model routing profile |
593
+ | `jfl peter run [--task text]` | Run orchestrator (interactive or headless) |
594
+ | `jfl peter pr --task <text>` | Run agent, create PR on pp/ branch, emit event |
595
+ | `jfl peter experiment` | Proactive: analyze trajectory, pick highest-value task, execute |
596
+ | `jfl peter status` | Show config and recent events |
597
+ | `jfl peter dashboard` | Live event stream TUI |
481
598
  | `jfl ralph [args]` | Ralph-tui agent loop orchestrator |
482
- | `jfl peter [action]` | Peter Parker model-routed orchestrator (setup, run, status) |
483
599
  | `jfl orchestrate [name] [--list] [--create <n>]` | Multi-service orchestration workflows |
484
600
  | `jfl dashboard` | Interactive service monitoring TUI |
485
601
  | `jfl events [-p pattern]` | Live MAP event bus dashboard |
@@ -496,9 +612,11 @@ jfl services # Interactive TUI (no args)
496
612
  | `jfl flows add` | Interactive flow builder |
497
613
  | `jfl flows test <name>` | Test a flow with synthetic event |
498
614
  | `jfl flows enable/disable <name>` | Toggle flows |
615
+ | `jfl flows approve [--flow name] [--all]` | Approve gated flow executions |
499
616
  | `jfl scope list` | View service context scopes |
500
617
  | `jfl scope set` | Set scope declarations |
501
618
  | `jfl scope test` | Test scope enforcement |
619
+ | `jfl scope viz` | ASCII scope graph with access matrix |
502
620
 
503
621
  ### Platform
504
622
 
@@ -510,6 +628,8 @@ jfl services # Interactive TUI (no args)
510
628
  | `jfl deploy [-f]` | Deploy to JFL platform |
511
629
  | `jfl agents [action]` | Manage parallel agents (list, create, start, stop, destroy) |
512
630
  | `jfl feedback [action]` | Rate session (0-5), view or sync |
631
+ | `jfl pi [--yolo] [--mode interactive\|rpc\|headless]` | Launch JFL in Pi runtime |
632
+ | `jfl pi agents run [--team yaml]` | Spawn agent team as Pi subprocesses |
513
633
 
514
634
  ### Telemetry & Intelligence
515
635
 
@@ -616,6 +736,7 @@ Pre-installed slash commands for Claude Code:
616
736
  | `/remotion-best-practices` | Remotion video creation in React |
617
737
  | `/geo` | GEO-first SEO analysis for AI search engines |
618
738
  | `/geo-audit` | Full website GEO+SEO audit with parallel agents |
739
+ | `/viz` | Terminal data visualization via kuva |
619
740
 
620
741
  ```bash
621
742
  # Install more skills
@@ -682,7 +803,9 @@ SessionStart hook fires You work normally Stop hook fire
682
803
  ├─ Create session branch ├─ Journal entries auto-tracked ├─ Auto-commit changes
683
804
  ├─ Recover crashed sessions ├─ Auto-commit every 2 min ├─ Merge to main
684
805
  ├─ Health-check Context Hub ├─ Events flow to MAP bus └─ Cleanup branch
685
- └─ Start auto-commit └─ Memory indexes continuously
806
+ └─ Start auto-commit ├─ Memory indexes continuously
807
+ ├─ Telemetry agent monitors
808
+ └─ Flows react to events
686
809
 
687
810
  Context Hub (always running)
688
811
  ├─ Serves MCP tools to Claude Code
@@ -691,6 +814,7 @@ SessionStart hook fires You work normally Stop hook fire
691
814
  ├─ Watches journal/ for live entries
692
815
  ├─ Portfolio mode: fans out to child hubs
693
816
  ├─ Flow engine: reactive trigger→action
817
+ ├─ Telemetry agent: health monitoring
694
818
  └─ Web dashboard at /dashboard/
695
819
  ```
696
820
 
@@ -700,7 +824,7 @@ SessionStart hook fires You work normally Stop hook fire
700
824
 
701
825
  ## CI/CD
702
826
 
703
- Two GitHub Actions workflows handle quality and releases.
827
+ Two GitHub Actions workflows handle quality and releases. Two additional workflows close the self-driving loop.
704
828
 
705
829
  ### CI — `.github/workflows/ci.yml`
706
830
 
@@ -710,38 +834,44 @@ Runs on every push and PR to `main`:
710
834
  - Full test suite (~365 tests across 17 test files)
711
835
  - Coverage report uploaded as artifact
712
836
 
713
- ### CD — `.github/workflows/release.yml`
714
-
715
- Fires after CI passes on `main`. Uses [Changesets](https://github.com/changesets/changesets) for version management and npm Trusted Publisher (OIDC) for secretless publishing.
837
+ ### Release — `.github/workflows/release.yml`
716
838
 
717
- **Auto-changeset generation:** `scripts/generate-changesets.sh` converts conventional commit messages into changesets automatically:
718
- - `feat:` = minor bump
719
- - `fix:` = patch bump
720
- - `feat!:` = major bump
839
+ Fires after CI passes on `main`. Two paths:
721
840
 
722
- No manual `npx changeset` needed for most changes.
723
-
724
- **Release flow:**
841
+ 1. **Version bumped** (package.json differs from npm): Build, publish with provenance, create git tag, create GitHub Release with auto-generated notes.
842
+ 2. **Version matches npm**: Generate changesets from conventional commits, create "Version Packages" PR via changesets/action.
725
843
 
726
844
  ```bash
727
845
  # Option A: Manual changeset
728
846
  npx changeset # pick bump level, write summary
729
847
 
730
848
  # Option B: Just use conventional commits — auto-generated on CI
849
+ # feat: = minor, fix: = patch, feat!: = major
731
850
 
732
- # Push to main CI runs, then release.yml fires
733
- # → changesets/action creates a "Version Packages" PR
734
-
735
- # Merge the Version PR
736
- # → release.yml fires again → npm publish --provenance --access public
851
+ # Push to main CI runs Release publishes or creates Version PR
737
852
  ```
738
853
 
739
- No `NPM_TOKEN` needed. Publishing uses OIDC provenance via npm Trusted Publisher.
854
+ **Secrets required:** `NPM_TOKEN` (granular access token scoped to jfl package). Provenance attestation via npm Trusted Publisher (OIDC).
855
+
856
+ ### Eval — `.github/workflows/jfl-eval.yml`
740
857
 
741
- **One-time setup (per package):**
742
- > npmjs.com > `jfl` package > Settings > Publish Access > Add Provenance
743
- > - Repository: `402goose/jfl-cli`
744
- > - Workflow: `.github/workflows/release.yml`
858
+ Runs on PRs from Peter Parker (`pp/` prefix) or `run-eval` label:
859
+
860
+ - Baseline test pass rate from `main`
861
+ - PR test pass rate
862
+ - AI quality assessment (correctness, coverage, architecture, value)
863
+ - Posts `eval:scored` event to Context Hub
864
+ - Comments on PR with eval results
865
+
866
+ ### AI Review — `.github/workflows/jfl-review.yml`
867
+
868
+ Runs on PRs from Peter Parker (`pp/` prefix) or `ai-review` label:
869
+
870
+ - Gathers project context (config, knowledge docs, journal)
871
+ - Context-aware diff review (bugs, security, architecture, tests)
872
+ - Structured findings with severity (red/yellow/blue)
873
+ - Posts `review:findings` event to Context Hub
874
+ - Comments on PR with findings
745
875
 
746
876
  ---
747
877
 
@@ -780,6 +910,44 @@ jfl wallet # Wallet and day pass status
780
910
 
781
911
  ## What's New
782
912
 
913
+ **0.4.3**
914
+ - Feat: **Self-driving loop proven end-to-end** — eval CI auto-merges improved PRs, requests changes on regressions. First auto-merged PP PR (#16) in 90 seconds
915
+ - Feat: **`jfl peter experiment`** — proactive experiment selection. Analyzes trajectory history + eval trends, uses Stratus to rank proposals (heuristic fallback), picks highest-value task, spawns PP to execute
916
+ - Feat: **`jfl ci setup`** — deploys eval + review CI workflows to any project with secret setup instructions
917
+ - Feat: **Review gate** — eval checks for AI review blockers before auto-merging. PRs must pass both eval AND review
918
+ - Feat: **Cron triggers** in flow engine — `cron:daily`, `cron:hourly`, `cron:every-30-minutes` patterns for proactive flows
919
+ - Feat: **`jfl update` syncs flows** — new flow files deployed on update (merge-only, never overwrites customizations)
920
+ - Fix: Eval CI self-sufficient — commits eval entries + service events to PR branch, no hub dependency for core loop
921
+ - Test: 274 tests (up from 266)
922
+
923
+ **0.4.2**
924
+ - Fix: HTTP hook port correction — `jfl init` and `jfl update` now detect and fix hooks pointing to wrong Context Hub port
925
+ - Fix: Release pipeline — direct publish when version bumped, changeset generation when version matches npm
926
+ - Fix: npm auth — NPM_TOKEN required (OIDC trusted publisher is for provenance only)
927
+ - Feat: Telemetry archive path fix — telemetry data properly flows to digest
928
+
929
+ **0.4.1**
930
+ - Feat: **Self-driving loop** — 9 declarative flows in `self-driving.yaml` for autonomous improvement (auto-merge, flag regression, training tuples, review response, telemetry-to-PP dispatch, Stratus prediction gate)
931
+ - Feat: **`jfl predict`** — Stratus prediction engine with run/resolve/accuracy/history subcommands
932
+ - Feat: **`jfl viz`** — terminal visualizations (experiments, leaderboard, flows, events, status, dash)
933
+ - Feat: **`jfl-eval.yml`** — CI workflow for eval on Peter Parker PRs (baseline comparison, AI quality scoring, event posting)
934
+ - Feat: **`jfl-review.yml`** — CI workflow for context-aware AI code review (structured findings, severity levels, event posting)
935
+ - Feat: **Telemetry agent** — autonomous monitoring in Context Hub (anomaly detection, Stratus JEPA health prediction, insight events)
936
+ - Feat: **`spawn` action type** in flow engine — spawn detached subprocesses with cleaned environment
937
+ - Feat: **`flows approve`** subcommand — approve gated flow executions (interactive or batch)
938
+ - Feat: Dashboard pages: **Experiments** (dot plots, sparklines), **Telemetry** (cost/usage/health), **Topology** (service dependency graph)
939
+ - Feat: **`jfl pi`** — Pi AI runtime integration with extensions, skills, and agent team spawning
940
+ - Feat: MCP tools: `events_publish`, `events_recent` for MAP event bus interaction
941
+
942
+ **0.4.0**
943
+ - Feat: **Peter Parker `pr` subcommand** — run agent, commit, push `pp/` branch, create PR, emit `pr:created` event
944
+ - Feat: **Peter Parker `dashboard`** — live event stream TUI
945
+ - Feat: Richer eval composite with AI quality dimensions (correctness, coverage, architecture, value)
946
+ - Feat: `scope viz` — ASCII scope graph with access matrix and flow visualization
947
+ - Feat: Context-aware AI review with structured findings + severity levels
948
+ - Fix: Baseline eval uses clean checkout (git checkout --force + clean)
949
+ - Test: Predictor unit tests, hub-client test coverage
950
+
783
951
  **0.3.0**
784
952
  - Feat: **Portfolio workspace type** — `jfl portfolio register/list/unregister/status/phone-home`. Portfolios contain multiple GTM workspaces with cross-product event routing via SSE, context scope enforcement (produces/consumes/denied), fan-out queries to child hubs, and portfolio-level leaderboard aggregation
785
953
  - Feat: **Dashboard V2** — pre-built Vite + Preact + Tailwind SPA served at `/dashboard/`. Pages: Overview (activity charts, metric cards), Journal (search + type filters), Events (pattern filter presets), Services (type badges, context scope, data flows), Flows (definitions + execution history), Health (system metrics, memory index), Agents (eval leaderboards grouped by domain)
@@ -788,7 +956,7 @@ jfl wallet # Wallet and day pass status
788
956
  - Feat: **Flow engine** — declarative trigger-action automation in `.jfl/flows.yaml`. Actions: log, emit, journal, webhook, command, spawn. Gates: time-gated, deadline, requires_approval. Template interpolation with `{{child.NAME.port}}`
789
957
  - Feat: **HTTP hooks** — Claude Code lifecycle hooks (PostToolUse, Stop, PreCompact, SubagentStart/Stop) POST to Context Hub. `jfl hooks init/status/remove/deploy`
790
958
  - Feat: **Context scope enforcement** — produces/consumes/denied patterns. Event bus filters by scope declarations. `jfl scope list/set/test`
791
- - Feat: CI/CD pipeline — GitHub Actions CI (strict TypeScript + Jest gate) + CD via Changesets with auto-generation from conventional commits. npm Trusted Publisher with OIDC provenance
959
+ - Feat: CI/CD pipeline — GitHub Actions CI (strict TypeScript + Jest gate) + CD via Changesets with auto-generation from conventional commits
792
960
  - Feat: Service agent templates (CLAUDE.md, settings.json, knowledge docs)
793
961
  - Feat: Session cleanup guard — prevents `rm -rf` on main when no worktrees exist
794
962
  - Fix: TypeScript strict mode build errors resolved
@@ -847,6 +1015,7 @@ jfl wallet # Wallet and day pass status
847
1015
 
848
1016
  ```bash
849
1017
  OPENAI_API_KEY=sk-... # Optional: enables semantic embeddings for memory search
1018
+ STRATUS_API_KEY=stratus_... # Optional: enables Stratus prediction engine + telemetry agent
850
1019
  CONTEXT_HUB_PORT=4242 # Override per-project port
851
1020
  CRM_SHEET_ID=your-sheet-id # Google Sheets CRM integration
852
1021
  JFL_PLATFORM_URL=... # JFL platform URL (default: jfl.run)
@@ -864,4 +1033,4 @@ MIT License - see LICENSE file.
864
1033
 
865
1034
  Built by [@tagga](https://x.com/taggaoyl) (Alec Taggart)
866
1035
 
867
- Powered by [Claude](https://claude.ai) (Anthropic), [x402](https://x402.org) (crypto micropayments), Commander.js, sql.js, and more.
1036
+ Powered by [Claude](https://claude.ai) (Anthropic), [Stratus](https://stratus.run) (JEPA world model), [x402](https://x402.org) (crypto micropayments), Commander.js, sql.js, and more.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @purpose CLI command for `jfl ci setup` — deploys eval + review CI workflows to a project
3
+ */
4
+ export declare function ciSetupCommand(): Promise<void>;
5
+ //# sourceMappingURL=ci-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-setup.d.ts","sourceRoot":"","sources":["../../src/commands/ci-setup.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyBH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAsEpD"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @purpose CLI command for `jfl ci setup` — deploys eval + review CI workflows to a project
3
+ */
4
+ import chalk from "chalk";
5
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
6
+ import { join, dirname } from "path";
7
+ import { fileURLToPath } from "url";
8
+ import { execSync } from "child_process";
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+ const TEMPLATE_DIR = join(__dirname, "../../template/.github/workflows");
12
+ const WORKFLOW_FILES = ["jfl-eval.yml", "jfl-review.yml"];
13
+ function getRepoSlug() {
14
+ try {
15
+ const remote = execSync("git remote get-url origin", { encoding: "utf-8" }).trim();
16
+ const match = remote.match(/github\.com[:/](.+?)(?:\.git)?$/);
17
+ return match?.[1] ?? "OWNER/REPO";
18
+ }
19
+ catch {
20
+ return "OWNER/REPO";
21
+ }
22
+ }
23
+ export async function ciSetupCommand() {
24
+ const cwd = process.cwd();
25
+ const targetDir = join(cwd, ".github", "workflows");
26
+ if (!existsSync(TEMPLATE_DIR)) {
27
+ console.log(chalk.red("\n Template workflows not found at: " + TEMPLATE_DIR));
28
+ console.log(chalk.gray(" This usually means the jfl CLI package is incomplete. Try: npm install -g jfl\n"));
29
+ process.exit(1);
30
+ }
31
+ if (!existsSync(join(cwd, ".github"))) {
32
+ mkdirSync(join(cwd, ".github"), { recursive: true });
33
+ }
34
+ if (!existsSync(targetDir)) {
35
+ mkdirSync(targetDir, { recursive: true });
36
+ }
37
+ let deployed = 0;
38
+ let skipped = 0;
39
+ for (const file of WORKFLOW_FILES) {
40
+ const src = join(TEMPLATE_DIR, file);
41
+ const dest = join(targetDir, file);
42
+ if (!existsSync(src)) {
43
+ console.log(chalk.yellow(` Template missing: ${file} — skipping`));
44
+ skipped++;
45
+ continue;
46
+ }
47
+ const templateContent = readFileSync(src, "utf-8");
48
+ if (existsSync(dest)) {
49
+ const existingContent = readFileSync(dest, "utf-8");
50
+ if (existingContent === templateContent) {
51
+ console.log(chalk.gray(` ${file} — already up to date`));
52
+ deployed++;
53
+ continue;
54
+ }
55
+ console.log(chalk.yellow(` ${file} — exists and differs from template, overwriting`));
56
+ }
57
+ writeFileSync(dest, templateContent);
58
+ console.log(chalk.green(` ${file} — deployed`));
59
+ deployed++;
60
+ }
61
+ const repoSlug = getRepoSlug();
62
+ console.log();
63
+ if (deployed > 0) {
64
+ console.log(chalk.green(" CI workflows deployed to .github/workflows/"));
65
+ }
66
+ if (skipped > 0) {
67
+ console.log(chalk.yellow(` ${skipped} workflow(s) skipped (template missing)`));
68
+ }
69
+ console.log();
70
+ console.log(chalk.bold(" Required GitHub secrets") + chalk.gray(` (set at github.com/${repoSlug}/settings/secrets):`));
71
+ console.log(chalk.cyan(" OPENAI_API_KEY") + chalk.gray(" — For AI quality assessment and code review"));
72
+ console.log();
73
+ console.log(chalk.bold(" Optional:"));
74
+ console.log(chalk.cyan(" OPENROUTER_API_KEY") + chalk.gray(" — Fallback if OpenAI unavailable"));
75
+ console.log(chalk.cyan(" JFL_HUB_URL") + chalk.gray(" — Context Hub URL for real-time dashboard updates"));
76
+ console.log(chalk.cyan(" JFL_HUB_TOKEN") + chalk.gray(" — Auth token for hub API"));
77
+ console.log();
78
+ console.log(chalk.gray(" The eval workflow runs on PRs from Peter Parker (pp/ branches)."));
79
+ console.log(chalk.gray(" To trigger manually, add the 'run-eval' or 'ai-review' label to any PR."));
80
+ console.log();
81
+ }
82
+ //# sourceMappingURL=ci-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-setup.js","sourceRoot":"","sources":["../../src/commands/ci-setup.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AACvE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACjD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAErC,MAAM,YAAY,GAAG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A;IACpG,OAAO,CAAC,GAAG,EAAE,CAAA;AACf,CAAC"}
@@ -3,8 +3,9 @@
3
3
  *
4
4
  * Orchestrator that wraps ralph-tui with model routing and event bridging.
5
5
  * Spidey-sense for which model to use per agent role.
6
+ * Includes proactive experiment selection — PP picks its own next task.
6
7
  *
7
- * @purpose CLI command for Peter Parker orchestrator — setup, run, status
8
+ * @purpose CLI command for Peter Parker orchestrator — setup, run, status, experiment
8
9
  */
9
10
  export declare function peterCommand(action?: string, options?: {
10
11
  cost?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"peter.d.ts","sourceRoot":"","sources":["../../src/commands/peter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAmaH,wBAAsB,YAAY,CAChC,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,iBA8CvF"}
1
+ {"version":3,"file":"peter.d.ts","sourceRoot":"","sources":["../../src/commands/peter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwoBH,wBAAsB,YAAY,CAChC,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,iBAoDvF"}