/experiments/6_9_mini_harness/

Section 6.9 experiment: A 100-line minimal Coding Harness in pure Python stdlib (with safe_path boundary check, 3 atomic tools, SKILL.md progressive disclosure, and a 6-turn live repair trajectory)

Files in this folder

File / folderDescriptionSize
📁 ../Up one level-
📁 sample_output/Subfolder-
📁 workspace/Subfolder-
📄 README.md2.1 KB
📄 mini_harness.py6.5 KB

README.md

6.9 Build a Minimal Coding Harness in 100 Lines and Equip Its First Skill

This experiment implements a complete, minimal coding harness in under 170 lines of pure Python standard library code (zero third-party dependencies):

  1. Three orthogonal atomic tools: read_file, write_file, and bash (with safe_path workspace boundary checks and a 15-second command timeout).
  2. Progressive disclosure for Skills: On startup, the harness scans the YAML frontmatter of workspace/.agents/skills/*/SKILL.md and injects only a one-line summary (< 50 tokens) into the system prompt. When the model sees a task related to a Skill, it calls read_file on demand to read the full SKILL.md checklist.
  3. Agent main loop: A simple loop that appends model tool calls and environment outputs to messages until all unit tests and ledger reconciliation checks pass.

Requirements

Only the Python 3 standard library and an AI Builder Space API key. It runs on any machine.

How to Run

cd 6_9_mini_harness
export AI_BUILDER_TOKEN=sk_your_key
python3 mini_harness.py

You can also pass a custom instruction:

python3 mini_harness.py --task "Add a max_discount=50.0 cap parameter to settle_order in settlement.py, and add a unit test that passes"

What You Should See

By default, the task asks the agent to fix the order settlement function in workspace/settlement.py. When you run it, you will see a complete 6-turn closed-loop trajectory (a reference log is saved in sample_output/deepseek_run.txt):