helixevo 0.3.0 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,41 @@
2
2
 
3
3
  All notable changes to HelixEvo are documented here.
4
4
 
5
+ ## [Unreleased]
6
+
7
+ ## [0.4.0] - 2026-03-24
8
+
9
+ ### Added
10
+ - Dedicated **Co-Evolution** dashboard route and pressure-response control surface for routed interventions, lifecycle visibility, and operator control
11
+ - Persistent pressure intervention history in `~/.helix/pressure-interventions.jsonl` so research, specialize, evolve, generalize, and manual review responses become part of the brain ledger
12
+ - Governed route recommendations, pressure motif aggregation, and transfer-event persistence in `~/.helix/transfer-events.jsonl` for reusable cross-project promotion evidence
13
+ - Dedicated **Topology** dashboard route for governed structural review, including persistent open/deferred/accepted/rejected queue visibility
14
+ - Operator governance steering persisted in `~/.helix/governance-state.json` and surfaced across runtime summaries plus the dashboard
15
+ - Persistent topology review candidate queue in `~/.helix/topology-review-candidates.json` with decision ledger in `~/.helix/topology-review-decisions.jsonl`
16
+ - `graph --optimize` now refreshes topology review candidates for merge, split, promote, consolidate, and rewire review
17
+ - New reviewed topology execution state in:
18
+ - `~/.helix/topology-overrides.json`
19
+ - `~/.helix/topology-snapshots.json`
20
+ - `~/.helix/topology-apply-plans.json`
21
+ - `~/.helix/topology-executions.jsonl`
22
+ - `~/.helix/topology-artifacts.jsonl`
23
+ - New `helixevo topology` command for status, prepare, apply, and rollback control
24
+ - New `/api/topology-apply` dashboard route for reviewed execution actions via the local CLI runner
25
+
26
+ ### Changed
27
+ - HelixEvo now closes more of the brain loop from pressure sensing to governed response, transfer promotion, topology review, and safe reviewed structural execution
28
+ - Overview, Co-Evolution, Research, Projects, and Skill Network now surface pressure, governance, transfer, topology review, and topology execution state in parallel
29
+ - `generalize` now acts as a governed network-level intervention lane that can address recurring motifs via transfer evidence without falsely closing local signal lifecycle
30
+ - `manual-review` is now a real operator workflow backed by persisted review candidates and explicit decisions rather than only a routing label
31
+ - Accepted topology review candidates can now progress into prepared plans, safe structural apply, snapshot-backed rollback, and visible execution history on `/topology`
32
+
33
+ ## [0.3.1] - 2026-03-23
34
+
35
+ ### Fixed
36
+ - `helixevo dashboard` now recovers cleanly when the preferred port is occupied: it reuses a known managed dashboard if one is already running there, otherwise it falls forward to the next open port instead of failing with `EADDRINUSE`
37
+ - Added `helixevo dashboard --port <port>` so operators can choose a preferred starting port while preserving automatic fallback behavior
38
+ - Background dashboard stop/reuse logic now tracks the actual assigned port, so `helixevo dashboard --stop` works correctly even after fallback to a non-default port
39
+
5
40
  ## [0.3.0] - 2026-03-23
6
41
 
7
42
  ### Added
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # HelixEvo
2
2
 
3
- Co-evolving skill and project brain for AI agents. HelixEvo captures failures, traces activations, models pressure, evolves skills through multi-judge evaluation, and maintains a Pareto frontier of optimal skill configurations.
3
+ Co-evolving skill and project brain for AI agents. HelixEvo captures failures, traces activations, models pressure, routes governed responses, promotes cross-project transfer, reviews structural topology changes, safely executes accepted topology transitions with rollback, and maintains a Pareto frontier of optimal skill configurations.
4
4
 
5
5
  ## How it works
6
6
 
@@ -89,8 +89,9 @@ helixevo dashboard
89
89
  | `helixevo generalize` | Promote cross-project patterns ↑ |
90
90
  | `helixevo specialize --project <name>` | Create project-specific skills ↓ |
91
91
  | `helixevo graph` | View skill network in terminal |
92
+ | `helixevo topology` | Prepare, apply, roll back, and inspect reviewed topology execution |
92
93
  | `helixevo research` | Proactive web research for skill improvement |
93
- | `helixevo dashboard` | Open web dashboard at localhost:3847 |
94
+ | `helixevo dashboard [--port <n>]` | Open web dashboard, preferring localhost:3847 and falling forward if occupied |
94
95
  | `helixevo status` | Show system health |
95
96
  | `helixevo report` | Generate evolution report |
96
97
 
@@ -107,7 +108,11 @@ helixevo graph # TUI view (instant, cached)
107
108
  helixevo graph --mermaid # Open in browser as Mermaid diagram
108
109
  helixevo graph --obsidian ~/vault # Sync to Obsidian vault
109
110
  helixevo graph --rebuild # Re-infer relationships (LLM call)
110
- helixevo graph --optimize # Detect merge/split/conflict opportunities
111
+ helixevo graph --optimize # Detect structural candidates + refresh topology review queue
112
+ helixevo topology --status # Show reviewed topology execution state
113
+ helixevo topology --prepare <id> # Prepare an accepted topology candidate
114
+ helixevo topology --apply <id> # Apply a safe prepared topology plan
115
+ helixevo topology --rollback <id> # Roll back an applied topology plan
111
116
  ```
112
117
 
113
118
  ### Research options
@@ -129,6 +134,16 @@ All data is stored in `~/.helix/`:
129
134
  ├── failures.jsonl # Captured failures
130
135
  ├── activation-traces.jsonl # Native + derived activation traces
131
136
  ├── pressure-signals.jsonl # Native + derived adaptation pressure
137
+ ├── pressure-interventions.jsonl # Routed intervention ledger across response lanes
138
+ ├── transfer-events.jsonl # Promotion / transfer evidence across motifs and projects
139
+ ├── governance-state.json # Operator steering for active governance mode
140
+ ├── topology-review-candidates.json # Persisted structural review queue
141
+ ├── topology-review-decisions.jsonl # Operator accept/reject/defer decision ledger
142
+ ├── topology-overrides.json # Applied safe structural topology overrides
143
+ ├── topology-snapshots.json # Snapshot refs for reviewed execution and rollback
144
+ ├── topology-apply-plans.json # Prepared reviewed topology plans
145
+ ├── topology-executions.jsonl # Prepared/applied/rolled-back execution ledger
146
+ ├── topology-artifacts.jsonl # Evidence artifacts for reviewed structural execution
132
147
  ├── evolution-artifacts.jsonl # Evolution evidence artifacts per proposal/iteration
133
148
  ├── frontier.json # Pareto frontier (top-k configurations)
134
149
  ├── evolution-history.json # All evolution runs + proposals
@@ -149,15 +164,20 @@ The dashboard provides an interactive view of your skill ecosystem:
149
164
 
150
165
  ```bash
151
166
  helixevo dashboard
152
- # Opens http://localhost:3847
167
+ # Prefers http://localhost:3847 and falls forward if that port is occupied
168
+
169
+ helixevo dashboard --port 3900
170
+ # Prefer port 3900 first
153
171
  ```
154
172
 
155
173
  **Tabs:**
156
- - **Overview** — Premium control cockpit with frontier signals, brain foundation, semantic backbone, and pressure counts
157
- - **Skill Network** — Interactive graph, premium inspector, and co-evolution pressure routing signals
158
- - **Projects** — Project intake studio, live project analysis, gap routing, and per-project pressure hotspots
174
+ - **Overview** — Premium control cockpit with frontier signals, brain foundation, semantic backbone, pressure counts, topology review visibility, and prepared/applied structural state
175
+ - **Skill Network** — Interactive graph, premium inspector, co-evolution routing signals, and topology review/execution handoff links
176
+ - **Co-Evolution** — Operator cockpit for routed pressure response, governance mode visibility, promotion queues, transfer evidence, and topology handoff
177
+ - **Topology** — Governance steering plus a persistent operator pipeline for review → prepare → apply → rollback across merge / split / promote / rewire / consolidate candidates
178
+ - **Projects** — Project intake studio, live project analysis, gap routing, per-project pressure hotspots, and promotion feeders
159
179
  - **Evolution** — Timeline of evolution runs with judge scores, artifact provenance, and activation-aware context
160
- - **Research** — Knowledge buffer plus a live “why research now” handoff from current pressure and recurring gaps
180
+ - **Research** — Knowledge buffer plus a live “why research now” handoff from current pressure, governed routing, and recurring gaps
161
181
  - **Frontier** — Pareto frontier with 4-dimension scores + canary status
162
182
 
163
183
  The dashboard requires Next.js dependencies. On first run:
@@ -194,6 +214,11 @@ Failures → Cluster → Propose → Replay → Multi-Judge → Regression → C
194
214
  - **Ontology** defines the stable semantic kernel for skills, projects, tasks, capabilities, artifacts, and mutations.
195
215
  - **Activation traces** record which skills and gaps were active during capture and project analysis.
196
216
  - **Pressure signals** turn failures and project gaps into explicit adaptation demand.
217
+ - **Pressure interventions** record how HelixEvo responded across research, specialize, evolve, generalize, and manual-review lanes.
218
+ - **Governed routing and transfer evidence** let recurring multi-project motifs bias toward promotion and show when reusable knowledge was actually realized.
219
+ - **Governance steering** lets the operator pin or release the active adaptation mode rather than relying only on derived routing.
220
+ - **Topology review** persists merge / split / promote / rewire / consolidate candidates so manual review is a real workflow.
221
+ - **Reviewed topology execution** turns accepted safe candidates into prepared plans, snapshot-backed applies, and rollbackable structural transitions.
197
222
  - **Evolution artifacts** preserve proposal-level evidence so the dashboard can show what changed, why, and with what provenance.
198
223
 
199
224
  **Three-layer hierarchy:**
@@ -0,0 +1,49 @@
1
+ import { mkdirSync, writeFileSync } from 'fs'
2
+ import { join } from 'path'
3
+ import { homedir } from 'os'
4
+ import { NextResponse } from 'next/server'
5
+ import { getActiveGovernanceSummary, loadGovernanceState } from '@/lib/data'
6
+
7
+ export const dynamic = 'force-dynamic'
8
+
9
+ const HELIX_DIR = join(homedir(), '.helix')
10
+ const STATE_PATH = join(HELIX_DIR, 'governance-state.json')
11
+ const MODES = new Set(['conservative', 'balanced', 'exploration', 'project-critical', 'consolidation-focused', 'transfer-focused'])
12
+
13
+ function ensureHelixDir() {
14
+ mkdirSync(HELIX_DIR, { recursive: true })
15
+ }
16
+
17
+ export async function GET() {
18
+ return NextResponse.json({
19
+ state: loadGovernanceState(),
20
+ summary: getActiveGovernanceSummary(),
21
+ })
22
+ }
23
+
24
+ export async function POST(request: Request) {
25
+ const body = await request.json() as { selectionMode?: 'auto' | 'manual'; manualMode?: string; note?: string }
26
+ const selectionMode = body.selectionMode === 'manual' && body.manualMode && MODES.has(body.manualMode)
27
+ ? 'manual'
28
+ : 'auto'
29
+
30
+ if (selectionMode === 'manual' && (!body.manualMode || !MODES.has(body.manualMode))) {
31
+ return NextResponse.json({ success: false, error: 'Invalid manual governance mode' }, { status: 400 })
32
+ }
33
+
34
+ ensureHelixDir()
35
+ const nextState = {
36
+ selectionMode,
37
+ manualMode: selectionMode === 'manual' ? body.manualMode : undefined,
38
+ updatedAt: new Date().toISOString(),
39
+ note: body.note?.trim() || undefined,
40
+ }
41
+
42
+ writeFileSync(STATE_PATH, JSON.stringify(nextState, null, 2))
43
+
44
+ return NextResponse.json({
45
+ success: true,
46
+ state: loadGovernanceState(),
47
+ summary: getActiveGovernanceSummary(),
48
+ })
49
+ }
@@ -18,17 +18,44 @@ const ALLOWED_COMMANDS: Record<string, { cmd: string; args: string[]; timeout: n
18
18
  'report': { cmd: 'helixevo', args: ['report', '--days', '7'], timeout: 30000 },
19
19
  }
20
20
 
21
+ function buildCommandEntry(body: { command: string; project?: string; path?: string }) {
22
+ const entry = ALLOWED_COMMANDS[body.command]
23
+ if (entry) return entry
24
+
25
+ if (body.command === 'specialize') {
26
+ if (!body.project) return null
27
+ return { cmd: 'helixevo', args: ['specialize', '--project', body.project, '--verbose'], timeout: 300000 }
28
+ }
29
+
30
+ if (body.command === 'specialize-dry') {
31
+ if (!body.project) return null
32
+ return { cmd: 'helixevo', args: ['specialize', '--project', body.project, '--dry-run', '--verbose'], timeout: 300000 }
33
+ }
34
+
35
+ if (body.command === 'research-project') {
36
+ if (!body.path) return null
37
+ return { cmd: 'helixevo', args: ['research', '--project', body.path, '--verbose'], timeout: 300000 }
38
+ }
39
+
40
+ if (body.command === 'research-project-dry') {
41
+ if (!body.path) return null
42
+ return { cmd: 'helixevo', args: ['research', '--project', body.path, '--dry-run', '--verbose'], timeout: 300000 }
43
+ }
44
+
45
+ return null
46
+ }
47
+
21
48
  let activeProcess: ChildProcess | null = null
22
49
  let activeCommand: string | null = null
23
50
 
24
51
  // POST — stream output via SSE
25
52
  export async function POST(request: Request) {
26
- const body = await request.json()
27
- const { command } = body as { command: string }
53
+ const body = await request.json() as { command: string; project?: string; path?: string }
54
+ const { command } = body
28
55
 
29
- const entry = ALLOWED_COMMANDS[command]
56
+ const entry = buildCommandEntry(body)
30
57
  if (!entry) {
31
- return NextResponse.json({ success: false, error: `Unknown command: ${command}` }, { status: 400 })
58
+ return NextResponse.json({ success: false, error: `Unknown or incomplete command: ${command}` }, { status: 400 })
32
59
  }
33
60
 
34
61
  // Kill any existing process
@@ -0,0 +1,80 @@
1
+ import { NextResponse } from 'next/server'
2
+ import { spawn } from 'child_process'
3
+ import { existsSync } from 'fs'
4
+ import { join } from 'path'
5
+ import { loadTopologyDashboardSummary } from '@/lib/data'
6
+
7
+ export const dynamic = 'force-dynamic'
8
+
9
+ function resolveTopologyRunner(): { cmd: string; argsPrefix: string[] } {
10
+ const candidates = [
11
+ join(process.cwd(), '..', 'dist', 'cli.js'),
12
+ join(process.cwd(), 'dist', 'cli.js'),
13
+ ]
14
+
15
+ for (const candidate of candidates) {
16
+ if (existsSync(candidate)) {
17
+ return { cmd: process.execPath, argsPrefix: [candidate] }
18
+ }
19
+ }
20
+
21
+ return { cmd: 'helixevo', argsPrefix: [] }
22
+ }
23
+
24
+ function runTopologyCommand(args: string[]): Promise<{ success: boolean; output: string }> {
25
+ return new Promise((resolve) => {
26
+ const runner = resolveTopologyRunner()
27
+ const child = spawn(runner.cmd, [...runner.argsPrefix, 'topology', ...args], {
28
+ env: { ...process.env },
29
+ stdio: ['ignore', 'pipe', 'pipe'],
30
+ })
31
+
32
+ let output = ''
33
+ child.stdout?.on('data', (chunk: Buffer) => {
34
+ output += chunk.toString()
35
+ })
36
+ child.stderr?.on('data', (chunk: Buffer) => {
37
+ output += chunk.toString()
38
+ })
39
+ child.on('close', (code) => {
40
+ resolve({ success: code === 0, output })
41
+ })
42
+ child.on('error', (err) => {
43
+ resolve({ success: false, output: `Error: ${err.message}` })
44
+ })
45
+ })
46
+ }
47
+
48
+ export async function GET() {
49
+ return NextResponse.json(loadTopologyDashboardSummary())
50
+ }
51
+
52
+ export async function POST(request: Request) {
53
+ const body = await request.json() as { action?: 'prepare' | 'apply' | 'rollback'; candidateId?: string; planId?: string }
54
+ if (!body.action) {
55
+ return NextResponse.json({ success: false, error: 'action is required' }, { status: 400 })
56
+ }
57
+
58
+ let args: string[] = []
59
+ if (body.action === 'prepare') {
60
+ if (!body.candidateId) return NextResponse.json({ success: false, error: 'candidateId is required for prepare' }, { status: 400 })
61
+ args = ['--prepare', body.candidateId]
62
+ } else if (body.action === 'apply') {
63
+ if (!body.planId) return NextResponse.json({ success: false, error: 'planId is required for apply' }, { status: 400 })
64
+ args = ['--apply', body.planId]
65
+ } else if (body.action === 'rollback') {
66
+ if (!body.planId) return NextResponse.json({ success: false, error: 'planId is required for rollback' }, { status: 400 })
67
+ args = ['--rollback', body.planId]
68
+ }
69
+
70
+ const result = await runTopologyCommand(args)
71
+ if (!result.success) {
72
+ return NextResponse.json({ success: false, error: result.output || 'Topology command failed' }, { status: 500 })
73
+ }
74
+
75
+ return NextResponse.json({
76
+ success: true,
77
+ output: result.output,
78
+ dashboard: loadTopologyDashboardSummary(),
79
+ })
80
+ }
@@ -0,0 +1,51 @@
1
+ import { mkdirSync, appendFileSync } from 'fs'
2
+ import { join } from 'path'
3
+ import { homedir } from 'os'
4
+ import { NextResponse } from 'next/server'
5
+ import { getActiveGovernanceSummary, loadResolvedTopologyReviewCandidates, loadTopologyDashboardSummary } from '@/lib/data'
6
+
7
+ export const dynamic = 'force-dynamic'
8
+
9
+ const HELIX_DIR = join(homedir(), '.helix')
10
+ const DECISIONS_PATH = join(HELIX_DIR, 'topology-review-decisions.jsonl')
11
+ const DECISIONS = new Set(['accepted', 'rejected', 'deferred'])
12
+
13
+ function ensureHelixDir() {
14
+ mkdirSync(HELIX_DIR, { recursive: true })
15
+ }
16
+
17
+ export async function GET() {
18
+ return NextResponse.json(loadTopologyDashboardSummary())
19
+ }
20
+
21
+ export async function POST(request: Request) {
22
+ const body = await request.json() as { candidateId?: string; decision?: 'accepted' | 'rejected' | 'deferred'; rationale?: string }
23
+ if (!body.candidateId || !body.decision || !DECISIONS.has(body.decision)) {
24
+ return NextResponse.json({ success: false, error: 'candidateId and a valid decision are required' }, { status: 400 })
25
+ }
26
+
27
+ const candidate = loadResolvedTopologyReviewCandidates().find((entry) => entry.id === body.candidateId)
28
+ if (!candidate) {
29
+ return NextResponse.json({ success: false, error: 'Unknown topology review candidate' }, { status: 404 })
30
+ }
31
+
32
+ const governance = getActiveGovernanceSummary()
33
+ const record = {
34
+ id: `topology_decision_${body.decision}_${body.candidateId}_${Date.now()}`.replace(/[^a-zA-Z0-9_-]/g, '-'),
35
+ candidateId: body.candidateId,
36
+ decision: body.decision,
37
+ decidedAt: new Date().toISOString(),
38
+ governanceMode: governance.activeMode,
39
+ rationale: body.rationale?.trim() || `${body.decision} via operator review`,
40
+ decidedBy: 'operator',
41
+ }
42
+
43
+ ensureHelixDir()
44
+ appendFileSync(DECISIONS_PATH, JSON.stringify(record) + '\n')
45
+
46
+ return NextResponse.json({
47
+ success: true,
48
+ candidate: loadResolvedTopologyReviewCandidates().find((entry) => entry.id === body.candidateId) ?? null,
49
+ dashboard: loadTopologyDashboardSummary(),
50
+ })
51
+ }