Skip to content

[Feature] Support non-persisting fix-pattern mining for audit-only workflows #239

Description

@morluto

Motivation

workflow.mine_repository_fix_patterns is the right bounded operation for mining how a repository handled related symptoms. It searches the local corpus, can hydrate a bounded set of unknown-state finalists, and returns a typed report that separates merged, closed-unmerged, superseded, open, and unknown outcomes.

Audit-only and source-archaeology workflows also need this capability, but they may be operating under a read-only contract. The current workflow is durable: even with hydration_limit: 0 for a strictly offline run, it persists a report in local GitContribute state. That makes the aggregate unavailable to workflows that must not change the corpus while inspecting it.

Proposed Solution

Add an explicit non-persisting or dry-run mode to workflow.mine_repository_fix_patterns.

The mode should:

  • read the selected corpus state and return the same bounded report shape without creating a durable workflow artifact or changing corpus observations;
  • require or clearly report hydration_limit: 0 when no network or local write is permitted;
  • return whether the result was persisted and which corpus observation time or revision was read;
  • preserve the existing persisted mode and its bounded hydration behavior; and
  • make an attempted network or write operation an explicit refusal rather than an implicit side effect.

A non-persisting result may be a bounded structured response rather than a durable resource. If the operation needs a durable resource for large output, the contract should state that the read-only mode cannot provide that resource without persistence.

Alternatives Considered

  • Compose corpus.search_threads, finalist selection, and precedent reads manually. This avoids writes but recreates the error-prone search/select/hydrate loop and loses the aggregate's outcome accounting.
  • Allow the current workflow to persist during audits. This violates a useful read-only boundary and makes before/after corpus comparisons harder to interpret.
  • Add a separate unbounded history search. That would duplicate the existing bounded fix-pattern workflow rather than clarify its side effects.

Impact

This would let audit agents and other read-only consumers use the repository-level historical mining capability without changing local corpus state. It must not mutate GitHub, execute repository-controlled code, or weaken the existing bounds on search and hydration.

Acceptance Criteria

  • A read-only invocation produces the bounded fix-pattern report without changing corpus rows, observations, jobs, or durable workflow artifacts.
  • hydration_limit: 0 performs no GitHub requests and reports that no hydration occurred.
  • The result distinguishes persisted from non-persisted execution and preserves coverage, truncation, and unknown outcomes.
  • Existing persisted invocations remain backward compatible.
  • Tests assert database/filesystem state before and after the read-only call and cover partial, unknown, and empty populations.

Related: #236 (canonical source-audit workflow), #222 (source-bound evidence manifests).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions