Class ScanStage
java.lang.Object
com.tnsai.quality.security.harness.ScanStage
- All Implemented Interfaces:
PipelineStage
The
scan stage (TNS-291). Walks the project root, runs every
registered MatcherSpi against every (filtered) file, and persists
a FileRecord for each file where at least one matcher fired.
Idempotent: re-running on an unchanged tree skips files whose stored
contentHash still matches the on-disk
file. The stored record's candidate-matchers set may grow if a new
matcher has been added since the last run, but the agent runs / findings
already on the record are preserved.
File walk respects two config knobs (read from
PipelineContext.config()):
"scan.includeGlobs"— comma-separated list of glob patterns; defaults to common source extensions across the supported languages."scan.excludeGlobs"— comma-separated list of glob patterns to skip; defaults to common build / vendor directories.
- Since:
- 0.10.0 (TNS-291)
-
Field Summary
FieldsModifier and TypeFieldDescriptionBuilt-in default exclude globs.Built-in default include globs. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(PipelineContext ctx) Execute the stage.id()Stable id, e.g.
-
Field Details
-
DEFAULT_INCLUDES
Built-in default include globs. -
DEFAULT_EXCLUDES
Built-in default exclude globs.
-
-
Constructor Details
-
ScanStage
public ScanStage()
-
-
Method Details
-
id
Description copied from interface:PipelineStageStable id, e.g."scan","process".- Specified by:
idin interfacePipelineStage
-
execute
Description copied from interface:PipelineStageExecute the stage. Reads from / writes toctx.stateStore().Stages SHOULD respect
Thread.interrupted()— long-running stages (process, revalidate) check periodically so the pipeline can be cancelled cleanly.- Specified by:
executein interfacePipelineStage
-