feat(bench): JIT arm from real aj compile (not a hardcoded skill)#13
Merged
Conversation
Answers "is the benchmark's skill actually compiled by AgentJIT?" — now, yes, for compilable workflows. - CompilableFixture interface: SeedSessions (writes workflow session logs) + SkillName. ShellSeqFixture: a repetitive shell sequence (mkdir + N touches) that AgentJIT's deterministic compiler turns into a real shell-script skill. - CompileSkill: seeds logs into an isolated AJ_HOME, runs the real `aj compile`, copies the generated skill into the task's .claude/skills, and returns the true compile cost (0 on the deterministic path). - runGenCompare: for a CompilableFixture the JIT arm now runs real aj compile; break-even uses the actual compile cost unless --compile-cost overrides. NullCheckFixture (Edit-based) keeps its hand-written skill — the deterministic compiler only emits Bash steps, so it isn't compilable. Tests build the aj binary and run the real compile end-to-end: seed -> `aj compile` -> generated skill script installed, cost 0. Note on results: deterministic compile is zero-token, so break-even is immediate — but single-rollout A/B numbers are noisy because baseline T2S is dominated by prompt cache state that carries across sequential episodes. Use --rollouts >= 3 (harness already reports mean/median/spread). Refs: benchmark sandbox design; addresses the "hardcoded skill" limitation in docs/superpowers/specs/2026-07-06-benchmark-findings.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Records the trustworthy --rollouts 3 numbers for the genuinely compiled skill: shellseq n=2 saves 35/use, n=4 saves 19/use (~0% on a ~93k baseline), both at iso-accuracy. Confirms the "trivial workflow → skill doesn't pay off" conclusion holds for a real compiled skill, not just the hand-written one. Marks the hardcoded-skill and rollouts=1 limitations as addressed; the exploration-heavy shape remains the open question. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Answers "is the benchmark's JIT skill actually compiled by AgentJIT?" — now yes, for compilable workflows. (Previously the JIT arm installed a hand-written SKILL.md.)
What's here
CompilableFixtureinterface (SeedSessions+SkillName) andShellSeqFixture— a repetitive shell workflow (mkdir -p out+ Ntouch) that AgentJIT's deterministic compiler turns into a real shell-script skill.CompileSkill: seeds the workflow's session logs into an isolatedAJ_HOME, runs the realaj compile, copies the generated skill into the JIT arm's.claude/skills/, and returns the true compile cost (0 on the deterministic path).runGenCompare: for aCompilableFixturethe JIT arm now runs realaj compile; break-even uses the actual compile cost unless--compile-costoverrides.nullcheck(Edit-based) keeps its hand-written skill — the deterministic backend only emits Bash steps, so it isn't compilable and would route to the LLM.Tests / verification
TestCompileSkillProducesRealSkillbuilds theajbinary and runs the real compile end-to-end: seed →aj compile→ generated skill script installed, cost 0.golangci-lintclean.--gen shellseq --n 2 --compare): the JIT arm received a genuineaj compileskill (mkdir-out/scripts/mkdir-out.sh), both arms solved at iso-accuracy.Honest caveat on numbers
Deterministic compile is zero-token, so break-even is immediate by that measure. But single-rollout A/B token numbers are noisy — baseline T2S is dominated by prompt-cache state that carries across the two sequential episodes (one run showed baseline 0 vs jit 46k; isolated baseline ~93k). Use
--rollouts ≥ 3(the harness already reports mean/median/spread). The harness faithfully reports whatclaudereturns; this is a measurement property, not a harness bug.Addresses the "hardcoded skill" limitation noted in
docs/superpowers/specs/2026-07-06-benchmark-findings.md.🤖 Generated with Claude Code