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

@@ -25,7 +25,7 @@ func TestNativeCompletionAndInvocation(t *testing.T) {
runner := &SubprocessRunner{run: func(_ context.Context, request subprocess.RunRequest) (subprocess.RunResult, error) {
args = request.Args
document, _ := json.Marshal(map[string]any{"pipeline": req.PipelineID, "artifact_count": 12, "output_directory": bundle, "fallback_count": 3})
if err := os.WriteFile(req.ReceiptPath, document, 0o600); err != nil {
if err := os.WriteFile(req.ReportPath, document, 0o600); err != nil {
t.Fatal(err)
}
return subprocess.RunResult{}, nil
@@ -47,7 +47,7 @@ func TestNativeCompletionRequiresSuccessfulExit(t *testing.T) {
req := validRunRequest(t)
req.DebugDirectory = filepath.Join(filepath.Dir(req.LogPath), "debug")
runner := &SubprocessRunner{run: func(_ context.Context, _ subprocess.RunRequest) (subprocess.RunResult, error) {
if err := os.WriteFile(req.ReceiptPath, []byte(`{"pipeline":"dnd-session","artifact_count":0,"output_directory":"/tmp"}`), 0o600); err != nil {
if err := os.WriteFile(req.ReportPath, []byte(`{"pipeline":"dnd-session","artifact_count":0,"output_directory":"/tmp"}`), 0o600); err != nil {
t.Fatal(err)
}
return subprocess.RunResult{ExitCode: 1}, errors.New("process failed")
@@ -71,7 +71,7 @@ func TestNativeCompletionRejectsInvalidReports(t *testing.T) {
req := validRunRequest(t)
req.DebugDirectory = filepath.Join(filepath.Dir(req.LogPath), "debug")
runner := &SubprocessRunner{run: func(_ context.Context, _ subprocess.RunRequest) (subprocess.RunResult, error) {
if err := os.WriteFile(req.ReceiptPath, []byte(test.body), 0o600); err != nil {
if err := os.WriteFile(req.ReportPath, []byte(test.body), 0o600); err != nil {
t.Fatal(err)
}
return subprocess.RunResult{}, nil
@@ -97,7 +97,7 @@ func TestNativeInvocationOmitsOptionalControls(t *testing.T) {
t.Fatalf("args = %#v, want %#v", request.Args, want)
}
document, _ := json.Marshal(map[string]any{"pipeline": req.PipelineID, "artifact_count": 0, "output_directory": bundle})
if err := os.WriteFile(req.ReceiptPath, document, 0o600); err != nil {
if err := os.WriteFile(req.ReportPath, document, 0o600); err != nil {
t.Fatal(err)
}
return subprocess.RunResult{}, nil