Class ProcessStage

java.lang.Object
com.tnsai.quality.security.harness.ProcessStage
All Implemented Interfaces:
PipelineStage

public final class ProcessStage extends Object implements PipelineStage
The process stage (TNS-291). Iterates over scanned FileRecords and invokes the first registered ReviewAgentSpi on each, persisting findings + an AgentRun entry per invocation.

Idempotent: skips files where the most recent successful agent run had the same (agentId, agentVersion, inputHash) tuple. Re-running after the agent's version bumps invalidates cached runs; re-running after the file content changes invalidates them too.

Cost containment (lightweight): process.maxFiles and process.maxFindings config keys cap the work this stage does in a single invocation. The deeper CostBudget integration is a follow-up — see TNS-291 issue body.

Since:
0.10.0 (TNS-291)
  • Constructor Details

    • ProcessStage

      public ProcessStage()
  • Method Details

    • id

      public String id()
      Description copied from interface: PipelineStage
      Stable id, e.g. "scan", "process".
      Specified by:
      id in interface PipelineStage
    • execute

      public StageResult execute(PipelineContext ctx)
      Description copied from interface: PipelineStage
      Execute the stage. Reads from / writes to ctx.stateStore().

      Stages SHOULD respect Thread.interrupted() — long-running stages (process, revalidate) check periodically so the pipeline can be cancelled cleanly.

      Specified by:
      execute in interface PipelineStage