Interface PipelineStateStore

All Known Implementing Classes:
FileSystemPipelineStateStore

public interface PipelineStateStore
Persistence layer for the code-review pipeline (TNS-291).

Owns the canonical disk layout (deepsec-shaped):

 data/<projectId>/
 ├── project.json           # project metadata
 ├── files/
 │   ├── <hash>.json     # one FileRecord per file (keyed by path hash)
 ├── runs/
 │   ├── <runId>.json    # stage-execution audit trail
 └── reports/
     ├── findings.sarif      # exporter output
     └── ...
 

Implementations MUST be safe for concurrent reads and serialise writes per FileRecord (one writer at a time per path) so stages can fan-out across files without corrupting each other.

Since:
0.10.0 (TNS-291)
  • Method Details

    • initProject

      void initProject(String projectId, Path projectRoot)
      Initialise (or open) project state under projectId. Creates the disk layout if missing; idempotent.
    • saveFile

      void saveFile(FileRecord record)
      Persist a FileRecord for the file at record.path(). Subsequent reads return this record until the next write.
    • getFile

      Optional<FileRecord> getFile(Path path)
      Look up a record by its relative path.
    • listFiles

      List<FileRecord> listFiles()
      All records currently stored for the project, in deterministic order.
    • appendRun

      void appendRun(PipelineStateStore.RunMetadata run)
      Append a stage-execution entry to the run log. Used by stages to record their StageResult for the report stage.
    • listRuns

      All run-log entries for stage, oldest first.
    • writeReport

      void writeReport(String name, byte[] content)
      Write a binary report (findings.sarif, findings.md, …) under reports/. Overwrites any existing file with the same name.