package pipeline import ( "context" "encoding/json" ) // RunWritePaths returns the write paths a run declared (relative to its // workspace; empty when it declared none). The workspace reservation check // reads it only when two runs' workspaces nest outside any repository. func (s *Store) RunWritePaths(ctx context.Context, id int64) ([]string, error) { var encoded string if err := s.db.QueryRowContext(ctx, "SELECT write_paths FROM pipeline_runs WHERE id=?", id).Scan(&encoded); err != nil { return nil, err } var paths []string if encoded == "" { return nil, nil } if err := json.Unmarshal([]byte(encoded), &paths); err != nil { return nil, err } return paths, nil }