OPENKEDGE · CONTROLLED AGENT EXPERIENCEOpen source · Pre-alpha

Your agents can code.
Can they survive your environment?

Test changes. Compare outcomes. Keep the evidence.

A coding agent may know the right command and still miss the failure mode in your repository. Hardknock gives it disposable Git environments to rehearse changes, test alternatives, and record what actually happened before a team relies on the lesson.

Give agents somewhere to fail before production. Keep the failed attempt, the tested alternative, and the conditions that made the difference.
Murph the Axolotl mascot
Murph the Axolotl 🌸
“Winning once means you found a move. Breaking it five different ways means you started learning it.”

Axolotls regenerate after injury; Murph represents the same ambition: fail safely, test alternatives, and retain validated experience.

Part of the OpenKedge program

Practice creates evidence. Governance decides what to do with it.

Hardknock explores what agents can learn in controlled environments. PCI asks which lessons and claims may become part of a persistent identity. PDDS asks when an agent may change protected state. A Hardknock result does not automatically become accepted memory or execution authority; those decisions require explicit review and integration.

01 · Rehearse

Run a risky coding task away from the production workspace.

02 · Inspect

Compare the failed and alternative paths with recorded checks.

03 · Decide

Review what may be retained or admitted under your own policy.

The Core Distinction

Skills make agents capable. Lessons make them resilient.

A model may know the standard procedure and still miss the conditions that break it in your environment. Controlled trials expose those conditions.

Knowledge ≠ Experience

An agent entering a codebase for the first time has not personally learned:

  • •Which migration repeatedly breaks this database
  • •Which package upgrade introduces subtle regressions
  • •Which strategy works until network latency appears
  • •Which warning signs predict an imminent outage
  • •Which lesson learned 6 months ago is now obsolete
Humans learn these through mistakes and debugging. Agents need an empirical substrate to do the same.
The Hardknock Ontology in ActionMonorepo Case Study
SKILL (The Technique)“How do I do this?”
Upgrade dependencies with pnpm install.
LESSON (The Judgment)“Why did this fail & what to change?”
In repos with pnpm-workspace.yaml, npm install introduces conflicting lockfiles. Prefer pnpm under tested conditions.
REFLEX (The Instinct)
Detect pnpm-workspace.yaml + npm install before execution → warn/replan.
RECOVERY (The Comeback)
Remove conflicting lockfile, restore clean Git tree, reinstall via pnpm, rerun check.
EXPERIENCE (The Ground Truth): Immutable commit snapshot 7b4c9e1, stdout/stderr, diffs, test exit 1, and paired counterfactual trials.
MEMORY
“Remember this.”
Recall unverified text strings
SKILL
“Do this.”
Execute procedural recipes
REFLECTION
“I think why…”
Infer candidate explanation
SANDBOX
“Isolate this.”
Contain destructive effects
EVALUATION
“Did it pass?”
Measure immediate run outcome
HARDKNOCK
“Test & Learn.”
Empirical experience engine
The Scientific Method for Agents

A plausible plan is not a tested plan.

Follow one scripted repository example from failed action to alternative trial. It illustrates the evidence Hardknock aims to record; it is not a live production run. Reflection proposes. Tests challenge.

Reason
THINK
Dojo
TRY
Lesson
KNOW
Interactive illustration · Scripted scenarios and sample records. This page does not run agents, commands, or Git worktrees.
Scenario:
Murph the AxolotlMood: BROKEN 🩹 💥
💡 Click Murph to interact!

“Ouch! I ran `npm install` inside this pnpm workspace and broke the build! In Hardknock, this failure becomes an immutable scar, not an outage.”

Axolotls regenerate limbs without scars; Murph gives agents scars in the Dojo without production outages.
Illustrated Dojo Comparison

Explore a sample comparison from starting snapshot 7b4c9e1. The worktrees and outcomes shown here are illustrative.

Illustrative Condition Controls
Preview conditions; these controls do not execute a trial
Latency Jitter:800ms
Token Expiry Mid-Flight:OFF
Tool Drop Probability:10%
Reality A (Baseline Strategy)
worktree/dojo-reality-a
Action:npm install @openkedge/core
Isolation:Detached Worktree
Chaos Impact:+800ms latency
Execution Progress0%
Evaluation Outcome:
Awaiting trial launch...
Reality B (Counterfactual Strategy)
worktree/dojo-reality-b
Action:pnpm add @openkedge/core
Isolation:Detached Worktree
Resilience Reflex:Handled Latency & Disconnects
Execution Progress0%
Evaluation Outcome:
Awaiting trial launch...
The Dojo: Disposable Realities 🥋

Production is a terrible classroom.

Live failures are expensive and scarce. Teams try to avoid them rather than repeat them for learning. The Dojo changes the economics through failure amplification without production impact.

Hardknock reconstructs the starting commit, forks isolated Git worktrees, tests competing actions, and discards the trial environments while retaining the records.

Realities Workflow API
Reality.create() → fork() → execute() → diff() → evaluate() → discard()
Chaos Engineering for Agents 💥

Discover the Operating Envelope

This experimental direction asks: “Under what conditions does this agent's learned strategy stop behaving correctly?” Perturbation features are still being developed.

“Hardknock doesn't just teach agents what works. It teaches them where it stops working.”
Operating Envelope Formula
Known Skill → Chaos Injections → Discover Boundary → Resilient Skill
Institutional Asset

Your model is replaceable.
Your experience shouldn't be.

A lesson stored with the repository can remain inspectable when an organization changes models or providers. Reuse across agents requires compatible integrations and fresh checks in the new environment.

Hardknock records candidate lessons outside model weights in an inspectable SQLite ledger with environment fingerprints and linked trial records. That gives a team evidence to review before reuse.

Evidence Promotion Ladder
OBSERVED→CANDIDATE→SUPPORTED (0.78)→VALIDATED (0.90)
Falsifiability & Unlearning Progression
TRUSTED→CONTRADICTED→WEAKENED→RETIRED

“A learning system that cannot unlearn eventually becomes a mythology system.”

Developer Tooling

Interactive CLI Explorer 💻

Inspect execution records, manage candidate hypotheses, and trace decisions backwards with hardknock why.

Illustrative CLI transcript · no command is run on this page

Executes an agent task in a disposable Reality, verifies required checks, and retries automatically if a validated Lesson is retrieved.

$hardknock --repo ./pnpm-workspace run --agent claude-code --check './test.sh' --retry-with-experience --max-retries 1 'upgrade demo dependencies'
[hardknock] Verified clean starting snapshot: commit 7b4c9e1
[hardknock] Created disposable Reality: worktree/r0-trial-01
[retrieval] Found 1 matching lesson: lesson-402 [COUNTERFACTUALLY_SUPPORTED] (conf: 0.78)
[context] Injected advice via .hardknock/context.md:
          "Prefer 'pnpm install' over 'npm install' in this workspace."
[agent: claude-code] Reading advice... Executing: pnpm install @openkedge/sdk
[evaluator] Running required check: ./test.sh
[evaluator] ✅ All 14 tests PASSED (Exit 0).
[hardknock] Task complete. Experience exp-398a linked. Reality discarded.
Implementation Status MatrixPre-alpha Verification
Experience Schema & SQLite StoreTyped, immutable execution records, failure signatures, and BLAKE3 environment fingerprints.Implemented
Dojo Git RealitiesDetached Git worktree sandboxes, starting-snapshot verification, diff capture, and automatic disposal.Implemented
Candidate Hypothesis ExtractionScoped Lesson proposals with action matchers, marker files, and avoid/prefer strategies.Implemented
Paired Counterfactual ExperimentsTwin Baseline vs Alternative trials under identical snapshots to test proposed causality.Implemented
Scoped Retrieval & LineageInjecting experience into .hardknock/context.md and tracing decisions with 'hardknock why'.Implemented
Cross-Repository Transfer ValidationPromoting lessons from CounterfactuallySupported (0.78) to Validated (0.90) on distinct trees.Implemented
Comparative Architectural Analysis

Where Hardknock fits in your agent stack

Compare its role with agent runtimes, tracing platforms, benchmarks, and sandboxes. These tools answer different buyer questions; the matrices show where controlled experience adds value.

Open Source Under MIT License 🌸

Bring a failure mode.
Let an agent test it first.

Start with one repository, one recurring agent mistake, and one check your team trusts. A controlled pilot can show what Hardknock records, what it learns, and what still needs an operator's decision.

Pre-alpha open source. Evaluate the evidence and integration requirements with your own team.