@hassangameryt/freeflow 0.1.0 → 0.2.0

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.
Files changed (89) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +8 -4
  3. package/package.json +15 -2
  4. package/plugins/freeflow/.claude-plugin/plugin.json +1 -1
  5. package/plugins/freeflow/.codex-plugin/plugin.json +1 -1
  6. package/plugins/freeflow/command-surface.json +2 -10
  7. package/plugins/freeflow/docs/README.md +3 -2
  8. package/plugins/freeflow/docs/adr/0002-evals-before-hooks.md +1 -1
  9. package/plugins/freeflow/docs/adr/0003-release-boundary.md +1 -1
  10. package/plugins/freeflow/docs/adr/0004-research-replaces-shallow-discovery-skills.md +26 -0
  11. package/plugins/freeflow/docs/adr/README.md +2 -1
  12. package/plugins/freeflow/docs/architecture.md +3 -3
  13. package/plugins/freeflow/docs/output-router.md +212 -0
  14. package/plugins/freeflow/docs/release-evidence.md +25 -5
  15. package/plugins/freeflow/docs/skills.md +6 -7
  16. package/plugins/freeflow/docs/workflow.md +1 -1
  17. package/plugins/freeflow/hooks/freeflow-runtime-context.mjs +23 -6
  18. package/plugins/freeflow/pi-extension/index.js +941 -15
  19. package/plugins/freeflow/router/dist/benchmark-harness.d.ts +32 -0
  20. package/plugins/freeflow/router/dist/benchmark-harness.js +92 -0
  21. package/plugins/freeflow/router/dist/benchmarks.d.ts +102 -0
  22. package/plugins/freeflow/router/dist/benchmarks.js +880 -0
  23. package/plugins/freeflow/router/dist/bounded-evidence.d.ts +40 -0
  24. package/plugins/freeflow/router/dist/bounded-evidence.js +310 -0
  25. package/plugins/freeflow/router/dist/codex-qa-benchmarks.d.ts +91 -0
  26. package/plugins/freeflow/router/dist/codex-qa-benchmarks.js +461 -0
  27. package/plugins/freeflow/router/dist/command-benchmarks.d.ts +128 -0
  28. package/plugins/freeflow/router/dist/command-benchmarks.js +652 -0
  29. package/plugins/freeflow/router/dist/config.d.ts +22 -0
  30. package/plugins/freeflow/router/dist/config.js +114 -0
  31. package/plugins/freeflow/router/dist/evidence-range-selector.d.ts +22 -0
  32. package/plugins/freeflow/router/dist/evidence-range-selector.js +180 -0
  33. package/plugins/freeflow/router/dist/evidence-search.d.ts +25 -0
  34. package/plugins/freeflow/router/dist/evidence-search.js +450 -0
  35. package/plugins/freeflow/router/dist/evidence.d.ts +38 -0
  36. package/plugins/freeflow/router/dist/evidence.js +196 -0
  37. package/plugins/freeflow/router/dist/experimental-local-index.d.ts +1 -0
  38. package/plugins/freeflow/router/dist/experimental-local-index.js +1 -0
  39. package/plugins/freeflow/router/dist/experiments/local-index.d.ts +58 -0
  40. package/plugins/freeflow/router/dist/experiments/local-index.js +562 -0
  41. package/plugins/freeflow/router/dist/index-benchmarks.d.ts +84 -0
  42. package/plugins/freeflow/router/dist/index-benchmarks.js +458 -0
  43. package/plugins/freeflow/router/dist/index.d.ts +12 -0
  44. package/plugins/freeflow/router/dist/index.js +12 -0
  45. package/plugins/freeflow/router/dist/line-ranges.d.ts +22 -0
  46. package/plugins/freeflow/router/dist/line-ranges.js +22 -0
  47. package/plugins/freeflow/router/dist/parsers.d.ts +16 -0
  48. package/plugins/freeflow/router/dist/parsers.js +473 -0
  49. package/plugins/freeflow/router/dist/repo-traversal.d.ts +18 -0
  50. package/plugins/freeflow/router/dist/repo-traversal.js +242 -0
  51. package/plugins/freeflow/router/dist/retrieve.d.ts +33 -0
  52. package/plugins/freeflow/router/dist/retrieve.js +855 -0
  53. package/plugins/freeflow/router/dist/router-contract.d.ts +10 -0
  54. package/plugins/freeflow/router/dist/router-contract.js +54 -0
  55. package/plugins/freeflow/router/dist/run.d.ts +26 -0
  56. package/plugins/freeflow/router/dist/run.js +356 -0
  57. package/plugins/freeflow/router/dist/schema.d.ts +18 -0
  58. package/plugins/freeflow/router/dist/schema.js +354 -0
  59. package/plugins/freeflow/router/dist/types.d.ts +234 -0
  60. package/plugins/freeflow/router/dist/types.js +9 -0
  61. package/plugins/freeflow/router/dist/vault.d.ts +80 -0
  62. package/plugins/freeflow/router/dist/vault.js +484 -0
  63. package/plugins/freeflow/skills/commit-work/SKILL.md +17 -16
  64. package/plugins/freeflow/skills/commit-work/references/staging-decisions.md +3 -3
  65. package/plugins/freeflow/skills/execute-plan/SKILL.md +70 -5
  66. package/plugins/freeflow/skills/execute-plan/references/execution-map.md +122 -0
  67. package/plugins/freeflow/skills/mode-contract/SKILL.md +1 -1
  68. package/plugins/freeflow/skills/output-router/SKILL.md +69 -0
  69. package/plugins/freeflow/skills/output-router/references/safety-policy.md +33 -0
  70. package/plugins/freeflow/skills/research/ARTIFACT-DESTINATIONS.md +58 -0
  71. package/plugins/freeflow/skills/research/CHECKPOINTS.md +74 -0
  72. package/plugins/freeflow/skills/research/LANGUAGE.md +61 -0
  73. package/plugins/freeflow/skills/research/SKILL.md +128 -0
  74. package/plugins/freeflow/skills/review-artifact/SKILL.md +34 -1
  75. package/plugins/freeflow/skills/review-artifact/references/reviewer-prompt.md +12 -1
  76. package/plugins/freeflow/skills/review-work/SKILL.md +25 -2
  77. package/plugins/freeflow/skills/review-work/references/reviewer-prompt.md +8 -0
  78. package/plugins/freeflow/skills/setup-freeflow/SKILL.md +14 -4
  79. package/plugins/freeflow/skills/setup-freeflow/references/activation-contract.md +8 -3
  80. package/plugins/freeflow/skills/setup-freeflow/references/host-setup.md +3 -1
  81. package/plugins/freeflow/skills/setup-freeflow/references/output-router-setup.md +52 -0
  82. package/plugins/freeflow/skills/workflow/SKILL.md +11 -3
  83. package/plugins/freeflow/skills/workflow/references/workflow-map.md +10 -11
  84. package/plugins/freeflow/skills/write-skill/SKILL.md +1 -1
  85. package/plugins/freeflow/skills/capture-decisions/SKILL.md +0 -95
  86. package/plugins/freeflow/skills/capture-decisions/references/destination-guide.md +0 -65
  87. package/plugins/freeflow/skills/grill-context/SKILL.md +0 -79
  88. package/plugins/freeflow/skills/grill-context/references/approach-framing.md +0 -52
  89. package/plugins/freeflow/skills/research-brief/SKILL.md +0 -69
@@ -10,7 +10,7 @@
10
10
  {
11
11
  "name": "freeflow",
12
12
  "description": "Conversation, workflow, and strict-workflow skills for coding agents.",
13
- "version": "0.1.0",
13
+ "version": "0.2.0",
14
14
  "category": "development",
15
15
  "source": "./plugins/freeflow",
16
16
  "author": {
package/README.md CHANGED
@@ -22,7 +22,7 @@ Use strict-workflow for security, privacy, billing, public APIs, migrations, dat
22
22
  flowchart LR
23
23
  Request{request}
24
24
  Talk[conversation<br/>answer directly]
25
- Discover[discover<br/>research / grill]
25
+ Discover[discover<br/>research checkpoint]
26
26
  Spec[spec]
27
27
  Plan[plan]
28
28
  Build[build<br/>execute / diagnose]
@@ -155,16 +155,17 @@ Use Freeflow workflow mode for this task.
155
155
  Keep this in conversation mode.
156
156
  Use strict-workflow for this billing change.
157
157
  Verify before claiming completion.
158
- Capture the durable decision.
158
+ Create a research checkpoint.
159
159
  ```
160
160
 
161
- Slash-style prompts are model-routed in v0.1:
161
+ Slash-style prompts are model-routed in Codex and Claude:
162
162
 
163
163
  ```text
164
164
  /workflow conversation
165
165
  /workflow workflow
166
166
  /workflow strict-workflow
167
167
  /workflow reset
168
+ /research
168
169
  /write-spec
169
170
  /write-plan
170
171
  /execute-plan
@@ -196,7 +197,10 @@ Freeflow does not claim to beat Matt Pocock's skills or Obra's Superpowers. Thos
196
197
  | Write plan with hidden billing decision | 4/10 | 10/10 | Freeflow created no plan, named the policy conflict, and asked which path to follow. |
197
198
  | Cold spec call without context | 2/10 | 10/10 | Freeflow did not invent onboarding behavior from adjacent files. |
198
199
  | Workflow context lifecycle | fail | pass | Setup loads workflow context for the same session; session-start hooks load workflow context without `PostToolUse`. |
199
- | Command surface audit | - | Pass | 3 mode commands, 13 direct skill calls, and 2 developer skill calls are covered while native slash handlers remain disabled. |
200
+ | Output router retrieval | - | 7/7 pass | Deterministic router evidence fixes generated-artifact false positives while keeping scanner retrieval default. |
201
+ | Output router command recovery | - | 8/8 pass | `freeflow_run` preserves exact facts and verifies raw vault recovery for routed command output. |
202
+ | Codex Structured Q&A | native proxy 0/1 | improved router 1/1 | Sandbox Permissions Q&A resolves to the source markdown instead of a generated `graphify-out` decoy. |
203
+ | Command surface audit | - | Pass | 4 mode commands, 11 direct skill calls, and 2 developer skill calls are covered while native slash handlers remain disabled. |
200
204
 
201
205
  Eval sources and reports live with the plugin under `plugins/freeflow/evals/`; generated run output is ignored. Concise release evidence is summarized in [plugins/freeflow/docs/release-evidence.md](plugins/freeflow/docs/release-evidence.md).
202
206
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hassangameryt/freeflow",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Lightweight workflow for coding agents.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,6 +15,14 @@
15
15
  },
16
16
  "license": "MIT",
17
17
  "type": "module",
18
+ "scripts": {
19
+ "build:router": "tsc -p plugins/freeflow/router/tsconfig.json",
20
+ "test:router": "npm run build:router && node --test plugins/freeflow/router/tests/*.test.js",
21
+ "bench:router": "npm run build:router && node plugins/freeflow/router/dist/benchmarks.js",
22
+ "bench:router:commands": "npm run build:router && node plugins/freeflow/router/dist/command-benchmarks.js",
23
+ "bench:router:index": "npm run build:router && node plugins/freeflow/router/dist/index-benchmarks.js",
24
+ "bench:router:codex-qa": "npm run build:router && node plugins/freeflow/router/dist/codex-qa-benchmarks.js"
25
+ },
18
26
  "keywords": [
19
27
  "pi-package",
20
28
  "agent-skills",
@@ -48,6 +56,11 @@
48
56
  "plugins/freeflow/docs/**",
49
57
  "plugins/freeflow/hooks/**",
50
58
  "plugins/freeflow/pi-extension/**",
59
+ "plugins/freeflow/router/dist/**",
51
60
  "plugins/freeflow/skills/**"
52
- ]
61
+ ],
62
+ "devDependencies": {
63
+ "@types/node": "^22.15.30",
64
+ "typescript": "^5.8.3"
65
+ }
53
66
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "freeflow",
3
3
  "description": "Lightweight workflow for coding agents. Conversation, workflow, and strict-workflow skills for planning, execution, review, verification, handoff, and decision capture.",
4
- "version": "0.1.0",
4
+ "version": "0.2.0",
5
5
  "author": {
6
6
  "name": "Hassan Mohiddin"
7
7
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freeflow",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Lightweight workflow for coding agents.",
5
5
  "author": {
6
6
  "name": "Hassan Mohiddin"
@@ -20,12 +20,8 @@
20
20
  ],
21
21
  "directSkillCalls": [
22
22
  {
23
- "command": "/grill-context",
24
- "skill": "grill-context"
25
- },
26
- {
27
- "command": "/research-brief",
28
- "skill": "research-brief"
23
+ "command": "/research",
24
+ "skill": "research"
29
25
  },
30
26
  {
31
27
  "command": "/write-spec",
@@ -59,10 +55,6 @@
59
55
  "command": "/commit-work",
60
56
  "skill": "commit-work"
61
57
  },
62
- {
63
- "command": "/capture-decisions",
64
- "skill": "capture-decisions"
65
- },
66
58
  {
67
59
  "command": "/handoff",
68
60
  "skill": "handoff"
@@ -30,10 +30,11 @@ Or install directly from GitHub:
30
30
  pi install git:github.com/hassan-mohiddin/freeflow
31
31
  ```
32
32
 
33
- The package exposes `plugins/freeflow/skills/` and `plugins/freeflow/pi-extension/index.js`. The Pi extension registers direct Freeflow commands, keeps `/workflow` mode changes scoped to the Pi session, refreshes workflow and interview-gate context on session start and compact, and injects that context before agent turns. It does not enforce policy, block tools, grant permissions, or create repo-local hooks.
33
+ The package exposes `plugins/freeflow/skills/` and `plugins/freeflow/pi-extension/index.js`. The Pi extension registers direct Freeflow commands, keeps `/workflow` mode changes scoped to the Pi session, refreshes workflow, interview-gate, and output-router context on session start and compact, and injects that context before agent turns. Output-router context includes its safety-policy reference. The extension does not enforce policy, block tools, grant permissions, or create repo-local hooks.
34
34
 
35
35
  - [Workflow](workflow.md): modes, entry points, loops, and the compact workflow map.
36
36
  - [Skills](skills.md): shipped skills and what each one is for.
37
37
  - [Architecture](architecture.md): package layout, runtime boundary, context hooks, and progressive disclosure model.
38
- - [Release evidence](release-evidence.md): v0.1 acceptance evidence and deferred checks.
38
+ - [Output Router](output-router.md): compact guide to routed retrieval, command output routing, vault recovery, and config.
39
+ - [Release evidence](release-evidence.md): current release evidence and deferred checks.
39
40
  - [ADRs](adr/README.md): durable release decisions.
@@ -6,7 +6,7 @@ Accepted.
6
6
 
7
7
  ## Decision
8
8
 
9
- Freeflow v0.1 ships plugin-bundled context-loading runtime: Codex/Claude hooks and a Pi extension that load existing workflow and interview-gate context. It still ships without enforcement hooks or CLI enforcement. Behavior must first be proven with baseline-vs-with-skill evals before mechanical enforcement is added.
9
+ Freeflow ships plugin-bundled context-loading runtime: Codex/Claude hooks and a Pi extension that load existing workflow and interview-gate context. It still ships without enforcement hooks or CLI enforcement. Behavior must first be proven with baseline-vs-with-skill evals before mechanical enforcement is added.
10
10
 
11
11
  ## Rationale
12
12
 
@@ -6,7 +6,7 @@ Accepted.
6
6
 
7
7
  ## Decision
8
8
 
9
- Freeflow v0.1 ships as a marketplace repo with one plugin runtime under `plugins/freeflow/`.
9
+ Freeflow ships as a marketplace repo with one plugin runtime under `plugins/freeflow/`.
10
10
 
11
11
  The plugin runtime includes skills, bundled references, context-loading runtime, public docs, eval sources/reports, command-surface metadata, Codex/Claude metadata, and Pi package metadata/extension.
12
12
 
@@ -0,0 +1,26 @@
1
+ # ADR 0004: Research Replaces Shallow Discovery Skills
2
+
3
+ ## Status
4
+
5
+ Accepted.
6
+
7
+ ## Decision
8
+
9
+ Freeflow uses one active `research` skill for discovery work before spec, plan, build, or durable memory.
10
+
11
+ The previous active skills `research-brief`, `grill-context`, and `capture-decisions` are deprecated and moved to root `deprecated/skills/`. They are no longer part of the runtime skill surface or direct command surface.
12
+
13
+ The active direct command is `/research`.
14
+
15
+ ## Rationale
16
+
17
+ The three older skills were useful independently but shallow as a workflow module. In real use, research, brainstorming, targeted questions, and decision checkpointing need to interleave. Splitting them made the user or agent coordinate the sequence and made long grilling chains or uncaptured research decisions more likely.
18
+
19
+ The `research` skill uses the same module/interface/depth/seam/leverage/locality language as architecture review so discovery can shape deep modules from the beginning, not only rescue shallow code later.
20
+
21
+ ## Consequences
22
+
23
+ - `/research-brief`, `/grill-context`, and `/capture-decisions` are removed from the current command surface.
24
+ - Historical evals and reports for the deprecated skills remain as development evidence.
25
+ - Current discovery eval evidence lives in `plugins/freeflow/evals/reports/by-skill/research-1-report.md`.
26
+ - Durable decisions now belong to the checkpoint destination chosen by `research`: spec, plan, handoff, decision note, ADR, domain memory, or chat.
@@ -4,4 +4,5 @@ Durable decisions for the public Freeflow package:
4
4
 
5
5
  - [ADR 0001: Three Workflow Modes](0001-three-modes.md)
6
6
  - [ADR 0002: Evals Before Enforcement Hooks](0002-evals-before-hooks.md)
7
- - [ADR 0003: v0.1 Release Boundary](0003-release-boundary.md)
7
+ - [ADR 0003: Release Boundary](0003-release-boundary.md)
8
+ - [ADR 0004: Research Replaces Shallow Discovery Skills](0004-research-replaces-shallow-discovery-skills.md)
@@ -4,7 +4,7 @@ Freeflow is a portable skill pack for coding agents.
4
4
 
5
5
  ## Runtime Boundary
6
6
 
7
- Freeflow ships Markdown skills, bundled references, lightweight context-loading hooks, and a Pi extension. It does not ship a CLI, Codex/Claude native slash handlers, enforcement hooks, or a new agent runtime in v0.1.
7
+ Freeflow ships Markdown skills, bundled references, lightweight context-loading hooks, and a Pi extension. It does not ship a CLI, Codex/Claude native slash handlers, enforcement hooks, or a new agent runtime in this release.
8
8
 
9
9
  Host runtimes still control tools, sandboxing, approvals, and permissions. Freeflow controls workflow pressure:
10
10
 
@@ -77,10 +77,10 @@ Setup handles the same-session case directly: after successful setup verificatio
77
77
 
78
78
  Host runtimes may require plugin hooks to be reviewed and trusted after install. If the host skips untrusted hooks, setup still writes activation/config files, but future session-start runtime context will not load until hooks are trusted and the session is restarted, resumed, cleared, or compacted.
79
79
 
80
- Pi uses an extension instead of `hooks/hooks.json`. The Pi extension registers direct commands, reads `workflow/SKILL.md`, `workflow/references/workflow-map.md`, and `interview-gate/SKILL.md`, refreshes that context on `session_start` and `session_compact`, and injects it during Pi's `before_agent_start` lifecycle event. Pi `/workflow` commands set a session-scoped current-mode override, while `.freeflow/config.json` remains the default-mode source. It follows the same boundary as the Codex/Claude hooks: context loading only, no enforcement.
80
+ Pi uses an extension instead of `hooks/hooks.json`. The Pi extension registers direct commands, reads `workflow/SKILL.md`, `workflow/references/workflow-map.md`, `interview-gate/SKILL.md`, `output-router/SKILL.md`, and `output-router/references/safety-policy.md`, refreshes that context on `session_start` and `session_compact`, and injects it during Pi's `before_agent_start` lifecycle event. The same extension registers `freeflow_retrieve` and `freeflow_run` and gives them compact/expanded TUI renderers so collapsed tool rows stay readable while `ctrl+o` shows structured evidence and recovery details. Pi `/workflow` commands set a session-scoped current-mode override, while `.freeflow/config.json` remains the default-mode source. It follows the same boundary as the Codex/Claude hooks: context loading only, no enforcement.
81
81
 
82
82
  ## Deferred Enforcement
83
83
 
84
84
  Enforcement hooks and CLI checks are intentionally deferred. They are useful only after skill wording and evals prove a repeated behavior needs mechanical enforcement.
85
85
 
86
- For v0.1, commands are model-routed language such as `/write-spec` or `/verify-work`; they are not native registered slash handlers.
86
+ For this release, commands are model-routed language such as `/write-spec` or `/verify-work`; they are not native registered slash handlers.
@@ -0,0 +1,212 @@
1
+ # Output Router
2
+
3
+ Freeflow Output Router keeps agent context focused while preserving exact evidence outside context.
4
+
5
+ Use it when broad repo exploration, generated artifacts, large logs, or noisy command output would otherwise flood the model.
6
+
7
+ For the full architecture, see [`docs/designs/freeflow-output-router-architecture.md`](../../../docs/designs/freeflow-output-router-architecture.md) in the repo root.
8
+
9
+ ## Core Idea
10
+
11
+ ```text
12
+ smallest sufficient evidence in context
13
+ + exact raw recovery outside context
14
+ + no surprise native tool semantics
15
+ ```
16
+
17
+ The router ships two explicit tools:
18
+
19
+ - `freeflow_retrieve`: retrieve targeted repo/vault evidence.
20
+ - `freeflow_run`: run likely-large/noisy commands, vault raw output, and return compact evidence.
21
+
22
+ Native tools still matter:
23
+
24
+ - use native `read` for known whole files,
25
+ - use native `bash` for small/direct raw shell behavior,
26
+ - use native `edit`/`write` for mutations.
27
+
28
+ ## Tiny Map
29
+
30
+ ```mermaid
31
+ flowchart LR
32
+ Agent[agent]
33
+ Retrieve[freeflow_retrieve]
34
+ Run[freeflow_run]
35
+ Repo[repo files]
36
+ Vault[Freeflow vault]
37
+ Native[native read/bash]
38
+ Evidence[bounded evidence]
39
+ Raw[exact recovery]
40
+
41
+ Agent -->|existing info| Retrieve
42
+ Agent -->|noisy command| Run
43
+ Agent -->|direct/raw known output| Native
44
+ Retrieve --> Repo --> Evidence
45
+ Retrieve --> Vault --> Evidence
46
+ Run --> Vault
47
+ Run --> Evidence
48
+ Vault --> Raw
49
+ ```
50
+
51
+ ## Tool Choice
52
+
53
+ | Need | Use |
54
+ | --- | --- |
55
+ | Find repo evidence before reading files | `freeflow_retrieve action=query` |
56
+ | Get candidate paths first | `freeflow_retrieve action=locate` |
57
+ | Retrieve exact repo/vault lines | `freeflow_retrieve action=retrieve` with `lineRange` |
58
+ | Widen previous evidence | `freeflow_retrieve action=expand` |
59
+ | Explain a previous routed decision/output | `freeflow_retrieve action=explain` |
60
+ | Run noisy/large command output | `freeflow_run` |
61
+ | Read a known whole file | native `read` |
62
+ | Run small exact command | native `bash` |
63
+
64
+ ## `freeflow_retrieve`
65
+
66
+ Sources:
67
+
68
+ - `repo`: local repo files.
69
+ - `vault`: previous routed command/native output.
70
+
71
+ Actions:
72
+
73
+ - `query`: returns best evidence packets; default `topK=1`.
74
+ - `locate`: returns candidate locations; default `topK=5`.
75
+ - `retrieve`: returns explicit path/line range evidence.
76
+ - `expand`: expands a previous evidence packet to `lines_30`, `lines_80`, or `full`.
77
+ - `explain`: explains a route decision or vault output.
78
+
79
+ Example:
80
+
81
+ ```json
82
+ {
83
+ "action": "query",
84
+ "source": { "kind": "repo" },
85
+ "query": "Sandbox Permissions UseDefault RequireEscalated WithAdditionalPermissions",
86
+ "preserve": "important"
87
+ }
88
+ ```
89
+
90
+ Evidence packets include:
91
+
92
+ - source/path,
93
+ - line range,
94
+ - exact excerpt,
95
+ - why the router selected it,
96
+ - expansion/recovery guidance.
97
+
98
+ Repo retrieval uses deterministic scanner ranking by default. Broad scans skip generated/dependency/cache paths such as `graphify-out/**`, but explicit path retrieval remains available.
99
+
100
+ ## `freeflow_run`
101
+
102
+ `freeflow_run` executes once through the host-approved runner, stores exact raw output in the vault, then returns useful command evidence.
103
+
104
+ Example:
105
+
106
+ ```json
107
+ {
108
+ "command": "npm test",
109
+ "goal": "verification",
110
+ "preserve": "important"
111
+ }
112
+ ```
113
+
114
+ Returned results include:
115
+
116
+ - `outputId`,
117
+ - `execution.status` and `exitCode`,
118
+ - parser metadata,
119
+ - important lines,
120
+ - exact recovery instructions.
121
+
122
+ Command parsers currently cover:
123
+
124
+ - test runner output,
125
+ - TypeScript/lint diagnostics,
126
+ - git status/diffstat,
127
+ - build/toolchain errors,
128
+ - generic fallback,
129
+ - duplicate output detection.
130
+
131
+ ## Vault Recovery
132
+
133
+ Recover exact command output with:
134
+
135
+ ```json
136
+ {
137
+ "action": "retrieve",
138
+ "source": { "kind": "vault", "outputId": "ffout_...", "stream": "combined" },
139
+ "lineRange": { "start": 1, "end": 40 },
140
+ "preserve": "full"
141
+ }
142
+ ```
143
+
144
+ Streams:
145
+
146
+ - command output: `stdout`, `stderr`, `combined`,
147
+ - native safety-net output: `raw`.
148
+
149
+ Default vault root:
150
+
151
+ ```text
152
+ ~/.cache/freeflow-router/vault
153
+ ```
154
+
155
+ ## Config
156
+
157
+ The router works with built-in defaults. Minimal `/setup-freeflow` writes only `defaultMode`.
158
+
159
+ Optional repo config lives in `.freeflow/config.json` only when explicitly requested:
160
+
161
+ ```json
162
+ {
163
+ "defaultMode": "workflow",
164
+ "outputRouter": {
165
+ "postToolRouting": "off",
166
+ "largeOutputBytes": 64000,
167
+ "largeOutputLines": 1000,
168
+ "vaultRoot": "~/.cache/freeflow-router/vault",
169
+ "vaultRetentionDays": 7,
170
+ "generatedPaths": ["graphify-out/**"],
171
+ "noisyCommandHints": ["npm test"]
172
+ }
173
+ }
174
+ ```
175
+
176
+ Rules:
177
+
178
+ - `postToolRouting` defaults to `off`.
179
+ - `safety-net` is opt-in.
180
+ - `strict` is reserved.
181
+ - Do not dump defaults into config.
182
+ - Write only requested keys.
183
+
184
+ ## Native Safety Net
185
+
186
+ Pi can optionally route large native `read`/`bash` results after the tool runs.
187
+
188
+ Default: off.
189
+
190
+ When enabled, a routed native result is labeled, vaulted, and includes an `outputId`. If safety-net routing fails, Freeflow fails open and returns native output with a warning.
191
+
192
+ ## Defaults And Experiments
193
+
194
+ Current adoption decisions:
195
+
196
+ - Scanner retrieval is the default backend.
197
+ - The no-dependency local index is experimental and not adopted by default.
198
+ - SQLite/FTS is not adopted.
199
+ - Model-assisted routing is not default.
200
+ - Graphify, Claude Context, RTK, and Squeez are optional references/comparators, not dependencies.
201
+
202
+ ## Evidence
203
+
204
+ Current release evidence:
205
+
206
+ - Retrieval benchmark: improved router passed 7/7 fixtures.
207
+ - Command benchmark: `freeflow_run` passed 8/8 fixtures with exact recovery.
208
+ - Optional index benchmark: scanner remains default; index not adopted.
209
+ - Codex Structured Q&A benchmark: improved router passed the Sandbox Permissions fixture where native broad search selected `graphify-out/graph.html`.
210
+ - Setup eval: optional `outputRouter` config is opt-in; minimal setup remains only `defaultMode`.
211
+
212
+ See `release-evidence.md` and runtime reports under `plugins/freeflow/evals/reports/runtime/`.
@@ -1,6 +1,6 @@
1
1
  # Release Evidence
2
2
 
3
- Freeflow v0.1 is based on local fixture evals and release acceptance runs from the development repository.
3
+ Freeflow v0.2.0 is based on the v0.1 local acceptance suite plus targeted runtime, setup, and output-router evidence from the development repository.
4
4
 
5
5
  ## Acceptance Summary
6
6
 
@@ -12,7 +12,7 @@ High-signal behaviors covered:
12
12
  - Strict public API specs ask for owner decisions.
13
13
  - Execution stops when verification reveals a bad plan.
14
14
  - Commit flow refuses mixed staged sensitive changes.
15
- - Decision capture asks before inventing memory conventions.
15
+ - Research checkpoints replace separate research, grilling, and decision-capture commands for discovery work.
16
16
  - Bypass skips ceremony, not judgment.
17
17
 
18
18
  ## Command Surface
@@ -20,19 +20,39 @@ High-signal behaviors covered:
20
20
  The development registry covers:
21
21
 
22
22
  - 4 mode commands.
23
- - 13 direct workflow skill calls.
23
+ - 11 direct workflow skill calls.
24
24
  - 2 contributor skill calls.
25
25
 
26
- Codex/Claude native slash handlers are not shipped in v0.1. In those hosts, commands are model-routed through natural language and skill activation. Pi registers direct Freeflow commands through its extension.
26
+ Codex/Claude native slash handlers are not shipped in this release. In those hosts, commands are model-routed through natural language and skill activation. Pi registers direct Freeflow commands through its extension.
27
27
 
28
28
  ## Runtime Context
29
29
 
30
- Freeflow ships plugin-bundled context hooks that load the existing `workflow` skill, workflow map, and `interview-gate` skill at session start. These hooks do not run after edit/write tools, enforce behavior, block tools, or create repo-local hook files.
30
+ Freeflow ships plugin-bundled context hooks that load the existing `workflow` skill, workflow map, and `interview-gate` skill at session start. The Pi extension also loads output-router context, including its safety-policy reference, when the routed tools are available. These hooks do not run after edit/write tools, enforce behavior, block tools, or create repo-local hook files.
31
31
 
32
32
  For the same session that runs setup, `setup-freeflow` reads the workflow skill, workflow map, and interview-gate skill after successful setup verification before saying workflow and interview-gate context is loaded.
33
33
 
34
34
  Host trust prompts for plugin hooks are expected host behavior. Local metadata validation checks hook packaging and deterministic output, not end-to-end host trust UI.
35
35
 
36
+ ## Output Router Evidence
37
+
38
+ Output-router behavior is backed by deterministic runtime reports under `plugins/freeflow/evals/reports/runtime/`.
39
+
40
+ Verified in the development repo:
41
+
42
+ - Retrieval benchmark: improved router passed 7/7 gated fixtures and fixed the generated-artifact Sandbox Permissions false-positive shape.
43
+ - Command-output benchmark: `freeflow_run` passed 8/8 fixtures, preserved exact facts, and verified raw vault recovery.
44
+ - Optional local index benchmark: scanner remains default, index is not adopted by default, and the no-dependency index remains experimental.
45
+ - Codex Structured Q&A macro benchmark: improved router passed the first Sandbox Permissions Q&A fixture while the native broad-search proxy selected `graphify-out/graph.html`.
46
+ - Large Codex scanner benchmark: scanner remains the retrieval backend; latest recorded report-refresh evidence kept scanner at 6/8 strict fixtures with bounded context.
47
+ - Setup/config eval: `setup-freeflow` supports optional `outputRouter` repo config only when explicitly requested; minimal setup still writes only `defaultMode`.
48
+
49
+ Adoption decisions:
50
+
51
+ - Scanner improvements ship as default behavior.
52
+ - Native post-tool safety-net routing remains off unless explicitly configured.
53
+ - The no-dependency local index stays experimental.
54
+ - SQLite/FTS, model-assisted routing, Graphify, and Claude Context remain optional/non-default comparison paths, not product dependencies.
55
+
36
56
  ## Release Metadata
37
57
 
38
58
  Run `plugins/freeflow/evals/scripts/validate-release-metadata.sh` for local prepublish checks across marketplace metadata, host manifests, command-surface routing, release-boundary docs, package cleanliness, and deferred install-smoke status.
@@ -1,6 +1,6 @@
1
1
  # Skills
2
2
 
3
- Freeflow ships a small workflow skill pack. Natural language is the preferred interface. In Codex/Claude, slash-style phrases work as model-routed skill hints in v0.1; in Pi, the extension registers direct Freeflow commands.
3
+ Freeflow ships a small workflow skill pack. Natural language is the preferred interface. In Codex/Claude, slash-style phrases work as model-routed skill hints; in Pi, the extension registers direct Freeflow commands.
4
4
 
5
5
  ## Core
6
6
 
@@ -9,29 +9,28 @@ Freeflow ships a small workflow skill pack. Natural language is the preferred in
9
9
  | `workflow` | Choosing the next workflow entry point or explaining the full flow. |
10
10
  | `mode-contract` | Inferring or switching `conversation`, `workflow`, or `strict-workflow`. |
11
11
  | `interview-gate` | Ambiguity or a user-owned decision would change the next action. |
12
+ | `output-router` | Choosing routed tools for large/noisy output, vault recovery, or output-router configuration. |
12
13
  | `bypass` | Skipping unnecessary ceremony without skipping judgment. |
13
14
 
14
15
  ## Discovery And Artifacts
15
16
 
16
17
  | Skill | Use When |
17
18
  | --- | --- |
18
- | `research-brief` | Repo, domain, evidence, or current facts are unknown. |
19
- | `grill-context` | Direction is vague and a decision tree needs clarification. |
19
+ | `research` | An idea, feature, architecture direction, vague task, or consequential question needs evidence, brainstorming, targeted questions, and a checkpoint before spec, plan, build, or durable memory. |
20
20
  | `write-spec` | Agreed requirements or decisions need a durable spec. |
21
- | `review-artifact` | A spec, plan, handoff, research brief, or decision note must guide future work. |
21
+ | `review-artifact` | A spec, plan, handoff, research checkpoint, or decision note must guide future work. |
22
22
  | `write-plan` | An approved spec or explicit task context needs executable slices. |
23
23
 
24
24
  ## Execution And Closeout
25
25
 
26
26
  | Skill | Use When |
27
27
  | --- | --- |
28
- | `execute-plan` | An approved plan exists and should be implemented in checked slices. |
28
+ | `execute-plan` | An approved plan exists and should be implemented in checked slices, especially multi-slice/TDD work with verification, review, commit, or handoff checkpoints. |
29
29
  | `diagnose-failure` | Behavior is broken, failing, flaky, slow, or unclear. |
30
- | `review-work` | A completed diff or review feedback needs bug/risk-focused review. |
30
+ | `review-work` | A completed diff or review feedback needs bug/risk-focused review or adjudication before fixes. |
31
31
  | `verify-work` | Fresh evidence is needed before claiming completion. |
32
32
  | `commit-work` | Reviewed, verified, intended work is ready to commit. |
33
33
  | `handoff` | Pausing, compacting, transferring context, or preserving continuation memory. |
34
- | `capture-decisions` | Stable decisions, glossary terms, rejected approaches, or ADR-worthy tradeoffs should be recorded. |
35
34
 
36
35
  ## Contributor Skills
37
36
 
@@ -16,7 +16,7 @@ Use strict-workflow for security, privacy, billing, public APIs, migrations, dat
16
16
  flowchart LR
17
17
  Request{request}
18
18
  Talk[conversation<br/>answer directly]
19
- Discover[discover<br/>research / grill]
19
+ Discover[discover<br/>research checkpoint]
20
20
  Spec[spec]
21
21
  Plan[plan]
22
22
  Build[build<br/>execute / diagnose]
@@ -71,17 +71,34 @@ function readConfig(root) {
71
71
 
72
72
  try {
73
73
  const parsed = JSON.parse(body);
74
- const keys = Object.keys(parsed);
75
- const valid =
76
- keys.length === 1 &&
77
- Object.prototype.hasOwnProperty.call(parsed, "defaultMode") &&
78
- VALID_MODES.has(parsed.defaultMode);
79
- return { exists: true, valid, defaultMode: parsed.defaultMode ?? null };
74
+ const valid = isValidSetupConfig(parsed);
75
+ return { exists: true, valid, defaultMode: parsed?.defaultMode ?? null };
80
76
  } catch {
81
77
  return { exists: true, valid: false, defaultMode: null };
82
78
  }
83
79
  }
84
80
 
81
+ function isValidSetupConfig(value) {
82
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
83
+ return false;
84
+ }
85
+
86
+ const allowedKeys = new Set(["defaultMode", "outputRouter"]);
87
+ if (!Object.keys(value).every((key) => allowedKeys.has(key))) {
88
+ return false;
89
+ }
90
+
91
+ if (!Object.prototype.hasOwnProperty.call(value, "defaultMode") || !VALID_MODES.has(value.defaultMode)) {
92
+ return false;
93
+ }
94
+
95
+ if (!Object.prototype.hasOwnProperty.call(value, "outputRouter")) {
96
+ return true;
97
+ }
98
+
99
+ return Boolean(value.outputRouter) && typeof value.outputRouter === "object" && !Array.isArray(value.outputRouter);
100
+ }
101
+
85
102
  function inspectSetup(root) {
86
103
  const config = readConfig(root);
87
104
  const agents = readText(path.join(root, "AGENTS.md")) || "";