Reconcile reuse and inspection with native extraction

This commit is contained in:
2026-11-30 02:20:09 +00:00
parent 52a5d483e3
commit b5b4672920
59 changed files with 515 additions and 2444 deletions

View File

@@ -66,7 +66,7 @@ func (r *SubprocessRunner) Preflight(ctx context.Context, req ReadinessRequest)
}
}
seenPaths := map[string]bool{}
for _, path := range []string{req.InspectionPath, req.InspectionLogPath, req.ReceiptPath, req.LogPath} {
for _, path := range []string{req.InspectionPath, req.InspectionLogPath, req.ReportPath, req.LogPath} {
path = filepath.Clean(path)
if seenPaths[path] {
return result, fmt.Errorf("notarius readiness report and diagnostic paths must be distinct")
@@ -105,9 +105,9 @@ func (r *SubprocessRunner) Preflight(ctx context.Context, req ReadinessRequest)
return result, fmt.Errorf("notarius pipeline %q does not define required lane %q", req.PipelineID, required)
}
}
outcome, runErr := r.run(ctx, subprocess.RunRequest{Executable: req.Binary, Args: runArgs("preflight", req.RunRequest, references), WorkingDir: req.WorkingDirectory, Timeout: req.Timeout, DiagnosticOwner: "notarius preflight", StdoutLogPath: req.ReceiptPath, StderrLogPath: req.LogPath, EnvOverrides: env, SensitiveEnvNames: names})
outcome, runErr := r.run(ctx, subprocess.RunRequest{Executable: req.Binary, Args: runArgs("preflight", req.RunRequest, references), WorkingDir: req.WorkingDirectory, Timeout: req.Timeout, DiagnosticOwner: "notarius preflight", StdoutLogPath: req.ReportPath, StderrLogPath: req.LogPath, EnvOverrides: env, SensitiveEnvNames: names})
result.ExitCode = outcome.ExitCode
assessment, assessmentErr := loadReadinessAssessment(req.ReceiptPath, req.PipelineID)
assessment, assessmentErr := loadReadinessAssessment(req.ReportPath, req.PipelineID)
if assessmentErr == nil {
result.AssessmentComplete = true
result.Ready, result.Checks, result.DebugDirectory = assessment.Ready, assessment.Checks, assessment.DebugDirectory
@@ -158,7 +158,7 @@ func loadPipelineLanes(path, pipelineID string) ([]string, error) {
} `json:"lanes"`
} `json:"steps"`
}
if err := decodeBoundedJSON(path, maxReceiptBytes, &doc); err != nil {
if err := decodeBoundedJSON(path, maxReportBytes, &doc); err != nil {
return nil, err
}
if doc.Pipeline != pipelineID || doc.Steps == nil || !completeInspectedModule(doc.Input) || !completeInspectedModule(doc.Chunk) || !completeInspectedModule(doc.Output) {
@@ -189,7 +189,7 @@ func loadReadinessAssessment(path, pipelineID string) (ReadinessResult, error) {
Checks *[]ReadinessCheck `json:"checks"`
DebugDirectory string `json:"debug_directory"`
}
if err := decodeBoundedJSON(path, maxReceiptBytes, &doc); err != nil {
if err := decodeBoundedJSON(path, maxReportBytes, &doc); err != nil {
return ReadinessResult{}, err
}
if doc.Pipeline != pipelineID || doc.Ready == nil || doc.Checks == nil || (doc.DebugDirectory != "" && !filepath.IsAbs(doc.DebugDirectory)) {