Skip to content

Feature: in-file text/code redaction in fixture3 reduce (blocked on guardrail3 walker extraction) #6

Description

@tartakovsky

What

Add text redaction within files (in addition to the existing folder and file redaction in fixture3 reduce). Currently the reducer can remove whole files and directory subtrees; it cannot remove sections of code within a file.

Why

Real fixture trees often have files where only some functions, types, or code blocks are actually exercised by the suite. Keeping the whole file when only 20% is reachable inflates fixtures and obscures what's actually under test. In-file redaction would let fixture3 reduce produce a truly minimal fixture: not just "fewest files" but "smallest possible content per file."

Blocker

This work depends on extracting the code-walking components from guardrail3 (syn for Rust, tree-sitter for TypeScript and others) into a reusable package. Today those walkers live inside guardrail3's source-scan crates and aren't published as a standalone dependency. The extraction work belongs in guardrail3, not here.

Tracking blocker as a sibling issue when one is opened in guardrail3.

Approach (after blocker resolves)

  1. Add a --reducers code flag to fixture3 reduce.
  2. For each file in the trial tree, walk the AST and try removing one definition at a time (function, struct, impl, module, top-level statement).
  3. Run the suite. If approved output stays stable, keep the removal.
  4. Continue until no further definition can be removed.
  5. Same DDMin oracle-budget model as the existing reducers.

Done

  • fixture3 reduce --reducers code works on at least Rust and TypeScript.
  • Documented in wiki Workflow and Commands.
  • Self-suite + fake-project verifications still pass after the change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestNew command, flag, or behaviorroadmapPlanned feature on the roadmap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions