-
Notifications
You must be signed in to change notification settings - Fork 0
Harden autonomy dashboard and Obsidian integration #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "_comment_usage": "Legacy example only. Prefer .universal-refiner.example.json and copy that file to .universal-refiner.json. This file is safe to commit.", | ||
| "_comment_fields": "All fields are optional. Omit a section to use built-in defaults.", | ||
| "semantic": { | ||
| "_comment": "Configure the local OpenAI-compatible provider (Ollama, LM Studio, etc.)", | ||
| "localEnabled": true, | ||
| "baseUrl": "http://localhost:11434/v1", | ||
| "models": ["gemma3:12b", "gemma3"], | ||
| "mcpSamplingEnabled": true, | ||
| "timeoutMs": 120000, | ||
| "temperature": 0.2 | ||
| } | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| import { EventStore } from "../src/history/event-store.js"; | ||
| import { ObsidianOrchestrator } from "../src/integrations/obsidian/obsidian-orchestrator.js"; | ||
| import { ConfigManager } from "../src/core/config.js"; | ||
| import * as path from "path"; | ||
| import * as fs from "fs"; | ||
|
|
||
| /** | ||
| * Historical Migration Script | ||
| * Sweeps the EventStore (events.db) and pushes all old session data to the Obsidian Vault. | ||
| */ | ||
| async function migrate() { | ||
| console.log("Starting Historical Migration to Obsidian..."); | ||
|
|
||
| // Force the orchestrator to use the global obsidian vault | ||
| ConfigManager.getObsidianConfig = () => ({ vaultPath: "C:\\repo\\global.obsidian" }); | ||
|
|
||
| const store = EventStore.getInstance(); | ||
| const db = (store as any).db; | ||
|
|
||
| // 1. Get all unique projects (repo_ids) | ||
| const repos = db.prepare("SELECT DISTINCT repo_id FROM prompts WHERE repo_id IS NOT NULL").all() as { repo_id: string }[]; | ||
| console.log(`Found ${repos.length} projects with history.`); | ||
|
|
||
| for (const { repo_id } of repos) { | ||
| console.log(`\nMigrating project: ${repo_id}...`); | ||
|
|
||
| // Simulate a rootPath for the orchestrator (it uses basename(rootPath) as repoId) | ||
| // We'll use a dummy path that ends with the repo_id | ||
| const dummyRootPath = `C:\\repo\\${repo_id}`; | ||
|
|
||
| // 2. Fetch all successful executions for this repo | ||
| const executions = db.prepare(` | ||
| SELECT p.raw_prompt, e.result_summary, e.ended_at, e.executor_name | ||
| FROM prompts p | ||
| JOIN executions e ON p.id = e.prompt_id | ||
| WHERE p.repo_id = ? AND e.status = 'completed' | ||
| ORDER BY e.ended_at ASC | ||
| `).all(repo_id) as any[]; | ||
|
|
||
| console.log(`- Found ${executions.length} historical executions.`); | ||
|
|
||
| for (const exec of executions) { | ||
| const summary = `Historical: ${exec.result_summary || "Agent execution"}`; | ||
| const rationale = `Prompt: ${exec.raw_prompt}\n\nExecutor: ${exec.executor_name}\nDate: ${new Date(exec.ended_at).toLocaleString()}`; | ||
|
|
||
| await ObsidianOrchestrator.logActivity(dummyRootPath, summary, rationale); | ||
| } | ||
|
|
||
| // 3. Fetch all commits for this repo | ||
| const commits = db.prepare(` | ||
| SELECT message, committed_at, author, sha | ||
| FROM commits | ||
| WHERE repo_id = ? | ||
| ORDER BY committed_at ASC | ||
| `).all(repo_id) as any[]; | ||
|
|
||
| console.log(`- Found ${commits.length} historical commits.`); | ||
|
|
||
| for (const commit of commits) { | ||
| const summary = `Historical Commit: ${commit.sha.substring(0, 7)} - ${commit.message}`; | ||
| const rationale = `Author: ${commit.author}\nDate: ${new Date(commit.committed_at).toLocaleString()}`; | ||
|
|
||
| await ObsidianOrchestrator.logActivity(dummyRootPath, summary, rationale); | ||
| } | ||
|
|
||
| // 4. Sync lessons (Engineering Mandates) | ||
| await ObsidianOrchestrator.syncToWiki(dummyRootPath); | ||
| } | ||
|
|
||
| console.log("\nMigration Complete!"); | ||
| process.exit(0); | ||
| } | ||
|
|
||
| migrate().catch(err => { | ||
| console.error("Migration failed:", err); | ||
| process.exit(1); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the dashboard calls this endpoint it still uses
fetch('/api/timeline')with noprojectquery, soresolveSelectedPath(...)falls back tothis.rootPathand this newrepoIdis always passed togetUnifiedTimeline. In a dashboard with multiple visible projects, the “Global Intelligence Stream” now omits all non-root project activity instead of showing the unified timeline; only callers that add?project=get scoped data.Useful? React with 👍 / 👎.