From 7fec859cafe60c32fd3728ce8b21d097364ce6c3 Mon Sep 17 00:00:00 2001 From: Jonas Haugesen Date: Fri, 10 Apr 2026 11:12:16 +0200 Subject: [PATCH] changed to mimo model --- CLAUDE.md | 1 - config.json | 6 +++--- src/config.ts | 6 +++--- src/git.ts | 36 ++++++++++++++++++++++++++++++++++++ src/index.ts | 28 +++++++++++++++++++++++++++- 5 files changed, 69 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9a4632e..d411f85 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -25,7 +25,6 @@ Panopticon is a nightly batch system that maintains up-to-date, LLM-optimized pr - All pi SDK sessions are created via `createSession()` in `session.ts` - Workers get read-only tools; orchestrator and synthesizer get no tools - Prompts live in `prompts/` directory as standalone markdown files -- Models default to Anthropic (claude-sonnet-4-5 for smart, claude-haiku-4-5 for cheap) - Config is in `config.json` at project root - State persisted in `state/` directory, run reports in `runs/` diff --git a/config.json b/config.json index ecfdffc..19a1929 100644 --- a/config.json +++ b/config.json @@ -10,9 +10,9 @@ } ], "models": { - "orchestrator": "anthropic/claude-sonnet-4-5", - "worker": "anthropic/claude-haiku-4-5", - "synthesizer": "anthropic/claude-sonnet-4-5" + "orchestrator": "opencode-go/mimo-v2-pro", + "worker": "opencode-go/mimo-v2-pro", + "synthesizer": "opencode-go/mimo-v2-pro" }, "thinkingLevels": { "orchestrator": "medium", diff --git a/src/config.ts b/src/config.ts index d8194d2..4f3c0c8 100644 --- a/src/config.ts +++ b/src/config.ts @@ -17,9 +17,9 @@ const DEFAULT_METRICS: MetricsConfig = { }; const DEFAULT_MODELS: ModelsConfig = { - orchestrator: "anthropic/claude-sonnet-4-5", - worker: "anthropic/claude-haiku-4-5", - synthesizer: "anthropic/claude-sonnet-4-5", + orchestrator: "opencode-go/mimo-v2-pro", + worker: "opencode-go/mimo-v2-pro", + synthesizer: "opencode-go/mimo-v2-pro", }; const DEFAULT_THINKING: ThinkingConfig = { diff --git a/src/git.ts b/src/git.ts index f013866..b12ef1f 100644 --- a/src/git.ts +++ b/src/git.ts @@ -127,6 +127,42 @@ export function getDirstat(projectPath: string, lastSha: string): string { } } +/** + * Stage, commit, and push changes in the skill directory for a project. + * Returns true if a commit was made, false if there was nothing to commit. + */ +export function commitAndPushSkillDocs( + projectPath: string, + projectName: string, + branch: string +): boolean { + const skillDir = ".pi/skills/panopticon"; + + // Stage all changes in the skill directory + git(projectPath, `add ${skillDir}`); + + // Check if there are staged changes + try { + git(projectPath, "diff --cached --quiet"); + // If the above succeeds (exit 0), there are no staged changes + return false; + } catch { + // Exit code 1 means there are staged changes — this is expected + } + + const commitMessage = `docs: panopticon auto-update for ${projectName}`; + git(projectPath, `commit -m "${commitMessage}"`); + + // Push (non-fatal if no remote) + try { + git(projectPath, `push origin ${branch}`); + } catch { + // Local-only repo or push failed — not critical + } + + return true; +} + // Simple glob matching (supports ** and *) function matchGlob(path: string, glob: string): boolean { const regex = glob diff --git a/src/index.ts b/src/index.ts index 58f8e71..2d70118 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,7 +11,7 @@ import { resolve } from "path"; import { loadConfig } from "./config.js"; -import { getCurrentSha, pull, getFileTree, getDiffSince } from "./git.js"; +import { getCurrentSha, pull, getFileTree, getDiffSince, commitAndPushSkillDocs } from "./git.js"; import { gatherStructuralContext, hashFileAtPath } from "./structural.js"; import { loadState, saveState } from "./state.js"; import { readAllSkillFiles, readSkillFile, writeSkillFiles, countLinesChanged, cleanSkillDir } from "./writer.js"; @@ -274,6 +274,19 @@ async function runFullAnalysis( ), }); + // Commit and push skill doc changes + try { + const committed = commitAndPushSkillDocs(project.path, project.name, project.branch); + if (committed) { + console.log(` Committed and pushed skill doc updates`); + } else { + console.log(` No skill doc changes to commit`); + } + } catch (err: any) { + errors.push(`Git commit/push error: ${err.message}`); + console.log(` Warning: failed to commit/push: ${err.message}`); + } + // Doc line changes const docLinesChanged: Record = {}; for (const [file, content] of Object.entries(filesToWrite)) { @@ -482,6 +495,19 @@ async function runIncremental( lastRunStatus: errors.length === 0 ? "success" : "partial", }); + // Commit and push skill doc changes + try { + const committed = commitAndPushSkillDocs(project.path, project.name, project.branch); + if (committed) { + console.log(` Committed and pushed skill doc updates`); + } else { + console.log(` No skill doc changes to commit`); + } + } catch (err: any) { + errors.push(`Git commit/push error: ${err.message}`); + console.log(` Warning: failed to commit/push: ${err.message}`); + } + // Doc line changes const docLinesChanged: Record = {}; for (const [file, content] of Object.entries(filesToWrite)) {