Evidence-licensed workflow specialization

Compile the routine.
Refuse the uncertain.

Guarded Agentic Compaction turns recurrent, read-only tool prefixes into inspectable programs—but only when value provenance, effects, compatibility, replay, and finite-sample evidence agree.

396real-record discovery traces across three workflow families
90held-out live-provider records with exact graders
3distinct decisions and three-tool vocabularies
356tests in the validated full repository suite

The problem

Recurrence is a clue, not a license.

Mature agents often pay an LLM to choose the same evidence path again. A naive optimizer bundles the calls. GAC asks the harder question: what observable evidence permits removing those model boundaries, and when must the optimizer abstain?

Ground every value

Every synthesized argument must resolve from entry state or a prior observed result through a bounded transform.

Treat effects as barriers

Unknown effects, writes, approvals, handoffs, errors, incompatible principals, and unsafe runtime positions stop compilation.

Make refusal useful

When support cannot justify the configured risk bound, the artifact retires and the unchanged agent remains the answer.

Compiler path

Five independent rejection points protect one small program.

The method is deliberately conservative. Passing one stage never weakens the next; a recurrent sequence can still fail provenance, effects, synthesis, validation, or admission.

  1. 01

    Capture

    Normalize traces, manifests, entry state, outcomes, and isolation keys.

  2. 02

    Qualify

    Cut regions at effects, approvals, handoffs, errors, and position boundaries.

  3. 03

    Synthesize

    Resolve typed provenance and emit only programs in the closed DSL.

  4. 04

    Validate

    Replay grouped traces, challenge contracts, and retain counterexamples.

  5. 05

    Admit

    Freeze the score, apply exact bounds, sign the artifact, or retire it.

Measured evidence

The strongest result is a boundary, not a leaderboard score.

Each row licenses a different claim. Real-record paired experiments test end-to-end intervention; public benchmarks test trace completeness, synthesis, replay, official harness compatibility, or an explicit gate.

EvidenceScopeObserved resultInterpretation
Three GitHub workflows90 paired held-out public recordsMeasured
Compiled 90/90 vs baseline 89/90; requests −66.6%; cost −58.7% weighted
Efficiency transfers across issue type, PR outcome, and backlog attention on one snapshot.
Hand-written programsSame 90 recordsMeasured
90/90; fair pre-model programs tie the two new learned programs
Manual code remains the runtime baseline; automatic evidence and lifecycle are the value claim.
NESTFUL1,415 executable tracesRetired
24 pass / 12 abstain / 0 wrong; max support 26 < 92
Recurrence and sound held-out replay are still insufficient for admission.
API-Bank212 complete tracesRetired
2 synthesized; both held-out windows abstain
A second compiler substrate reproduces the evidence shortage.
Eight supplementary benchmarksGold plans, simulations, live web, and real issuesScoped
Adapters, official paths, or prerequisite gates
Interoperability evidence is retained but excluded from the optimizer comparison.

Why it is different

The novelty is admissibility.

Agent compilation, meta-tools, prompt evolution, and plan caching already exist. GAC contributes a safety argument for specializing from historical executions.

  • Value-level provenance rather than sequence frequency alone
  • Application-owned effect, permission, freshness, and isolation boundaries
  • Bounded, inspectable synthesis rather than arbitrary generated code
  • Exact group-level admission with normal retirement
  • Immutable lifecycle, shadow execution, kill switch, and fallback
Comparison of unchanged agent, partial compiler, and hand-written macro on the natural GitHub study.
Real-record comparison. The macro establishes the practical floor; the compiler's value is automatic discovery plus explicit evidence and invalidation.

Read, inspect, reproduce.

The paper, editable slide decks, sealed result artifacts, and executable claim checks are available with the source.