Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ korg campaign --tui --prompt "Refactor the auth layer to use JWTs"
# Web cockpit at localhost:8080
korg campaign --web --prompt "Optimize the database connection pool"

# Pure autonomous goal mode (--goal is a top-level flag)
# Pure autonomous goal mode (--goal is a top-level flag). Each persona works in
# its own git worktree and runs a real `cargo check`, so on a large repo a cold
# run takes minutes; `--speculative` pre-warms a shared target dir.
korg --goal "Write and validate a full test suite for src/parser.rs"

# Run the full multi-persona swarm on a REAL local model — every persona
Expand All @@ -232,7 +234,10 @@ korg --preview "Refactor the main event loop"
### Rewind & Verify

```bash
# Rewind the capability journal to a specific ledger sequence point
# Rewind the capability journal (.korg/capability_journal.json) to a prior
# sequence point. It is populated by campaigns (`korg --goal`, `korg campaign`);
# on a fresh checkout there is nothing to rewind yet — `korg demo` shows the
# full rewind flow in a self-contained sandbox.
korg rewind --seq 4

# Drive the honest pipeline on a fixture and emit a verifiable ledger
Expand Down
10 changes: 10 additions & 0 deletions crates/korg-runtime/src/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,16 @@ impl SingleWorkerHarness {
}

let branch_name = format!("korg-branch-{}", routing_id);

// A previous run that was interrupted (Ctrl-C, timeout) leaves its
// worktree registered in git even though the directory was removed
// above; `worktree add -B` then refuses to reset the branch it still
// holds. Pruning drops registrations whose directories are gone.
let _ = tokio::process::Command::new("git")
.args(&["worktree", "prune"])
.output()
.await;

eprintln!(
"[Harness] Spinning up physical worktree at {:?} from commit {} (branch: {})",
worktree_path, snapshot_ref, branch_name
Expand Down
Binary file modified demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified demo.mp4
Binary file not shown.
16 changes: 11 additions & 5 deletions demo.tape
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Set PlaybackSpeed 1
Hide
Type "export PATH=$PWD/target/release:$PATH"
Enter
# Seed a real capability journal for step 5: run an actual (hermetic,
# deterministic-provider) swarm campaign on a scratch copy of the fixture repo.
# This takes ~1 min and is hidden only to keep the GIF short.
Type "W=$(mktemp -d) && cp -r fixtures/honest-demo-repo/. $W && git -C $W init -q && git -C $W add -A && git -C $W -c user.email=demo@korg -c user.name=demo commit -qm init && (cd $W && korg --goal 'Fix the add function in src/lib.rs so it adds' >/dev/null 2>&1)"
Enter
Sleep 120s
Type "clear"
Enter
Show
Expand Down Expand Up @@ -66,10 +72,10 @@ Sleep 3s
Ctrl+L

# ── 5. Real reversible rewind of the capability journal ───────────────────────
# Operates on this repo's real .korg/execution_journal.jsonl — a real
# hash-chained truncation + re-seal, not a scripted message.
# Operates on the real .korg/capability_journal.json the hidden setup's campaign
# wrote — a real hash-chained truncation + LedgerRewind seal, not a scripted message.
Sleep 400ms
Type "korg rewind --seq 1"
Type "cd $W && korg rewind --seq 4"
Enter
Sleep 4s
Ctrl+L
Expand All @@ -83,11 +89,11 @@ Enter
Sleep 600ms
Type "echo ''"
Enter
Type "echo 'A tamper-evident ledger for AI agent cognition — no trust in the tool.'"
Type "echo 'A tamper-evident ledger for AI agent cognition. No trust in the tool.'"
Enter
Sleep 600ms
Type "echo ''"
Enter
Type "echo 'cargo install korg → github.com/New1Direction/korg'"
Type "echo 'git clone github.com/New1Direction/korg && cargo build --release'"
Enter
Sleep 4s
Binary file modified demo.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion korg.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# korg Swarm cognitive configuration surface
default_llm = "ollama"
# Hermetic by default (no network, no model). Pass `--provider ollama` or set
# default_llm = "ollama" here to run every persona on a live local model.
default_llm = "deterministic"
default_model = "llama3-70b-monochrome"

[ollama]
Expand Down
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,14 @@ async fn main() -> Result<()> {
Commands::Rewind { seq } => {
let mut journal = korg_registry::CapabilityJournal::default_journal();
let prev_count = journal.events.len();
if journal.events.is_empty() {
eprintln!(
"\n\x1b[38;2;255;0;180m❌ Nothing to rewind: no events in .korg/capability_journal.json yet.\x1b[0m\n \
Record some first, e.g. `korg --goal \"<task>\"`, or run `korg demo` for a\n \
self-contained rewind walkthrough."
);
std::process::exit(1);
}
match journal.rewind_with_seal(seq, "korg:cli", "operator rewind") {
Ok(()) => {
let green = "\x1b[38;2;0;255;128m";
Expand Down Expand Up @@ -855,7 +863,7 @@ async fn main() -> Result<()> {
let pink = "\x1b[38;2;255;0;180m";
let reset = "\x1b[0m";
eprintln!("\n{}❌ Rewind failed: {}{}", pink, e, reset);
return Err(anyhow::anyhow!("Rewind failed: {}", e));
std::process::exit(1);
}
}
}
Expand Down
Loading