Skip to content

DEPYLER-3004: Phase 3 — Skills + oracle integration #259

Description

@noahgift

Umbrella: #255
Spec: docs/specifications/depyler-repair-mode.md (branch `feat/repair-mode-spec`)
Depends on: DEPYLER-3003 (Phase 2)
Blocks: DEPYLER-3005 (Phase 4)

Scope

Add the two pieces that elevate Phase 2's "ask Claude to fix Rust" into a structured pipeline:

  1. Markdown skills under `crates/depyler-repair/skills/` — one file per recurring failure idiom. The agent loads relevant skills based on the failing diagnostic class.
  2. Oracle integration — the agent's exit condition becomes `cargo build && cargo test --oracle`, where the oracle is the original Python run on a captured input fixture. Repair output must match Python semantically, not just compile.

Skills (v1 starter set)

  • `skills/lifetimes.md` — common borrow/lifetime resolution patterns
  • `skills/stdlib_import_resolution.md` — when consult_stdlib_map returns nothing
  • `skills/generators.md` — Python generators → Rust iterators
  • `skills/context_managers.md` — `with` blocks → RAII / scope guards
  • `skills/decorators.md` — common decorator translations

The skill format follows alchemize's: short, prescriptive, with idiomatic Rust examples.

Deliverables

  • `apply_skill(name)` and `run_python_oracle(inputs)` tools added to the agent surface
  • Skill loader with content-hash inclusion in cache key (so editing a skill invalidates relevant cache entries)
  • `depyler-oracle` integration: input fixture extraction at static-pass time, Python execution wrapper, equality predicate per type
  • At least 5 skills written, each with a corpus regression test
  • Oracle equality config: bitwise for ints, exact for strings, configurable tolerance for floats (default 1e-9 abs / 1e-6 rel), structural for collections

Contracts enforced

  • C-REPAIR-ORACLE (`contracts/repair-oracle-v1.yaml`) — exit requires both passes; oracle inputs captured before generation
  • C-SKILL-GRADUATION (`contracts/skill-graduation-v1.yaml`) — skill invocations are logged

Exit criterion

  • Tier 2 (typed-cli) corpus hits ≥85% single-shot-or-repaired (currently 62.5%)
  • ≥3 skills graduated to `depyler-core` static rules (i.e., Phase 4's pipeline produces something)
  • Every repaired file in the corpus has a recorded oracle pass in telemetry

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions